Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


#ActualKaiserJohan

Posted 22 March 2013 - 05:14 PM

Alright, I solved it.

 

For those interested, I can do the lighting calculations in world space just fine if I supply a mat4 model-to-world matrix rather than a mat3 model-to-world matrix to the vertexshader. I believe it has something to do with translation, since the objects in question were translated away abit from the camera, but if anyone has a complete answer I would be happy to hear it. 

 

 

EDIT: One thing itches me though, why do people/guides do all lighting transformations in camera space rather than world space?


#1KaiserJohan

Posted 22 March 2013 - 05:10 PM

Alright, I solved it.

 

For those interested, I can do the lighting calculations in world space just fine if I supply a mat4 model-to-world matrix rather than a mat3 model-to-world matrix to the vertexshader. I believe it has something to do with translation, since the objects in question were translated away abit from the camera, but if anyone has a complete answer I would be happy to hear it. 


PARTNERS