Jump to content
  • Advertisement
Sign in to follow this  
Jacob Roman

Calculating Normals Per Vertex Problem

This topic is 4616 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

What's the correct way to calculate surface normals per vertex? No matter what I try, my polygons still appear flat shaded, even when gouraud shading or phong shading is enabled. It only appears smooth shaded when I load a mesh from a file. So I know my math is wrong. Anyone know the correct way to calculate them?

Share this post


Link to post
Share on other sites
Advertisement
Ok I think I know what my problem is. I need to calculate the Average normal per polygon from all the vertices. How do I do this correctly. Thanks. ;)

Share this post


Link to post
Share on other sites
The most simple method is to add the normals of all the faces that share the vertex and normalize the result. Another method is to use a weighted sum of the face normals.

There's an article on GameDev.net, titled "Normal computation for heightfields" or something similar, by J. Walsh, and it covers the 2 methods briefly (though in the context of heightfields).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!