Way back in the day I used to use frustum culling and octrees to boost the performance of my 3D scene rendering. Nowadays I hope to accomplish this much easier with occlusion queries using GL_SAMPLES_PASSED.
My question is this, I have quite a few individual VAO mesh objects in my scene and I don’t want to issue a whole new series of draw calls for these, even if they are drawing a simple cube geometry with a flat shader. I’ve already noticed a slight performance drop testing this theory rendering the entire scene with just flat cubes in place of the objects.
What I’d rather do is just attach the queries to the actual live geometry drawing itself (one query per mesh) and use this information to determine whether or not to draw the geometry during the next frame. I plan on doing this asynchronously to avoid stalling the pipeline during the query retrieval.
Are there any serious performance implications that I should be aware of in doing this? Is it a bad idea to query GL_SAMPLES_PASSED during a production render of geometry?
At this point, I’m looking for the lesser of two evils.
edit: I just realized I’m an idiot. I need the simple geometry pass determine if the objects need to be drawn again