- Home /
Fixing normals on projected texture.
I am trying to use the following code in my sky shader to project a moon texture on to my sky dome mesh. It's working perfectly except for the normals. I have no idea how to transform the normals to match the new orientation of the texture.
float4 moonVector = mul(_MOON_MATRIX,IN.vertPos*1);
uv = moonVector.xy + .5;
float4 moon = tex2D (_MoonTex,uv) * saturate(-moonVector.z);
float3 moonNorm = UnpackNormal(tex2D (_MoonNormal,uv));
If anybody could give me any advice I would greatly appreciate it, I'm completely stuck with this one!
Comment