- Home /
Can the Cull option in shader improve perfomances ?
Hi,
I'm at the "performances improvement" step of our development and I'm a bit suprised that whatever cull option I set in my single-pass shader (the one I use to draw full opaque object) I always end up with the same performances (number of drawcall, number of triangles and framerate don't move at all).
Indeed I was expecting that when I switch from a Cull Off option (front and back faces are rendered) to a Cull Front option (only front faces are rendered) I might end up with something roughly twice as faster as before. But I didn't...
Is this result the kind of one expected with Cull Off / Front / Back option activated or have I just misunderstood the performances implication of this option ?
Thanks.
Answer by Owen-Reynolds · Mar 12, 2014 at 01:34 PM
Yes.
Culling works inside the GPU, "after" you've created all the triangles, done all the draw calls, etc... , so won't reduce them. The only effect should be an increase in the framerate.
What back face culling actually does is skip (Cull) faces which are pointed the wrong direction. For a 2D game, say, even with particles, every single face is pointed towards you anyway, so culling does nothing (the setting won't matter, since the graphics card always checks.)
Backface culling is really meant for 3D models. In a cube, sphere, orc ... any "solid" object, half the faces are always aimed the wrong way and will always be covered up anyway. Every pixel is double-drawn. What % speed-up is cutting drawn pixels in half? If ice cream cost 1/2 as much (just the ice-cream, the cones and overhead cost the same) what % would a single scoop drop by? Less than half, but not nothing.
Answer by Walibi33 · Mar 12, 2014 at 05:33 PM
Indeed I thought there was no increase of performances but there is one, slight one though... And, yes, definitely not 50% :)