Jump to content
  • Advertisement
Sign in to follow this  
richardmonette

[SOLVED] Quick back-face culling question

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

I am implementing a software renderer (for fun and learning). I'd like to add backface culling to my system. On my triangle I have a normal at each vertex and I am interpolating these barycentrically for when I do my lighting. Which of these normals should I use for determining whether a triangle is backfacing? Maybe I should just interpolate such that I take the average of the 3 at the center? Or would it be ok (within a reasonable marging of error) if I just did one of the 3 by convention? [Edited by - richardmonette on November 4, 2009 3:08:15 PM]

Share this post


Link to post
Share on other sites
Advertisement
If you want to do it with the normal, store another normal for each triangle, which is the plane the triangle lies in, and use that to determine if they are facing the camera. Most 3D APIs determine front-facing by checking if the final projected points are in clockwise or counter-clockwise order instead.

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!