Jump to content
  • Advertisement
Sign in to follow this  
STufaro

Combining World and View Matrices looks worse.

This topic is 3696 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

Hey again all. A pretty standard optimization I've read about is multiplying the view matrix to the world matrix before transforming an object as opposed to setting the view matrix whenever you want to change the camera position. The problem I have with that, though, is that when I employ that method, everything looks a lot darker and there's less contrast between dark and light in my 3D scenes. I feel like I am better off just setting the view matrix on its own (even though that's slower). Any ideas as to why everything looks worse with this optimization? I'll hook you guys up with some screenshots in a bit. Thanks. - Steve.

Share this post


Link to post
Share on other sites
Advertisement
If your lighting changes when you combine the matrices, I'd say you don't transform your normals correctly. Normals should be transformed by the inverse transpose matrix (ie the transpose of the inverse "worldview" matrix). Read more about why here.

Share this post


Link to post
Share on other sites
Thanks for the reply, Lord CRC.

I should mention that I'm using Direct3D. Correct me if I'm wrong, but with my mesh, shouldn't the normals be transformed automatically in D3D?

If not, how would I go about manually transforming them? I don't know if there's a way to directly access the normals of a mesh in D3D (it's not a PMesh).

EDIT:

I am also using only ambient and directional lights; nothing that would push anything out of range, although I'd imagine that's a problem, too, unless the lights get transformed according to the view matrix, no?

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!