Jump to content
  • Advertisement
Sign in to follow this  
serious_learner07

Back face Culling

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

How to implement Back face culling for a mesh (say a terrain).

The following code piece made no impact on culling.


if(cull)
glFrontFace(GL_CCW); //Define the winding order
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK); //which faces to cull.
else
glDisable(GL_CULL_FACE);





What is wrong with the code? My idea of culling is for achieving better frames

Share this post


Link to post
Share on other sites
Advertisement
if(cull)
{
glFrontFace(GL_CCW); //Define the winding order
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK); //which faces to cull.
}
else
glDisable(GL_CULL_FACE);

There you go (how did you manage to even compile that, by the way?)

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!