Various examples of view frustum calculations are using glGetFloatv() to get the current projection and modelview matrices (GL_PROJECTION_MATRIX, GL_MODELVIEW_MATRIX), and based of that do some view frustum culling.
I have read that glGet* is something you do not want in your main render loop;
"Using "Get" or "Is" functions slows down render performance. These commands force the graphic system to execute all queued OpenGL calls before it can answer the "Get" or "Is" query."
So my question is. How do I create a solid Frustum culling algorithm in my code and where do I put it in order to ensure that this stalling never happens?
You could always store the current matrices in your app so that when you want them you don't need to make a glGet call, you can just grab them ...
http://www.lighthouse3d.com/opengl/viewfrustum/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With