Sign in to follow this  

Back face Culling

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

This topic is 2662 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this