New answers tagged shaders
2
votes
In Unity shaders, how is IN.worldRefl calculated?
The reflection vector is calculated as below:
float3 refl = 2.0 * o.Normal * dot(o.Normal, IN.viewDir) - IN.viewDir;
//float3 refl = IN.worldRefl;
That equation is ...
0
votes
Accepted
How can vertex position can be converted to fragment position?
After the vertex shader has run for a particular group of vertices, there are a few extra stages that happen automatically before invoking the fragment shader for the resulting fragments:
Primitive ...
2
votes
Accepted
Custom Shader leads to wonky clipping
The reason this happens is because of this line:
ZWrite Off
This disables writing to the depth buffer for this rendering pass.
Normally, the depth buffer is what ...
1
vote
Accepted
Prevent color adjustment in ViewportTexture
If this is due color conversion (as DMGregory guesses), then I think your sampler2D need source_color. Example:
...
0
votes
Fade edges of 2D spline-mesh
I finally made it work with a kind of hack.
Because its 2D and unlit I don't need to use normals. So I saved the center of the spline in the normals of the mesh.
Then I can fade the edges based on the ...
Top 50 recent answers are included
Related Tags
shaders × 1954unity × 669
opengl × 435
glsl × 309
hlsl × 244
fragment-shader × 158
textures × 140
directx × 130
c++ × 122
xna × 117
lighting × 111
rendering × 104
c# × 102
directx11 × 85
graphics × 72
2d × 66
graphic-effects × 59
3d × 53
materials × 53
cg × 51
monogame × 44
opengl-es2 × 43
opengl-es × 42
unity-shader-graph × 42
shadows × 37