Hi
my Shader has a small problem. I have thousands of Objects and the light rotates with them, instead of shining from one direction.
trymyshade.zip (5.2 kB)
Hi
my Shader has a small problem. I have thousands of Objects and the light rotates with them, instead of shining from one direction.
trymyshade.zip (5.2 kB)
you forgot to multiply normals with the same transform used for positions
normals use tWIT: WORLDINVERSETRANSPOSE, but don’t worry, there could be tW instead (it’s just that tWIT would give correct results with non-uniform scale, which is not always needed)
so replacing “tWIT” with your “w” should work there; also replace “tWV” with “mul(w,tV)”