General understanding of the GL Pipeline

hi all,

i just like to understand how the data is processed.

so lets say i am drawing 2 quads one in front of the other.

  1. i draw the one in the back
  2. i draw the one in front

how is it processed ? after i draw the first one, is it processed through the complete pipeline and after that the same happens for the second quad,
OR
are both quads stored into some temp buffer first and than somehow together proccesd through the pipeline …

thanx for input :slight_smile:

cu
uwi

See http://en.wikipedia.org/wiki/OpenGL for more information. Especially, look at the picture:

To add a little more information:

There is a depth buffer, that keeps track of the distance to every pixel on the screen. When you draw something, it will usually be discarded if it has a depth value greater than the previous pixel at that position. Being discarded in this case means being removed from the “rest of the pipeline”.

If you sort you objects, roughly, according to distance, then it can improve the rendering speed.

The pipeline is long and complex, but you could say a simplified view of it is the vertex shader and the fragment shader. Your quads need to go through the vertex shader, which will transform coordinates to screen coordinates. After that, the fragment shader is run for each pixel of your quad (to compute the colour). Before the fragment shader, the depth buffer is used to detect pixels that will not be shown, and thus can be ignored.

This is the default behaviour, but is configurable in any way imaginable.

Hi,
thanx for the feedback.
I know about what the pipeline does and the shaders.
i just like to know is it done for every ‘draw’ command.
ob somehow by the end of each frame ?
so quad by quad or all together ?

cu
uwi

That kind of thing is not described by the GL pipeline. The GL pipeline doesn’t say when drawing takes place and how. Implementation details are left to the implementor of the driver.

But in practical terms, the GL driver buffers commands. That means it stores commands in a buffer in RAM. When sufficient commands are piled up, it sends it to the GPU. That way, bus traffic is reduced (whether the bus is PCI or AGP or PCI express or something else).

ok,

great, that was the answer for me !!

thanx

uwi