1
\$\begingroup\$

I am using a library to load an obj but it doest compute the tangets for each vertex, which I need for normal mapping and pom. I computed my tangets, and bitangents, everything appears to be fine, but I read that I need to average tangents if the vertices are the same (same position, uv, normal).

So for example if there is a vertex v that has the same pos,uv & norms as vertex v1 and v2, then the tangent for vertex v, v1, and v2 is normalize(v.t + v1.t + v2.t)?

I want to make sure I have the correct understanding before implementing.

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

Normalizing would simply divide those combined values by their magnitude.

You just need to find the mean, of which you can add each individual component and thereafter divide by the total number of overlapping vertices.

(v.t + v1.t + v2.t) / 3

\$\endgroup\$
3
  • \$\begingroup\$ So then now v, v1, and v2 will all share the same tangent? \$\endgroup\$ Feb 4, 2015 at 14:30
  • \$\begingroup\$ Yes, an averaged/smoothed one that lay between all 3. \$\endgroup\$
    – Tannz0rz
    Feb 4, 2015 at 14:31
  • 2
    \$\begingroup\$ Since you'll generally want the tangent to be a unit vector for any use you're putting it to, normalizing is not a bad idea. ;) \$\endgroup\$
    – DMGregory
    Feb 4, 2015 at 15:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .