There’s an example in the documentation on how to do this in the vertex shader, but I want to do it in the pixel shader (in the terrain shader).
Simply saying o.Albedo = a.Normal just gives me a black result.
There’s an example in the documentation on how to do this in the vertex shader, but I want to do it in the pixel shader (in the terrain shader).
Simply saying o.Albedo = a.Normal just gives me a black result.
hello, need to see more of your code…
are the a.Normal in WorldCoor or objectCoord ?
if you have to transform your normals to World in a vertex program.
like this :
void vert(inout appdata_full v, out Input o) {
o.worldNormal= mul((float3x3)_Object2World, SCALED_NORMAL);
};
hope that helped.
This put me on the right track - thanks!