I have implemented an optimization in the BGE known as Pre Z, or depth pre-pass, and it is a method used to reduce overdraw. In one test scene I got about a 60% increase in FPS. More complex scenes will benifet more from this since they have a better chance of getting slown down by overdraw. However, I did not notice a decrease in perfromance with the default cube scene.
- Only works when using GLSL materials. I need to figure out of I just want to disable the optimizaiton for Multitexture and Singletexture, or if I want to try to get those modes working. They probably wouldn’t benefit much since they are not running fragment shaders.
- All objects must have a material. Objects without materials will either have z-fighting issues or have weird depth issues. I am still looking into solving this issue.
- Custom vertex shaders will not work with this since they will result in geometry having different depth values than those used for the pre pass. I might just disable objects with custom shaders from the pre pass so they won’t break in the regular pass.
What I’m looking for:
I need some feedback from others on how this optimization affects existing files. Are you noticing a speed up or slow down with your scenes? If so, how much? Are you running into issues other than the known issues? Also, any other feedback is also appreciated.
I’ll work on getting a Linux build up, but I don’t have a machine available to make OSX builds.