Light Matrices

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 ?

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.

Daniel, what exactly do you mean by “texture matrix” ? That’s a tad thin, to me anyway :wink:

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?