How to Enable Backface Culling in OpenGL to speed 3D model FPS ??
in
Contributed Library Questions
•
3 years ago
I have been trying to work out how to do backface culling in p5. I'm using the objloader library to import geometry, so I would love tips/experience particularly from people who've worked with that library. Also this wiki page says that processing can do that internally, but doesn't tell how (
http://wiki.processing.org/w/Backface_culling) any ideas?
The following snippet from the google code site looks like I should just be able to un-comment that section to enable backface culling within the library, but I can't get it to work.
I tried expanding the library's .JAR file, uncommenting the section and turning it back into a JAR file, but that still shows backfaces (you can see them when the faces are rendered with some transparency) and I haven't seen a change in the FPS.
I'm working to reduce the polys in the imported model (it's a simplified model of a city, so that takes awhile) and other methods of increasing FPS in an interactive 3D model could be useful.
The following snippet from the google code site looks like I should just be able to un-comment that section to enable backface culling within the library, but I can't get it to work.
- // turn on backface culling
- gl.glFrontFace(GL.GL_CCW);
- gl.glPolygonMode(GL.GL_FRONT, GL.GL_FILL);
- // gl.glPolygonMode(GL.GL_BACK, GL.GL_GLPOINTS);
- // gl.glEnable(GL.GL_CULL_FACE);
- //
- // gl.glCullFace(GL.GL_BACK);
I tried expanding the library's .JAR file, uncommenting the section and turning it back into a JAR file, but that still shows backfaces (you can see them when the faces are rendered with some transparency) and I haven't seen a change in the FPS.
I'm working to reduce the polys in the imported model (it's a simplified model of a city, so that takes awhile) and other methods of increasing FPS in an interactive 3D model could be useful.
1