Questions tagged [shaders]
a computer program that runs on graphics hardware and provides a high degree of control over how scenes are rendered
2,045 questions
0
votes
0
answers
29
views
How to draw and pick lots of smooth curving lines?
I'm trying to implement a Solar System Viewer similar to NASA's Eyes.
I got the astrophysical part (get positions of the bodies at any time)
but I wonder how to best get the orbital lines/trails (...
0
votes
0
answers
59
views
How to implement a bilateral filter in a shader?
I want to implement a bilateral filter because I have read the it preserves the edges. The equation is given as:
$$ BF\left[I\right]_p =
\frac{1}{W_p}\sum_{q\in S}
G_{\sigma_s}\left( \left\Vert p-q \...
1
vote
0
answers
29
views
Halftoning Multipass HDRP Unity
I am pretty new to rendering, and I wanted to add a black and white halftone effect. I wrote the two shaders and created the materials (pass 0 to create mask and pass 1 to mix it with the scene). They ...
0
votes
0
answers
46
views
Can a single large SSBO in vulkan store different types of structs?
I was using tinkering with vulkan and was wondering if a SSBO can store a mix of structs of different kind like shown in picture and pass offsets of the said structs to access them in shader.
0
votes
1
answer
75
views
Difficulties for GPU rendering of a cone using parametric equation
I'm trying to render a cone at the gpu for some effects. I'm using the parametric equation provided here. I ended up with the shader below intended to work with an unorderedaccessview target (DX11). I'...
0
votes
1
answer
76
views
How to make volumetric scanning effects
I have an effect where a character has a small tool that emit a sort of scanning effect to detect some property of an object. My FX is simple as it uses a pyramidal mesh whose top is positioned where ...
3
votes
0
answers
150
views
Displaying pixel art at any resolution with subpixel movement
The Goal
I have a game in Unity which utilizes pixel art. I'm not following the standard rules of pixel art, however. I'm ok with sprites having different sized pixels, pixels rotating, and pixels not ...
0
votes
1
answer
130
views
Mipmaps and LOD Behavior in Skybox Shaders
Is it beneficial to use Generate Mipmaps for a texture used in a skybox shader?
I need to use tex2Dlod to fix the edge seams ...
1
vote
0
answers
98
views
using Unity URP/lit shader with skinning and DOTS
I'm using:
Unity: 6000.0.51f1
Entities: 1.3.14
Entities Graphics: 1.3.2
URP: 17.0.4
Shader Graph: 17.0.4
I'm fairly new to both DOTS and Shaders, but when trying to use DOTS with URP combined with ...
1
vote
0
answers
64
views
How can I dynamically make a distance field shape of the lit part of the moon to use it as a halo in a custom skybox shader?
I created a custom skybox shader featuring a black sky with only the moon and its halo. The moon responds realistically to the scene’s directional light (sunlight), which creates a convincing effect. ...
0
votes
0
answers
52
views
Is a shader easier or scripting easier in terms of creating a panel behind objects
My unity project is 2D universal.
My goal here is to create a comic-like panel with outlines behind objects that have certain tags. This panel should follow the rotation and size change of said ...
0
votes
0
answers
36
views
HLSL Automatic Root Signature Creation
I know of two different ways to specify a root signature in DX12, and those are:
Creating one with D3D12_VERSIONED_ROOT_SIGNATURE_DESC and ...
1
vote
0
answers
46
views
What is the best way to move a mask in a shader in a square path in Unity Shader Graph?
I would like to make the square move strictly along a square trajectory. The square will later be used to mask the main sprite.
How to achieve this result? How to move the square along the square's ...
0
votes
1
answer
113
views
What is the proper way to write a pixel shader that only outputs depth?
I have an effect that I want to only write to depth.
commandList->OMSetRenderTargets(0, nullptr, FALSE, &m_mainDepthStencilDescriptorHandle.getCpuHandle());
...
0
votes
0
answers
102
views
How to avoid noise with Volumetric Fog?
I had followed the youtube video by Technically harry to create a volumetric fog effect in Unity.
But when I get close to a object, the noise is very noticeable which I would like to avoid.
I tried ...
0
votes
1
answer
93
views
Unity shader optimization
I have a problem with badly optimized palette cycling function of the background shader:
...
0
votes
1
answer
86
views
Tesselation and Geometry shader do not render anything
I am experiencing an extremely odd situation with the introduction of the tesselation control and evaluation shaders in my OpenGL rendering pipeline.
I defined an instanced indexed mesh whose ...
0
votes
1
answer
158
views
How do you detect edges in a PNG map
so basically i'm making a personal project based around a strategy map game.
I'm using this image as the map:
The problems are as follows:
I can't detect the borders as it is not an SVG
If the first ...
5
votes
1
answer
563
views
Recreating a 3D pixel art water effect
For the past few days, I've been trying to recreate an effect from this blog post on 3D Pixel Art Rendering by David Holland.
If you scroll down, you'll reach the Water section in which the author ...
0
votes
0
answers
72
views
How do you make unity shader with custom lighting usable in deferred rendering mode
I found a unity shader with custom lighting method that approximates subsurface scattering effect. I tried using it in deferred rendering mode and unfortunately it doesn't work. From what I have read ...
0
votes
0
answers
80
views
Projecting 3D gaussian's transform matrix to a 2D viewspace transform matrix
Essentially I'm wanting to project:
A 3D transformation matrix of a Gaussian (or in this case for simplicity a unit sphere) that includes scale, rotation and translation in world space TO
A 2D ...
0
votes
0
answers
144
views
How do I add an outline to a Unity tilemap?
Is it possible to add a nice outline to a unity tilemap?
For example, if my tilemap looks something like the image on the left, I want to make it render like the image on the right:
I found this ...
1
vote
0
answers
41
views
How to apply a noise texture to an image or sprite in Phaser as a postFX?
I'm trying to figure out if it's possible to blend a (noise)texture with an image by creating a shader, and then apply the shader as a postFX to an image (or sprite). (see attached image)
...
0
votes
0
answers
29
views
Lost preview frames on ID3D10RenderTargetView in DirectX 10
Problem: This code should do a right-shifting trailing effect by accumulating previous frames on g_pSurfaceImg[0] but fails.
Incorrect result: the image that should ...
1
vote
1
answer
65
views
How to make tiling properties work with additional texture slots in a Unity Surface Shader?
I have created a custom shader based on Unity's standard surface shader,
but tiling and offset properties don't work at all.
Only the albedo texture slot's tiling works.
How do you make tiling work ...
1
vote
0
answers
69
views
Can I apply a single material over every submesh?
I have a shader for outlining an object, how do I apply the material with this shader to all submeshes, not just the last one?
0
votes
3
answers
603
views
How to use a Shader Graph to layer a texture over a sprite without being affected by the sprite's alpha?
I have a hexagon sprite MainTex over which I want to render an outline texture SecondaryTex independent of the alpha value of the MainTex. Since I have a fairly large grid with many hexagons, two ...
0
votes
1
answer
50
views
Problems supplying per-vertex alpha data to Monogame shader
I am trying to make a trail renderer in Monogame. What I have currently is a procedurally created trail-mesh with properly applied UV coordinates, and what I have left to do is apply a per-vertex '...
0
votes
1
answer
130
views
Post process effect with sphere mask is offset until the window is resized
I am having a weird issue with the position of my sphere mask. Here is what it looks like currently:
The white disc should be directly under the player character, not shifted off to the side.
...
0
votes
1
answer
181
views
Is memcpy safe to use to fill an ID3DBlob with a pre-compiled shader?
Following my post Saving shaders to file I then tried to load shader object files to recreate my shaders.
I found some Q&A about how to load precompiled HLSL shaders into memory, including a short ...
1
vote
1
answer
151
views
Saving shaders to file
I'm in the process of writing saving/loading function for my little game. I'm willing to save the shaders as resource as I did for texture and meshes.
I have a _SHADER struct that contains the VS/PS ...
0
votes
0
answers
73
views
Increasing final image scaling with shaders on top to 125%?
When I apply the canvas_item barrel distortion shader to my viewport, there is a noticeable loss of resolution in the center of the screen. Therefore, is it possible to scale the final image + fisheye ...
1
vote
1
answer
155
views
How do I render a sector (pie/cake slice) of a circular Unity 2D GameObject?
I have a circular GameObject in Unity 2D with a SpriteRenderer attached.
I want to attach a custom component to my ...
0
votes
1
answer
122
views
Do I need vertex array object in this case?
In the case of having the vertex attributes (i.e. position, color, etc) hardcoded in the shaders, why do I need to explicitly create a vertex array object (VAO)? If I remove the VAO, nothing is drawn. ...
0
votes
1
answer
162
views
UV offset moves over time that can change speed
In Unity, using URP/Shader Graph, I have a peculiar problem. I have a warp tunnel that has a texture and a shader "animation" to make it appear as if the player is moving forward through it. ...
1
vote
0
answers
76
views
Weird artifacts on heightmap
so i have this compute shader in glsl that creates a heightmap:
...
1
vote
0
answers
39
views
How to add a simple extra shader effect in Unity's URP in code
I would like to be able to add certain simple graphical effects to objects in my game. For example, I want dead enemies to fade out, I want enemies that get hit to flash white, all easy stuff.
So far ...
0
votes
0
answers
152
views
How are blend weights are determined in animation blending?
According to this Anim Coding tutorial:
In additive animations, additional movements are layered on top of existing animations. This allows for complex actions to be created without the need for ...
0
votes
1
answer
150
views
How to apply a shader to a game object, and not the entire canvas using Phaser
How can apply a shader to a graphics object, and not the whole canvas?
I have a wave shader example here https://phaser.io/sandbox/6SsT2zfC, and I want the wave to be unaffected by the camera's ...
1
vote
0
answers
53
views
CGLM Not Rendering with Sokol [closed]
I've setup cglm from a wrap configured with Meson, and have copied one of the samples from https://github.com/floooh/sokol-samples/tree/master (cube-sapp, to be exact). I've tried to replace sokol's ...
0
votes
1
answer
545
views
How can I make a screen shader for orthogonal camera in Godot 4?
There is a very old issue explaining that there's problems with it, and I'm having difficulties today:
https://github.com/godotengine/godot/issues/48202
The standard practice is to:
Have a camera3d
...
0
votes
1
answer
142
views
Shader to make tall grass black and white near player in 3d game for Godot 4
I'd like to add effects to the tall grass near the player in Godot 4. I think it has something to do with putting all that grass in a layer, than rendering it separately. I'm currently simply trying ...
0
votes
0
answers
52
views
Easy 2d custom shader for Unity 3d: charts, flat/ortho mesh, etc
I just need to draw a flat mesh (say a 2d graph) on top of everything. What could be easier? create an object, adding it a mesh precalculated in homogenous (-1,+1) coordinates to match ...
1
vote
1
answer
141
views
Why do I see a wireframe when rendering with conservative rasterization and disabled Z writes?
I wrote a shader that implements most ShaderLab commands:
Rendering without anything fancy:
After enabling conservative rasterization:
After disabling Z write:
Ironically, that's exactly what I ...
0
votes
1
answer
201
views
How Can I programatically identify a Material in Unity?
I have some gameobjects that in some conditions have an additional material added to them programatically at runtime.
I then later want to be able to remove that specific material. How can I identify ...
0
votes
0
answers
117
views
How to project textures on to the mesh and overlap them like in Let’s Play Pottery?
I want to learn how to project textures on to the mesh and overlap them like in Let’s Play Pottery. I have an idea for game. I created Models, 3d viewer but I can’t figure out how to implement texture ...
0
votes
0
answers
48
views
Shadow Artifacts on Plane Below a Sphere
I am having this minor issue implementing shadow mapping. The plane below the sphere has these strange artifacts. I can fix it by offsetting the position slightly but I'd rather have it work ...
0
votes
0
answers
75
views
What is the rendering method used in "viewport shading: solid" in Blender?
https://streamable.com/km0hv0
I want to make a low-poly game.
I noticed that in blender in viewport shading mode, when the camera rotates, the face progressively change color, from grey to black, ...
0
votes
1
answer
89
views
Use AnimationClip to turn a material pitch black and then back to its original color
I have an object that has 2 materials, both using the URP/Lit shader. One of them is emissive and its color changes at runtime.
I would like to create an effect where the two materials become pitch ...
0
votes
1
answer
280
views
Water shader Breaks on Build
A custom shader I made is breaking on build.
Here's what it's supposed to look like:
Yet, on the build it looks like this. The surface is completely flat, all details are gone, and sometimes the ...