# An amazing trick to avoid tangent space seems

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

## 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 on other sites
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 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 on other sites
Quote:
 Original post by JohnnyCodeand 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 on other sites
as I said Sneftel, it really is a confusement

##### 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 on other sites
Quote:
 Original post by scrattI 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 on other sites
Quote:
Original post by yahastu
Quote:
 Original post by scrattI 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 on other sites
Quote:
 Original post by scrattIf 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 on other sites
Quote:
Original post by yahastu
Quote:
 Original post by scrattI 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?

1. 1
Rutin
38
2. 2
3. 3
4. 4
5. 5

• 12
• 16
• 12
• 14
• 9
• ### Forum Statistics

• Total Topics
633357
• Total Posts
3011500
• ### Who's Online (See full list)

There are no registered users currently online

×