Skip to main content
4 events
when toggle format what by license comment
Jan 2, 2012 at 7:37 comment added Roger Perkins You'll need to have the light, eye and normals in the same "space". Without transforming the normals by anything they'll be in "object" space while the light(s) and eye will be in world space. You could transform the normals into world space in the pixel shader, but it may be more efficient to pre-transform the eye and lights back into object space either in the vertex shader or outside of the draw call for efficiency, so you don't need to transform at all. Depending on where rendering bottlenecks occur it might not make much difference whatever you do if the pixel shader isn't overly complex.
Jan 1, 2012 at 6:09 vote accept Craig
Jan 1, 2012 at 5:59 comment added Craig That may be it :| My light isn't working still but is that because i have to multiply the normals by the world matrix? Like what is usually done in the vertex shader
Jan 1, 2012 at 5:51 history answered Roger Perkins CC BY-SA 3.0