PDA

View Full Version : Clipping before Culling



IG
04-30-2006, 11:38 PM
Why according to th GL spec and RedBook clipping is done before culling in the graphics pipeline? Can they be overturned?

jide
05-01-2006, 05:46 AM
Because there's no need to cull a face that's outside the frustum. Also clipping is always done whereas you can enable/disable culling.

IG
05-01-2006, 11:25 AM
But on the other hand you do not need to clip a culled polygon...clipping is expensive...and if you disable culling it still doesn't matter if it will be before / after clip, so I don't understand this reason...

jide
05-01-2006, 11:58 AM
Yeah of course you do not need to clip a culled polygon... if culling is enabled !

This is the way it's got to be. But as far as I can remember, GL implementations might not follow all the line-up of the fixed pipeline.

Clipping is expensive only for the polygons that lie half in the frustum and half outside the frustum. For polygons completly outside the frustum clipping is not expensive (only disregard the matching polygons).

And commonly applications that tend to have many clipping to do will do it in software mode in order to reduce the calculations made by GL.

Overmind
05-02-2006, 02:42 PM
The order of operations in the OpenGL pipeline is not a strict rule how to calculate things, it only specifies how the final result should look like.

The implementations are free to reorder operations, as long as the result stays the same. In case of culling/clipping, it doesn't matter which one is done first, so implementations can do it in any order.