9 - Rendering pipeline and shaders Flashcards
Shaders
programmable stages of the OpenGL rendering pipeline.
Shaders are small programs compiled at run-time by the OpenGL program, which allows more flexibility in programming rendering steps and using graphics card acceleration.
They are sent to the GPU in parallel and are written in GL Shading Language (GLSL) .
Fixed stages:
-
-
Vertex Post-Processing
Primitive Assembly
Rasterization
-
Per-Sample Operations
Shader stages:
-
Vertex
Tessellation
Geometry Shader
-
-
-
Fragment shader
-
Vertex Specification
the array of all vertices is defined
Vertex shaders
perform basic processing of individual vertices in the scene (e.g. viewport transformation), ), whilst the next three stages perform some additional processing on the scene geometry.
Fragment shaders
process the fragments generated by rasterisation
Per-sample operations
for example, depth testing (where close/far objects are discarded) or stencil testing (where points outside a certain area are ignored).