Jump to content
  • Advertisement
Sign in to follow this  
Farfadet

Tangents/normal calculation at the vertices of a subdivided mesh

This topic is 3077 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've implemented Catmull-Clark subdivision in my app. The only thing left is to compute the tangent space vectors at the subdivided mesh vertices. Temporarily, the vectors (tangent and normal) are interpolated from the vectors at the base mesh vertices. As expected, this gives noticeable artifacts where the surface curvature is high. Internet searches returns a lot on Catmull-Clark and subdivision, but strangely very little on this topic.

What I'm looking for is a method that does two things :
1) provide tangent vectors at subd surface vertices close enough to the tangent plane of the (exact) subd surface (the normal is computed by cross product of the 2 tangent vectors)
2) make it so that these tangent vectors (or vectors derived from them) correspond to the tangent space needed to apply correct bump mapping.

I could of course compute the tangents and normals of the subdivision mesh the same way I compute them for the base mesh, but the CPU cost is prohibitive.

Some details regarding the app :

- polygonal mesh (triangles and quads)
- shaders supporting lighting, color textures and bump maps
- texture coordinates are simply linearly interpolated during subdivision
- sharp and semi-sharp creases (for the former, normal discontinuity across the crease)
- for the base mesh, tangent space vectors at vertices are computed as follows :
- compute normals for each polygon
- compute tangent for each polygon as explained in http://www.terathon.com/code/tangent.html
- average those values at vertices, taking into account normal and texture discontinuities (creases, mesh edges and seams)
- orthogonalize and normalize the vectors (only tangent and normal are stored per vertex, the binormal is computed in the vertex shader).

Any link / suggestion / hint would be welcome.

Share this post


Link to post
Share on other sites
Advertisement
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!