Jump to content
  • Advertisement
Sign in to follow this  
_Madman_

How to transform eye space light position to object space position in GLSL

This topic is 5110 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

If I understand correctly, then gl_NormalMatrix, should do the rotational part, but translations would be lost, as matrix is only 3x3. Uploading full MVIT through parameters seems to be overkill too.

Share this post


Link to post
Share on other sites
Advertisement
lights are already in eye space (multipled by MV matrix), so god knows where it would end up if you did that [wink]

In GLSL 1.10 there is a predefined MVIT, however currently no one has an impliementation out (infact, there are quite a few extras defined for it, see section 7.5 of the spec for details)

So, atm at least, you'll have to pass it in or derive it inside maybe...

Share this post


Link to post
Share on other sites
In the second post, there is an inverse order of multiply (m*v) instead of (v*m). Wasn't that exactly the same as multiplying by inversetranspose??? Position should have 1 as 4th component if I remember correctly.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!