per vertex lighting:
NdotL0 = dot(N0, L)
NdotL1 = dot(N1, L)
V = NdotL0 + t (NdotL1 - NdotL0)
per pixel lighting:
N = normalize( N0 + t( N1 - N0 ) );
V = dot( N, L );
Per pixel point light: interpolating vertex world pos
So it's the renormalization that introduces the "non-linearity" I guess. Because otherwise you could just distribute the dot product into that expression for 'N' and get the same result as in the per-vertex case.
Here are some screen shots from RenderMoneky showing per-vertex nDotL along with per-pixel with and without the renormalization
Per Vertex:
.
Per Pixel w/out normalize
Per Pixel w/normalize
Here are some screen shots from RenderMoneky showing per-vertex nDotL along with per-pixel with and without the renormalization
Per Vertex:
.
Per Pixel w/out normalize
Per Pixel w/normalize
Ok, you are right, in very strange situations you can see some differences:
Per-Vertex
Uploaded with ImageShack.us
Per-Pixel
Uploaded with ImageShack.us
Anyway I think if I only use diffuse component, per-pixel isn't worth it, because I'm not going to use a mesh like the one above (a cube deformed with only two triangles per face).
Thanks everybody!
Per-Vertex
Uploaded with ImageShack.us
Per-Pixel
Uploaded with ImageShack.us
Anyway I think if I only use diffuse component, per-pixel isn't worth it, because I'm not going to use a mesh like the one above (a cube deformed with only two triangles per face).
Thanks everybody!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement