lecture 2: the real-time graphics pipeline€¦ · lecture 2: the real-time graphics pipeline...
TRANSCRIPT
![Page 1: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/1.jpg)
Lecture 2:The Real-Time Graphics Pipeline
Kayvon FatahalianCMU 15-869: Graphics and Imaging Architectures (Fall 2011)
![Page 2: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/2.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
Today▪ The real-time graphics pipeline
▪ How the pipeline is used by applications (workload)
![Page 3: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/3.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
Issues to keep in mind
▪ Level of abstraction
▪ Orthogonality of abstractions
▪ How is it designed for performance/scalability?
▪ What the system does and DOES NOT do
![Page 4: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/4.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
System stackApplication
(e.g, a computer game)
Scene graph(database representing/organizing the scene: objects, materials, lights, etc.)
Graphics Pipeline(OpenGL/Direct3D)
Graphics Pipeline Implementation(software driver + GPU)
![Page 5: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/5.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
The graphics pipeline (from last time)
Primitive Generation
Vertex Generation
Vertex Processing
Rasterization(Fragment Generation)
Fragment Processing
Frame-Bu!er Ops
Primitive Processing
Vertices
Primitives
Fragments
Pixels
Frame Bu!er
Memory
![Page 6: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/6.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
“Assembling vertices”
Vertex Generation
Vertex Processing
V0 V1 VN-1
glBindBuffer(GL_ARRAY_BUFFER, my_vtx_buffer);glDrawArrays(GL_TRIANGLES, 0, N);
glBindBuffer(GL_ARRAY_BUFFER, my_vtx_buffer); glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, my_vtx_indices);
V0 V1 VN-1
1 3 2 1 5 6
Indexed Version (gather)
Contiguous Version
![Page 7: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/7.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
“Assembling vertices”
Vertex Generation
Vertex Processing
XYZ0 XYZ1 XYZN-1
Contiguous Version
UV0 UV1 UVN-1
N0 N1 NN-1
Current pipelines set limit of 16 "oat4 attributes per vertex.
![Page 8: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/8.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
Vertex stage inputs
Vertex Generation
Vertex Processing
Memory
Uniformdata
Uniform data: constant across verticese.g., vertex transform matrix
![Page 9: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/9.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
Vertex stage inputs
Vertex Processing
Memory
Uniformdata
struct input_vertex{ float3 pos; // object space}
struct output_vertex{ float3 pos; // NDC space}
uniform mat4 my_transform;
output_vertex my_vertex_program(input_vertex input){ output_vertex out; out.pos = my_transform * input.pos; // matrix-vector mult}
(*** Note: for clarity, this is not proper GLSL syntax)
Program
1 input vertex 1 output vertexindependent processing of each vertex
![Page 10: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/10.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
Vertex processing example: lighting
Per vertex data: surface normal, surface colorUniform data: light direction, light color
Per vertex lighting Per vertex normal, per pixel lighting
![Page 11: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/11.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
Vertex processing example: skinning
Image credit: http://www.okino.com/conv/skinning.htm
Per vertex data: blend coe#cients (depend on current animation frame)Uniform data: “bone” matrices
![Page 12: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/12.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
The graphics pipeline
Primitive Generation
Vertex Generation
Vertex Processing
Rasterization(Fragment Generation)
Fragment Processing
Frame-Bu!er Ops
Primitive Processing
Vertices
Primitives
Fragments
Pixels
Frame Bu!er
Memory
Uniformdata
1 in / 1 out
3 in / 1 out(for tris)
![Page 13: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/13.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
Primitive processing
Primitive Generation
Vertex Generation
Vertex Processing
Primitive Processing
Memory
Uniformdata
Uniformdata
input vertices for 1 prim output vertices for N prims**independent processing of each INPUT primitive
** caps output at 1024 "oats of output
![Page 14: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/14.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
The graphics pipeline
Primitive Generation
Vertex Generation
Vertex Processing
Rasterization(Fragment Generation)
Fragment Processing
Frame-Bu!er Ops
Primitive Processing
Vertices
Primitives
Fragments
Pixels
Frame Bu!er
Memory
Uniformdata
1 in / 1 out
3 in / 1 out(for tris)
Uniformdata1 in / small N out
![Page 15: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/15.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
Rasterization
Primitive Generation
Vertex Generation
Vertex Processing
Rasterization(Fragment Generation)
Primitive Processing
1 input prim N output fragments
N is unbounded(size of triangles varies greatly)
struct fragment // note similarity to output_vertex from before{ float x,y; // screen pixel coordinates float z; // depth of triangle at this pixel
float3 normal; // application-defined attributes float2 texcoord; // (e.g., texture coordinates, surface normal)
}
![Page 16: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/16.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
Rasterization
Primitive Generation
Vertex Generation
Vertex Processing
Rasterization(Fragment Generation)
Primitive Processing
Compute covered pixelsSample vertex attributes once per covered pixel
struct fragment // note similarity to output_vertex from before{ float x,y; // screen pixel coordinates (sample point location) float z; // depth of triangle at sample point
float3 normal; // interpolated application-defined attribs float2 texcoord; // (e.g., texture coordinates, surface normal)
}
![Page 17: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/17.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
The graphics pipeline
Primitive Generation
Vertex Generation
Vertex Processing
Rasterization(Fragment Generation)
Fragment Processing
Frame-Bu!er Ops
Primitive Processing
Vertices
Primitives
Fragments
Pixels
Frame Bu!er
Screen Space
Object/world/camera Space
![Page 18: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/18.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
The graphics pipeline
Primitive Generation
Vertex Generation
Vertex Processing
Rasterization(Fragment Generation)
Fragment Processing
Frame-Bu!er Ops
Primitive Processing
Vertices
Primitives
Fragments
Pixels
Frame Bu!er
Memory
Uniformdata
1 in / 1 out
3 in / 1 out(for tris)
Uniformdata1 in / small N out
1 in / N out
![Page 19: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/19.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
Fragment processing
Fragment Processing
Memory
Uniformdata
struct input_fragment{ float x,y; float z; float3 normal; float2 texcoord;
}
struct output_fragment{ int x,y; // pixel float z; float4 color; }
Texture Bu!er 0
Texture Bu!er N
...
texture my_texture;
output_vertex my_vertex_program(input_vertex input){ output_fragment out; float4 material_color = sample(my_texture, input.texcoord);
for (all lights in scene) { out.color += // compute light reflectance towards camera } }
![Page 20: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/20.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
Many uses for texturesProvide surface color/re"ectance
Slide credit: Pat Hanrahan
Modulate surface color/re"ectance
![Page 21: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/21.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
Bump mapping
[Image credit: Wikipedia]
Bump mapping:Displace surface in direction of normal (for lighting calculations)
![Page 22: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/22.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
Normal mappingModulate interpolated surface normal
Slide credit: Pat Hanrahan
Modulate surface color/re"ectance
![Page 23: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/23.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
Many uses for texturesStore precomputed lighting
Slide credit: Pat Hanrahan
Modulate surface color/re"ectance
![Page 24: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/24.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
The graphics pipeline
Primitive Generation
Vertex Generation
Vertex Processing
Rasterization(Fragment Generation)
Fragment Processing
Frame-Bu!er Ops
Primitive Processing
Vertices
Primitives
Fragments
Pixels
Frame Bu!er
Memory
1 in / 1 out
3 in / 1 out(for tris)
1 in / small N out
1 in / N out
** 1 in / 1 out Uniformdata
Texturebu!ers
Uniformdata
Texturebu!ers
Uniformdata
Texturebu!ers
** can be 0 out
![Page 25: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/25.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
Frame-bu!er operations
Pixel Operations
Frame Bu!er
Memorystruct output_fragment{ int x,y; float z; float4 color; }
![Page 26: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/26.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
Frame-bu!er operations
Stencil Bu!er
Memorystruct output_fragment{ int x,y; float z; float4 color; }
Alpha Test
Stencil test
Depth test
Update target
Z Bu!er
Color Bu!er 0
Color Bu!er N
...
if (fragment.z < zbuffer[fragment.x][fragment.y]){ zbuffer[fragment.x][fragment.y] = fragment.z; colorbuffer[fragment.x][fragment.y] = blend(colorbuffer[fragment.x][fragment.y], fragment.color);}
Depth test (hidden surface removal)
![Page 27: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/27.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
Frame-bu!er operations
if (fragment.z < zbuffer[fragment.x][fragment.y]){ zbuffer[fragment.x][fragment.y] = fragment.z; colorbuffer[fragment.x][fragment.y] = blend(colorbuffer[fragment.x][fragment.y], fragment.color);}
Depth test (hidden surface removal)
![Page 28: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/28.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
The graphics pipeline
Primitive Generation
Vertex Generation
Vertex Processing
Rasterization(Fragment Generation)
Fragment Processing
Frame-Bu!er Ops
Primitive Processing
Vertices
Primitives
Fragments
Pixels Frame Bu!er
Memory
1 in / 1 out
3 in / 1 out(for tris)
1 in / small N out
1 in / N out
1 in / 1 out Uniformdata
Texturebu!ers
Uniformdata
Texturebu!ers
Uniformdata
Texturebu!ers
1 in / 0 or 1 out
![Page 29: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/29.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
Programming the pipeline▪ Issue draw commands frame-bu!er contents change
Bind shaders, textures, uniformsDraw using vertex bu!er for object 1Bind new uniformsDraw using vertex bu!er for object 2 Bind new shaderDraw using vertex bu!er for object 3
CommandCommand Type
State change
Change depth test function Bind new shader Draw using vertex bu!er for object 4
DrawState changeDrawState changeDrawState changeState changeDraw
Note: e#ciently managing stage changes is a major challenge in implementations
![Page 30: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/30.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
Feedback loop▪ Issue draw commands frame-bu!er contents change
Bind contents of color bu!er as texture 1Draw using vertex bu!er for object 5Draw using vertex bu!er for object 6
CommandCommand Type
State changeDrawDraw
...
Key idea for:shadowsenvironment mappingpost-processing e!ects
1000-1500 draw calls per frame(source: Johan Andersson, DICE -- circa 1998)
![Page 31: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/31.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
Feedback loop 2▪ Issue draw commands save intermediate geometry
Primitive Generation
Vertex Generation
Vertex Processing
Primitive Processing
Vertices
Primitives
Memory
1 in / 1 out
3 in / 1 out(for tris)
1 in / small N outUniform
dataTexturebu!ers
Uniformdata
Texturebu!ers
output vertex bu!er
![Page 32: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/32.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
OpenGL state diagram (OGL 1.1)
![Page 33: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/33.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
Graphics pipeline with tessellation(OpenGL 4, Direct3D 11)
Primitive Generation
Vertex Generation
Vertex Processing
Rasterization(Fragment Generation)
Fragment Processing
Frame-Bu!er Ops
Primitive Processing
Vertices
Primitives
Fragments
Pixels
1 in / 1 out
3 in / 1 out(for tris)
1 in / small N out
1 in / N out
1 in / 1 out
1 in / 0 or 1 out
Fine Primitive Generation
Vertex Generation
Vertex Processing
Rasterization(Fragment Generation)
Fragment Processing
Frame-Bu!er Ops
Fine Primitive Processing
Coarse Vertices
Fine Primitives
Fragments
Pixels
1 in / 1 out
3 in / 1 out(for tris)
1 in / small N out
1 in / N out
1 in / 1 out
1 in / 0 or 1 out
Fine Vertex Processing
TessellationFine Vertices
Coarse Primitive ProcessingCoarse Primitives1 in / 1 out
1 in / 1 out
1 in / N out
![Page 34: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/34.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
Graphics pipeline characteristics
▪ Level of abstraction- Declarative, not imperative
(“Draw a triangle, using this fragment program, with depth testing on” vs. “draw a cow made of marble on a sunny day”)
- Programmable stages give large amount of application "exibility
- Con$gurable: Turn stages on and o!, feedback loops
- Low enough to allow application to implement many techniques, high enough to abstract over radically di!erent implementations
![Page 35: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/35.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
Graphics pipeline characteristics
▪ Orthogonality of abstractions- All vertices treated the same
- Vertex programs work for all primitive types
- All primitives turned into fragments
- Fragment programs oblivious to primitive type
- Hidden surface remove via z-bu!ering: oblivious to primitive type
- Same is true for anti-aliasing (will be discussed later)
![Page 36: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/36.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
Graphics pipeline characteristics▪ How is it designed for performance/scalability?
- [Reasonable low level]: low abstraction distance
- Constraints on pipeline structure
- Constrained data-"ows between stages
- Fixed-function stages
- Independent processing of each data element (enables parallelism)
- Di!erent frequencies of computation (per vertex, per primitive, per fragment)
- Only perform work at the rate required
- Keep it simple
- Common intermediate representations
- Triangles, points, lines
- Fragments, pixels
- Z-bu!er algorithm
- “Immediate mode system”: processes primitives as it receives them(as opposed to bu!ering the entire scene)
- Leave global optimization of how to render scene to application (scene graph)
![Page 37: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/37.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
Graphics pipeline characteristics
▪ What it DOES NOT do- Modern OpenGL has no concept of lights, materials, modeling transforms
- Only vertices, primitives, fragments, pixels, and STATE: bu!ers and shaders
- No concept of scene
- No global e!ects (must be implemented using multiple draw calls by application: e.g, shadow maps)
- No I/O, window management
![Page 38: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/38.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
Perspective from Kurt Akeley▪ Does the system meet original design goals, and then do
much more than was originally imagined?
- Simple, orthogonal concepts
- Ampli"er e!ect
▪ Often you’ve done a good job if no one is happy ;-)(you still have to meet design goals)
![Page 39: Lecture 2: The Real-Time Graphics Pipeline€¦ · Lecture 2: The Real-Time Graphics Pipeline Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011)](https://reader030.vdocuments.us/reader030/viewer/2022041112/5f1aae41892341799c661cae/html5/thumbnails/39.jpg)
Kayvon Fatahalian, Graphics and Imaging Architectures (CMU 15-869, Fall 2011)
Readings▪ M. Segal and K. Akeley. The Design of the OpenGL Graphics Interface
▪ D. Blythe. The Direct10 System. SIGGRAPH 2006