View Full Version : Light Matrices

09-16-2004, 09:05 AM
Hi, i'm currently doing a subsurface scattering demo but i need two matrices the light matrix and the light texture matrix, the first translate the vertices in light space while the second translate the vertices into light texture space. How these matrices are composed ?

09-18-2004, 12:46 AM
Ok, i read that the light matrix is obtained by rendering the scene from the light point of view, but what about the light texture matrix ? Please help me.

09-18-2004, 03:46 PM
Daniel, what exactly do you mean by "texture matrix" ? That's a tad thin, to me anyway ;)

09-18-2004, 05:09 PM
He means the texture matrix that will magically project eye space coordinates to lightmap texels.

That's actually the same matrix as the light projection matrix used when rendering, assuming you do your texgen in eye space coordinates, if I understand correctly what he's after.

However, if you render in space [-1,1] and then texture in space [0,1], you need to scale by 0.5 and then offset by 0.5 to make them match up. Is that what you wanted, Daniel?