Lecture 3 Flashcards
Why use a pipeline?
Provides efficiency and allows programmer to perform number of operations on input data
What states are there in the pipeline?
1) Input Assembler
2) Vertex Shader
3) Tesselation Stage (Hull Shader, Tesselator, Domain Shader)
4) Geometry Shader
5) [Stream Output]
6) Rasterizer Stage
7) Pixel Shader
8) Output Merger
What happens at Input Assembler?
Reads data from buffers into primitive format for use by other stages (mainly triangle lists)
What does graphics card render objects as?
Triangles
What happens at Vertex Shader?
Performs operations on individual vertices (received from input assembler), including transformations and per-vertex lighting
What view parameters does camera have?
EYE - where it’s located
AT - what it points at
UP - upward orientation
What view parameters is camera’s view frustrum specified by?
1) fovy - rotation
2) aspect - width/height
3) zNear
4) zFar
What happens at tesselation stages?
Group of optional stages (Hull Shader, Tesselator, Domain Shader)
Allow generation of multiple vertices for added detail
What happens at Geometry Shader?
Operates on entire primitive (eg. triangle) and can perform number of operations, like dynamically calculating normals, particle systems, shadow volume generation
What happens at Stream Output Stage?
Feed output of Geometry Shader stage to create new vertices to go back into start of pipeline for processing by another set of shaders (eg. useful for particle systems)
What happens at Rasterizer Stage?
Take that 3D vertex information and converts it down into pixels, interpolating data (eg. color) between vertices to produce per-pixel data.
Clips primitives into view frustrum - everything outside screen discarded. Culling performed here.
What is culling?
Triangles facing away from screen not rendered
Left hand rule - triangles with vertices in counter-clockwise order not rendered
What happens at Pixel (fragment) Shader?
Produces colour values for interpolated pixels
Per-pixel lighting to be performed
Depth values can be produced for depth-buffering
What happens at Output Merger?
Combines pixel shader outputs to produce final image. May include depth buffering. Put one with smallest depth value in front.
How does water work?
Combines colors of both water and whatever is beneath it