New answers tagged

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 ...
이희민's user avatar
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 ...
DMGregory's user avatar
  • 132k
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 ...
DMGregory's user avatar
  • 132k
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: ...
Theraot's user avatar
  • 25.2k
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 ...
Johan Tovesson's user avatar

Top 50 recent answers are included