Lately, I've been learning some OpenGL for fun, and I've been thinking about hidden surface removal.
Say you have a high poly count static scene, with nothing that moves, no bones, physics, etc. Just static models to be drawn. I was thinking that you could put all the faces in the scene into a quad/octree. And with the camera position, and dimensions of the view frustum, you could traverse the tree to construct an index buffer of all the faces that are within the view frustum (facing towards you of course). You could then update the index buffer with glBufferSubData()
, and draw with glDrawElements()
, and you would do this every frame, and if my limited understanding is correct, this should theoretically draw only the faces you see, right?
So is this a good/valid way to do occulusion culling? If not, how else can you do it?