I’m have a problem with projective texturing.
So I decided to hold on the projective texturing, and manually project the scene using the light
matrices to see if its right.
Right now, I send my light projection matrix, light view matrix, camera view matrix inverse to the effect.
I retrieve the world/model space matrix like so,
ModelMatrix = MV * (V ^ -1)
where, MV is the gl modelview matrix
(V ^ -1) is the camera view inverse
then my light modelview is found like this,
light_modelview = ModelMatrix * lightViewMatrix;
light_mvp = lightProjectionMatrix * light_modelview;
outputPos = mul(light_mvp, position);
<I stopped trying projective texturing because on testing the output from light_mvp, i found it was wrong, so decided to fix this first before moving onto projective texturing>
the output is wrong, as when i move the camera, the scene rotates weirdly, when this shouldn’t happen,
it should only show the scene from the lights view.
I’m quite sure the input matrices are correct as when testing with the main camera (ie: sending default camera instead of light camera), the scene render is perfect).
If I put the light position where the default user camera is, the scene render isn’t screwed, but is weird, it renders and tilts whenever I rotated the main user camera (when the main user camera shouldn’t have anything to do with the render)
What am I doing wrong here?
Thanks in advance.