# Parallax mapping and tangent space vector

This topic is 4446 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## 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 on other sites
Am I clear or not ? :p I know my english is very bad...
Or is this just obvious (parallax need unindexed primitive) ?

Thanks.

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

1. 1
2. 2
3. 3
Rutin
15
4. 4
khawk
13
5. 5
frob
12

• 9
• 9
• 11
• 11
• 23
• ### Forum Statistics

• Total Topics
633665
• Total Posts
3013247
×