Skip to content

Instantly share code, notes, and snippets.

@larsberg
Last active June 2, 2017 11:56
Show Gist options
  • Save larsberg/48225bdda200820c83c1 to your computer and use it in GitHub Desktop.
Save larsberg/48225bdda200820c83c1 to your computer and use it in GitHub Desktop.
simple culling example for openframeworks
...
void ofApp::draw()
{
ofEnableAlphaBlending();
//pass 1
glEnable(GL_CULL_FACE);
glCullFace(GL_FRONT);
shader.begin();
mesh.draw();
shader.end();
//pass 2
glCullFace(GL_BACK);
shader.begin();
mesh.draw();
shader.end();
//disable culling
glDisable(GL_CULL_FACE);
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment