(I have a celeron 416/geForce II MX 32, test resolution 800x600x32)
I’m on OpenGL learning curve and lately i’ve found that drawing 480 gouraud cubes at THE SAME place actually kills the frame rate : 3/4/5 FPS.
Drawing those same cubes at DIFFERENT places is, on another side, safe for the frame rate : 75 FPS.
Tell me if i’m wrong : what kills the frame rate is, in this case, zbuffer test. If the camera is close to the 480 cubes at the same place then there may be chance that there will be nearly 800x600x480 zbuffer tests for ONE display !!
Well the fact was that, obviously, if you fill nearly all the screen something like 480 times the screen in ONE frame you could have A LOT OF zbuffer tests that would actually kill your framerate…
This may seem obvious for many coders, but it takes me 2 day of coding to understand this simple law
I don’t think that explains the drop in fps, though. The depth test is performed in any event, whether there’s an object rendered at a specific location or not.
In fact, if you draw the same object over itself 400 times OpenGL performs 1 test for the incoming object, not 400. There really should be no difference if the objects are in the same place or scattered around the scene.
I’ve run a lot of tests and I found that most of the drop (in my case it is about 25%) is due to anti-aliasing when the objects are rendered at the same location.
If yes, try to put different colors to different cubes and let see if it switches from a color to another one. I don’t know why u draw hundred times the same cube at the same place but you shouldn’t… Maybe the depth buffer test look with an offset wich pixel is in front of wich another one (so if they are at the same Z, it must be difficult)