Jump to content


Calculating normals of a mesh


22 replies to this topic

#21 poita

    Senior Member

  • Members
  • PipPipPipPip
  • 322 posts

Posted 20 March 2010 - 09:50 PM

The elongated cube was the first counter example given: the normals get incorrectly skewed toward the longer sides, even though the local geometry stays the same (it's still a cube after all). Yes, the box is a bad example, but this applies to all non-uniform scaling of meshes, the box is just a simple illustration.

Another example is just with any mesh that is more subdivided in one area than another -- the more subdivided the mesh becomes, the less those triangles influence the normal, which will result in very odd normals on the boundary of lowly/highly subdivided surface regions.

#22 JarkkoL

    Senior Member

  • Members
  • PipPipPipPip
  • 475 posts

Posted 20 March 2010 - 11:24 PM

.oisyn said:

The real world mostly just uses the normals produced by modeling applications, and artists are able to tweak them ;)
I wish you could rely on explicit normals. Not all 3d file formats support explicit normals, even less modelling software allow you to tweak the normals, even less of that software exports the normals properly and even if you would get the normals through the entire pipeline you would still have to run vertex smoothing to get the other two vectors for the tangent space. Tweaking normals manually is also very taunting task for artist, and I don't really take pleasure in making artists' life miserable d:

poita said:

The elongated cube was the first counter example given: the normals get incorrectly skewed toward the longer sides, even though the local geometry stays the same (it's still a cube after all).
Oh, but it is actually correct behavior to skew the normals towards the longer sides. When you start with a cube, the vertex normals represent a sphere. When you scale the box along one of the axes, it's an ellipsoid and you have to skew the normals accordingly. If you wouldn't the normal interpolation result in the lighting for a larger sphere. So, this example actually supports the method of using triangle area in vertex smoothing.

Could you elaborate what kind of concrete case are you after with the second example? I have done some un-even subdivision on terrain geometry, but I haven't noticed any odd normals in those cases using the triangle area. On a subdivided cube that was bevelled, using the triangle area looks better IMO, because there is less lighting anomality on quads next to the cube edges because normals are more bent towards the cube face.

#23 Luz Reyes

    Valued Member

  • Members
  • PipPipPip
  • 112 posts

Posted 28 September 2010 - 02:04 PM

A similar discussion has taken place here: http://www.gamedev.n...topic_id=355340. Might want to check it out. They find a pretty elegant solution.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users