Sign in to follow this  
dawchiks

inverse transpose matrix. what is that?

Recommended Posts

im trying to do normal mapping, but what the F is inverse transpose matrix? im using shader code from here http://www.mdxinfo.com/tutorials/normalmapping.php. what i have to do with it? i tried to search but didnt find anything what would help :P thx.

Share this post


Link to post
Share on other sites
The "inverse transpose" of a matrix M is matrix that results from first transposing M, and then finding the inverse of the result.

The inverse transpose of a matrix is often used to transform normals -- in this case, they're using the combined world-view matrix as the source matrix (M), so they're transforming the normals into view space, probably (I didn't read beyond finding out which matrix they are inverting).

Note that under certain conditions (if the matrix is orthogonal, e.g., basically contains no icky nonuniform scales) the matrix inverse is the matrix transpose, and the transpose of the transpose is the original matrix, so you may not need to do anything at all to obtain the desire matrix. That is however quite context specific to it would benefit you to do things the "proper" way before you worry about optimizations, as they can make the result wrong (sometimes in hard to detect ways).

Share this post


Link to post
Share on other sites
Quote:

Note that under certain conditions (if the matrix is orthogonal, e.g., basically contains no icky nonuniform scales) the matrix inverse is the matrix transpose, and the transpose of the transpose is the original matrix, so you may not need to do anything at all to obtain the desire matrix. That is however quite context specific to it would benefit you to do things the "proper" way before you worry about optimizations, as they can make the result wrong (sometimes in hard to detect ways).


Actually, I was looking out for this answer. I've readed about it but I was not quite sure. Thank you for your answer.

In bone transformations can I use this method to transform normals ? I think, ny bone transform matrix are orthogonal. (They are consist of only translation and orientation transformations) Even if not so, if I normalize the output vector. Is it correct result ?

Thanks.

Share this post


Link to post
Share on other sites
If you do uniform scales (scale x,y,z by the same amount), then normalizing is fine. Non uniform scaling, shears, and other things you likely won't ever do will require the inverse transpose method to get correct results.

While newer shader models have lots of constants, back in sm.1.1, with 96 constants, nobody used IT matrices. Nobody used full 4x4 matrices except for projection. Shortcuts can be used as long as you're aware of what limitations you're placing on yourself.

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