Viewport Space to Light Space


I want to transform a point from Viewport Space to Light Space. What are the necessary transformations? I think that it’s possible to merge all those transformations in one Matrix.

Thanks :slight_smile:

Hi -Moi-,

If you concatenate the transforms that take you from light space->eye space->clip space->viewport space, you’ll have a 4x4 matrix. Simply invert that matrix to go from viewport space back into light space.

Note that this transform will take you from Real (x,y,z) viewport space into Homogeneous (x,y,z,w) light space. You’ll need to divide by w to get to Real light space coordinates.

Thanks -

Thanks a lot cass

I forget to divide by W. :stuck_out_tongue: Now this works very well