I am wondering how I can cull polygons from my game models.
Now, let me explain exactly what I am asking because I know a lot of you are thinking, “Well, use face culling of course”. =)
That is not what I am asking. In my engine, I am using Poser models. They are indexed, meaning I draw them with a glDrawElements call. The vertices, face colors, texture coordinates, etc are all indexed.
I am implementing object removel, so if the object is behind you, I just don’t draw it. When the model is full in front of you, of course the OGL backface culling takes care of not drawing the polygons on the far side of the figure.
Now, here’s the real question. Let’s say the model is halfway in my view. Id there a way to have glDrawElements ONLY draw the polygons that are in my sight? If only 1 polygon from the figure is in my view, is there a way to have glDrawElements only parse that polygon?
Another example: In my world, I have an object with 5000 tris in it surroundg the play area (hollowed out mountain from Bryce).
The game is crawling right now because when glDrawElements gets called, it seems to draw the whole thing even though a huge percentage of it is never going to be in your view.
Do I need to forget about array element drawing, unravel the arrays, and do my own polygon checking? I hope not. <Shiver> That would likely grind the engine to a halt pretty quickly.