Skip to main content
GameDev.net gamedev.net
🔒 Locked

Slow culling

Started by space warp Apr 1, 2007 at 2:35 AM 2 replies 850+ views
Original Post
space warp
space warp
Ok, culling is supposed to speed things up by making OpenGL ignore faces that are not facing the viewer, right? I tried culling in my game and the fps was instead lowered by 20%. Am I doing something wrong or is it simply the way it is? Here is my setup:
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
PS I would also appriciate any tips on how to further speed up rendering, right now I am using display lists and manual visibility tests. [Edited by - space warp on April 1, 2007 2:56:59 AM]
.sehkteeah erthyahr gahro
godmodder
godmodder
Hello,

glEnable(GL_CULL_FACE); adds another stage to the graphics pipeline to cull backfaces not visible to the user. This mostly prevents the graphics card from processing unneeded fragments. When you're not fragment-limited, you might experience more overhead from the culling then it saves on fragment processing power.

Jeroen
space warp
space warp
Ok, so then it's just better to do it manually if at all?
.sehkteeah erthyahr gahro
godmodder
godmodder
Hello,

I think OpenGL's culling code is pretty optimized. It would be hard for any manual code on the CPU to do better. But the thing is: you should only use the built-in culling function when you are fragment limited or on other occasions when it gives you more performance. It's important to realize that turning on any sort of culling method also induces a performance hit. 3D programming is about constantly observing the load balancing between different stages of the pipeline. When you're fragment limited, you use culling that lessens the load on the fragment pipeline stage, when you're CPU limited, you want to use as little manual culling code as possible.

Jeroen

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.