lec 3 - The rendering pipeline Flashcards
Why have a rendering pipeline?
It allows the programmer to perform a number of different operations on the input data, and provides greater efficiency
How does the graphics card represent object?
As triangles
What is the rendering pipeline?
- Input Assembler Stage
- Vertex Shader
- Tesselation stages
- Geometry shader
- Stream Output stage
- Rasterizer stage
- Pixel shader
- Output merger
What happens at the Input assembler stage?
data is read from buffers into a primitive format that can be used by the other stages of the pipeline. Triangle lists are mainly used.
What happens at the vertex shader stage?
Operations are preformed on individual vertices received from the Input Assembler stage.
This will typically include transformations
May also include per-vertex lighting.
Why are vertex shader transformations needed?
Objects are typically created in their local space and need to be brought into world space. This is done via transformations.
What happens in the tesselation stages?
Is an optional Stage. These stages allow us to generate additional vertices within the GPU
Can take a lower detail model and render in higher detail
Can perform level of detail scaling
What happens in the Geometry Shader stage?
Optional Stage
Operates on an entire primitive (e.g. triangle)
Can perform a number of algorithms, e.g. dynamically calculating normals, particle systems, shadow volume generation
What happens in the Stream Output stage?
Allows us to receive data (vertices or primitives) from the geometry shader or vertex shader and feed back into pipeline for processing by another set of shaders. Useful e.g. for particle systems
What happens in the rasterizer stage?
Interpolates data between vertices to produce per-pixel data
Clips primitives into view frustum
Performs culling
What is culling?
In order to avoid rendering vertices that will not be displayed in the final image ‘culling’ is preformed.
Triangles facing away from the camera will be culled and not rendered
What is counter-clockwise culling?
Triangles with vertices in a counter-clockwise order are not rendered. The order of vertices is therefore important
What happens in the pixel (fragment) shader stage?
Produces colour values for each interpolated pixel fragment
Per-pixel lighting can be performed
Can also produce depth values for depth-buffering
What happens at the Output merger stage?
Combines pixel shader output values to produce final image
May also perform depth buffering
What is double buffering?
Don’t want to draw objects directly to the screen
The screen could update before a new frame has been completely drawn
Instead, draw next frame to a buffer and swap buffers when complete.