Jump to content
  • Advertisement
Sign in to follow this  
Mahmud Hasan

Normal mapping w/ texture mirroring (Tangent and bi-Tangent calculation).

This topic is 1338 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,

I am having some issue rendering model that has mirrored mesh.

I am having split lighting while using it with normal map and directional lights.

 

We are exporting the models from Max and in my conversion tool I am re-calculating the tangent and bitangent.

However, the output is as follows with single directional light.

 

[sharedmedia=gallery:images:5802]
 
To make sure there was no problem getting the tangent and bitangent correct,
I rendered the normal, tangent and bitangnet as follows:
 
[sharedmedia=gallery:images:5803]

 

 

Can anyone suggest me any solution or clue why it is happening?

are my tangent and bi-tangents are coming out correctly (2nd image)?

 

Thanks,

P

Share this post


Link to post
Share on other sites
Advertisement


clue why it is happening?

Got the same issues a few years back, so read with care. There might be a better/correcter solution smile.png

 

If I remember correctly , then you have trouble with changing the handness of your transformation matrix. Sure, the surface normal is still point outside your model (which is needed for the light calculation), but the "normal" of the transformation matrix should be pointing inside when mirrored. Practically the green lines on the left side should point inside the model to be correct.

 

This leads to an second issue: when do you need to invert the normal from the transformation matrix to get the correct surface normal ? Well, I have saved it in as sign of an else always positive value (I use a quaternion to represent the tangent space matrix) to encode the "handness".

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!