Jump to content
  • Advertisement
Sign in to follow this  
Unfadable

Tangent vector issues

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, I can't seem to reply to this thread, but I had a question concerning one of the responses. http://www.gamedev.net/community/forums/topic.asp?topic_id=320413 1)
Quote:
The basic rule is this: if one polygon has the texture "face-up", and another texture has the texture "face-down", then those two polygons may not be part of the same mesh.
I understand how mirroring can screw-up the basis calculations, but what is meant by face-up and face-down? 2)
Quote:
If I warp the texture a little, then you have to fudge the tangent and binormal a little
What is meant by 'warping' the texture? And what is needed to 'fudge' the tangent and binormal. 3) In this example, which I'm sure you've all seen http://www.terathon.com/code/tangent.html Am I correct in saying there's no 'fudging' going on here? And that this assumes no uv mirroring? 4) Is it reasonable to require an artist to not mirror uvs or do any other kinds of uv tricks (laying uvs on top of each other, or whatever) in order for my algorithm to work properly. I'd really really prefer not to split up a mesh. 5) Are there any other things that can break calculation of these basis vectors? Thanks

Share this post


Link to post
Share on other sites
Advertisement
3) Yes, there's no 'fudging' going on here, but that doesn't mean you can't have flipped UVs. The code posted there specifically handles mirrored texture coordinates by storing a handedness value in the tangent's w-coordinate.

'Fudging' of some kind might be necessary to handle sheared texture coordinates in which the tangent and bitangent may not be perpendicular.

Share this post


Link to post
Share on other sites
Ah, reply from the guy at that website. Much appreciated!

Ok, I see. I overlooked that handedness check.

So lets go back to this fudging, cause my problem is that my vectors are sometimes not perpendicular.

What do you mean by 'sheared texture coordinates' and are there other causes?

Are there other causes?

How is it fixed?


Thanks

Share this post


Link to post
Share on other sites
By sheared, I mean texture coordinates that have been laid out so that the s and t directions aren't perpendicular across some triangle. That is, the texels aren't square any more, but form little parallelograms. There's no perfect solution for dealing with this because the tangent space for any triangle mapped this way is no longer orthogonal. It may be possible to come up with a way to make the best approximation with an orthogonal tangent space in these cases, but this is not something I've tried. In my opinion, it's just best to avoid sheared mapping.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!