Techniques to smooth face edges in OpenGL

12,740

Solution 1

If you are seeing single faces with per vertex normals you might have forgotten to enable smooth facing:

glShadeModel(GL_SMOOTH);

If that's not helping make sure all vertices with the same position also have the same normal. This should be done by blender automatically however. It's also possible that your model has just too few polygons. If that's the case you either have to use more polygons or do what basszero said. Create a normal map and use that together with a GLSL shader.

Solution 2

If you've got access to a higher resolution model/mesh or perhaps a decent 3d modeling tool that can create a highres model via subdivisions or other fancy methods...

GLSL per-pixel-lighting + normal maps

UPDATE:

http://www.blender.org/development/release-logs/blender-246/render-baking/

Solution 3

Yes there are many different techniques. One is to first calculate a normal for each face (which you probably are using for the vertices in the face) and use these normals to calculate new normals for each vertex.

Here's one where you calculate the average of five adjacent triangles.

Cheers !

Share:
12,740
Kai
Author by

Kai

I'm a game programmer currently working in AS3.

Updated on June 04, 2022

Comments

  • Kai
    Kai almost 2 years

    When I light my human model in OpenGL using face normals it is very apparent where each face is on the model. The lighting becomes considerably smoother using vertex normals but still noticeable. Is there any technique available to smooth organic models without adding additional vertices (ex. subdivisions)?

  • Kai
    Kai almost 15 years
    I'm using Blender. I keep my model low-poly for performance reasons. Phong shading seems promising but its not supported by OpenGL and the advantage wouldn't warrant the performance hit.
  • Anne Porosoff
    Anne Porosoff almost 15 years
    Right, you create a highres model in Blender and use it to generate a normal map. The create a lower res version and use the normal map + shaders to create the missing vertex detail in the final rendered product
  • Yun
    Yun over 2 years
    The link is dead.