• Advertisement
Sign in to follow this  

An amazing trick to avoid tangent space seems

This topic is 3312 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

hello, I discovered a cool trick on how to avoid seems in tangent space. It goes like this: Just construct your TBN matrix with the normalized tangent, normalized binormal and not normalized normal vector multiplied by some higher value, like 250 works for me perfectly (multiply the normal vector not the TBN matrix to make things clear). Try it out and tell me wheather it works 4 u.

Share this post


Link to post
Share on other sites
Advertisement
and another thing to shine a little light on bitangent/binormal confusement. If you compute the third vector by crossing normal and tangent you have the binormal. If you compute the tangent and the third vector and then normalize the normal on them you have bitangent. Allways GO FOR THE BINORMAL as then you get them smoothed.

Share this post


Link to post
Share on other sites
That's actually pretty cool.

I have an implementation with a lot of 'on the fly' TBN calculations, and one of the drawbacks is that I get some seams.

I had been wondering how to tackle it, and whilst it's not perfect it certainly addresses the problem.
I have not tested it extensively yet. But on the surface it seems solid.
With a little bit of fiddling I think it will work flawlessly.

At the moment I am simply quadrupling the Normal value as that removes 99% of the seaming, and also lightens the view slightly. Any more and the lightening effect spoils the bump-mapping, but at a multiple of 3 or 4 it actually makes the colour saturation / brightness better *and* removes the seams.

Bravo.

I am sure some maths whizz can come along now and tell us why.. I am just happy it has given me some control over this problem very cheaply.

Share this post


Link to post
Share on other sites
Quote:
Original post by JohnnyCode
and another thing to shine a little light on bitangent/binormal confusement. If you compute the third vector by crossing normal and tangent you have the binormal. If you compute the tangent and the third vector and then normalize the normal on them you have bitangent. Allways GO FOR THE BINORMAL as then you get them smoothed.

That... has absolutely nothing to do with the difference between a bitangent and a binormal.

If you have a locally flat surface, the tangent and bitangent are two vectors perpendicular to the surface normal which are perpendicular to each other. A surface does not have a binormal.

If you have a locally straight curve, the normal and binormal are two vectors perpendicular to the tangent vector which are perpendicular to each other. A curve does not have a bitangent.

Long ago, well before normal mapping and suchlike, Frenet frames were very useful in game development, so the term "binormal" got entrenched in the game development lexicon as "the third vector in the frame". Later on, therefore, people also used it to refer to the third vector in a surface frame, even though this is mathematically incorrect.

Share this post


Link to post
Share on other sites
JohnnyCode, I think you really misunderstood the terms binormal and bitangent.

For a surface, binormal and bitangent are the same idea. And, as Sneftel had pointed out that the binormal in surface is simply a not very appropriate term borrowed from curve. Although I'm still using binormal in my writing, I would be pleased to correct it if the others are willing to accept the change.

However, your trick sounds interesting. I definitely will try it later. ^^

Share this post


Link to post
Share on other sites
Quote:
Original post by scratt
I am sure some maths whizz can come along now and tell us why.. I am just happy it has given me some control over this problem very cheaply.


I'm pretty sure that the proposed method will essentially just ignore the T and B components and give you old-school bump mapping instead of high quality normal bump mapping...which, I guess, may be an improvement if you don't have good T and B vectors.

Share this post


Link to post
Share on other sites
Quote:
Original post by yahastu
Quote:
Original post by scratt
I am sure some maths whizz can come along now and tell us why.. I am just happy it has given me some control over this problem very cheaply.


I'm pretty sure that the proposed method will essentially just ignore the T and B components and give you old-school bump mapping instead of high quality normal bump mapping...which, I guess, may be an improvement if you don't have good T and B vectors.


I think you are right. It seems to be flattening off the bump mapping a bit.
I am dynamically generating all TBN in my shaders, so it's usefull to tidy the maths.
Ultimately I will sort the *actual* problem out.

If anyone has any thoughts on how to do better TBN in shaders I am all ears.

Share this post


Link to post
Share on other sites
Quote:
Original post by scratt
If anyone has any thoughts on how to do better TBN in shaders I am all ears.


It's hard to specify improvements without knowing what you are doing. I don't know what these seams that you are referring to are.

That said, in order to do it correctly you need to pass normal AND tangent information for each vertex. If you're generating the tangent by crossing the normal with a hard-coded "up" vector, the results won't be as good.

Also, I think there are differences between doing calculations in world space vs tangent space...I can't remember what the advantages/disadvantages are, because I haven't written a shader in a long time :P

Share this post


Link to post
Share on other sites
Quote:
Original post by yahastu
Quote:
Original post by scratt
I am sure some maths whizz can come along now and tell us why.. I am just happy it has given me some control over this problem very cheaply.


I'm pretty sure that the proposed method will essentially just ignore the T and B components and give you old-school bump mapping instead of high quality normal bump mapping...which, I guess, may be an improvement if you don't have good T and B vectors.


well, I multipled by the value the T and B vectors as well, seems removal effect preserves, so I should not have the T and B ignored know right?

Share this post


Link to post
Share on other sites
Quote:
Original post by JohnnyCode
well, I multipled by the value the T and B vectors as well, seems removal effect preserves, so I should not have the T and B ignored know right?


You're saying that simply multiplying your TBN matrix by a large scalar removes seems? I'm sorry but that just doesn't make any sense...

Share this post


Link to post
Share on other sites
Quote:
Original post by yahastu
Quote:
Original post by JohnnyCode
well, I multipled by the value the T and B vectors as well, seems removal effect preserves, so I should not have the T and B ignored know right?


You're saying that simply multiplying your TBN matrix by a large scalar removes seems? I'm sorry but that just doesn't make any sense...


well yeah, it is strange isn't it? but it does the job

Share this post


Link to post
Share on other sites
Quote:
Original post by JohnnyCode
well yeah, it is strange isn't it? but it does the job


Maybe if you post the two versions of the shader we can find out what's really going on

Share this post


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

  • Advertisement