1
\$\begingroup\$

I'm computing area-weighted vertex normals, but lighting looks bad on meshes containing sharp edges and corners (e.g. cubes look 'blobby' as the light leaks onto the dark sides).

Is there a way of calculating/using vertex normals to preserve sharp edges and still have smooth regions? Ideally, without the need to create extra geometry (e.g. splitting faces adjacent to a sharp edge and creating new vertices).

Most sources talk about having different 'smoothing groups' which influence geometry generation.

Could someone explain what are "per-corner" normals? From Libigl tutorial: "Storing normals per-corner is an efficient and convenient way of supporting both smooth and sharp (e.g. creases and corners) rendering."

\$\endgroup\$
  • 1
    \$\begingroup\$ This depends on the 3d modeling software you are using. Blender, for example, allows you to select some vertices and then set if you want to shade them "smooth" or "sharp". \$\endgroup\$ – Philipp Apr 29 '16 at 12:37
1
\$\begingroup\$

The only way I can think of preserving sharp edges using an algorithm is to have some kind of threshold of maximum angle between normals. But this is kind of auto generating smoothing groups anyway. I also cant see this being effective unless your geometry is a mixture of very smooth + very angular.

Essentially when you render a tri you would have 3 verts & 3 vert normals. So if two tri's are joined on one edge, and you want that edge to be a hard edge ( no smoothing ) then you will have 4 verts but 6 normals. If you see what I mean? So I guess its not that you're duplicating geometry. You share verts but have new normals.

So if you think about a cube corner. Although the vert is in one place, there are three faces atatched to it, each facing a different direction. You can share the vert but you'll need the 3 normals.

So a smoothing group is a bunch of tri's where each vert has its own single normal.

You could have geometry in another smoothing group which shared the same verts.

\$\endgroup\$
1
\$\begingroup\$

One way it to make seams everywhere you want a sharp corner. In fact you are going to need to do that anyway in the game if you want to use a a GPU for rendering.

With seams I mean storing the vertexes on the edges you want sharp twice (one for the polygons on each side of the edge).

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.