Hi all,
When experimenting with a shader that maps local normal and position to UV coordinates, I found that, for some models, the normal’s Y and Z components somehow switch places depending on camera position and orientation (and on position of other objects / scene bounds).
The glitch affects the icosahedron and the cylinder I made in Blender; Unity’s default objects don’t seem to be affected.
Does anyone have any idea why this happens (and how to fix it)?
I’ve attached a test project with a shader that visualizes normals as colors.
I’ve tested it on WinXP workstation and Win7 laptop (shadermodel 3.0- and 2.0-capable GPUs, respectively).
1362984–67945–$NormalGlitch.zip (1.44 MB)