Sign in to follow this  
Woodchuck

Parallax mapping and tangent space vector

Recommended Posts

Hello, I'm confused. I do a lots of research (of code mainly) but I really don't find what I need. My problem is : to calculate the new texture coordinates in the parallax mapping, I need the "tangent space view vector". But not any tangent space, the tangent space of the texture mapping precisely affected. I'm maybe wrong somewhere, but for me, for one vertex and for example, one bunch of texture coordinates, there is a lots of tangent space due to the number of face that use this vertex. Then, for me, there is one tangent space for one face. I think the texture coordinates derivatives instructions may help (ddx, ddy) for this problem, but these are available only on ps_2_a and greater... So, what to do ? EDIT: note that i'm using indexed primitive. Is this possible to think about not using it just for the needs of the parallax mapping ? [Edited by - Woodchuck on October 7, 2006 9:02:29 AM]

Share this post


Link to post
Share on other sites
You're correct in assuming that you calculate the tangent space basis vectors per face, and not per vertex, but what you have to do is simply add up the vectors from each face that uses any given vertex, and then normalize them, giving you set of basis vectors per vertex!

Hope that helps!

Share this post


Link to post
Share on other sites
Mmmh interresting...

Correct me if i'm wrong, but this is like approximate a continuous basis thanx to the rasterizer interpolation.
In other word, near a given vertex, the parallax will be strange if the continuity is bad, but in the middle of the faces it will be perfect.

Assuming parallax mapping is usefull generally in large plate face(like cube's one), it might work, I will test it.

( In fact, I didn't see that basis discontinuities are generaly rare, and that parallax are not used in very curved and strange surfaces. )

Thank you a lot !

Share this post


Link to post
Share on other sites
Ok, I worked on the problem. You put your finger exactly where it must. I just realize that the texture coordinate surfaces must be C1 (first degree derivatives exist )for the needs of normal mapping.
That's generally not the case, but with the tricks you explain, it tend to.

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