GLSL bump mapping - "inv_view_matrix"?

Started by
3 comments, last by GameDev.net 18 years ago
I've tried to post this 3 times so I'm just trying some plain text first.
Advertisement
As long as your modelview matrix is orthogonal(or some fancy word like that), the inverse is equal to the transpose. Rigid transformations should always produce an orthogonal matrix, so you should be fine as long as you're not scaling anything. So you can use the fragment shader to find the transpose. If you can make do with just a 3x3 matrix, you can use gl_NormalMatrix, which is the transpose of the upper leftmost 3x3 section of the modelview matrix.

This topic is closed to new replies.

Advertisement