Combining World and View Matrices looks worse.

Started by
1 comment, last by STufaro 15 years, 9 months ago
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.
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.
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?

This topic is closed to new replies.

Advertisement