Sign in to follow this  
STufaro

Combining World and View Matrices looks worse.

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this