The Graphics Pipeline [PDF]

The OpenGL Graphics Pipeline. Vertex. Shader. Tessellation. Control. Tessellation. Evaluation. Tessellator. Geometry. Sh

3 downloads 7 Views 2MB Size

Recommend Stories


Graphics Pipeline
No amount of guilt can solve the past, and no amount of anxiety can change the future. Anonymous

the pipeline
You have to expect things of yourself before you can do them. Michael Jordan

The pipeline
Knock, And He'll open the door. Vanish, And He'll make you shine like the sun. Fall, And He'll raise

PipeLine
The happiest people don't have the best of everything, they just make the best of everything. Anony

Computer Graphics & Animation - SciTechnol [PDF]
books including Drawing the Line: The Untold Story of the Animation Unions from Bosko to Bart Simpson (Univ Press of Kentucky, 2006), and Moving Innovation, a History of Computer Animation (MIT Press, 2013). [email protected]. Tom Sito, J Comput Eng In

Through the Pipeline
Make yourself a priority once in a while. It's not selfish. It's necessary. Anonymous

PipeLine
If you want to go quickly, go alone. If you want to go far, go together. African proverb

The Vocational Teacher Pipeline
Do not seek to follow in the footsteps of the wise. Seek what they sought. Matsuo Basho

The Vocational Teacher Pipeline
Ask yourself: What would I do differently if I knew nobody would judge me? Next

The Plumbing Pipeline
We may have all come on different ships, but we're in the same boat now. M.L.King

Idea Transcript


Ju

On j ra

ri k e d

rik e nd o |

@

.sk g c sc

Lesson

05

The Graphics Pipeline

Outline of Lesson 05 

What is The Graphics Pipeline



Vertex Shader



Primitive Assembly



Tessellation Shaders



Geometry Shader



Geometry Postprocessing and Rasterization



Fragment Shader



Frame Buffer Operations

The Graphics Pipeline

Fixed Pipeline Overview

The OpenGL Graphics Pipeline Vertices

Input

Vertex Shader

Transformed vertices

Patches

Primitives

Geometry Postprocessing, Rasterization

Buffers

Transform feedback

Primitive Assembly

Connectivity

Transform feedback

Primitives

Geometry Shader Primitives

Tessellation Control

Tessellation Evaluation

Patch Vertices and Tessellation params Input/Output data Fixed stage Optional stage Programmable stage

Tessellator

Fragments

Fragment Shader Shaded fragments

Frame Buffer Operations Pixels

Vertices and uv coordinates

Screen

:: Vertex Shader 

Vertex Shader

Transformed vertices

Specification (Programmable)  



Vertices

Transform feedback

Operates on vertices, one vertex at a time. Has no knowledge of primitive or its type of the vertex



Input: Single vertex



Output: Single transformed vertex

Main Purpose 

Model-View-Projection transformations



Per-vertex Lighting

:: Vertex Shader

Vertices

Vertex Shader

Transform feedback

Transformed vertices



Input per-vertex variables defined in GLSL



Output per-vertex variables defined in GLSL

:: Vertex Shader

Vertices

Vertex Shader

Transformed vertices

Transform feedback

:: Primitive Assembly

Transformed vertices

Connectivity



Specification (Fixed) 

 



Primitive Assembly

Primitives

Patches

Constructs list of primitives based on transformed vertices and respective connectivity informations Input: Transformed vertices + connectivity info Output: Ready primitives (lines, triangles...) or patches

Main Purpose 

Prepare complete primitive data for next stages (tessellation or geometry shader)

:: Primitive Assembly

Transformed vertices

Connectivity

Primitive Assembly Patches

Primitives

:: Primitive Assembly

Transformed vertices

Connectivity

Primitive Assembly Patches

Primitives

Tessellation Stages 

Quad subdivision with and without smoothing

Tessellation Stages 

Specification 

Three sub-stages (control, tessellator, evaluator)



Based on patch data creates new primitives



Input: Patches from primitive assembly (or geom)





Output: New subdivided primitives based on tessellation scheme

Main Purpose 

Dynamic subdivision of geometry



Local displacements



Level of detail

Patches

:: Tessellation Control 



Specification

Tessellation Control Patch Vertices and Tessellation params



Set up tessellation levels along edges and faces



Input: Patch geometry (vertices + connectivity)



Output: Inner and Outer tessellation levels

Main Purpose  

Defines subdivision topology Control how much are faces (inner) and edges (outer) subdivided during tessellation

Patches

:: Tessellation Control

Tessellation Control Patch Vertices and Tessellation params

:: Tessellator 

Specification (Fixed) 



Patch Vertices and Tessellation params

Tessellator Vertices and uv coordinates

Given patch is subdivided on edges and faces based on tessellation levels



New sub-patches are created with resp. uv coords



Input: Patch vertices and tessellation levels



Output: New subdivision vertices and uv coords

Main Purpose 

Provides core tessellation functionality



Subdivision is fixed

:: Tessellator

Patch Vertices and Tessellation params

Tessellator Vertices and uv coordinates

:: Tessellation Evaluation 

Specification (Programmable) 



Primitives

Tessellation Evaluation Vertices and uv coordinates

Based on uv coords (barycentric coords) evaluates positions of tessellated vertices



Input: Patch vertices and uv coordinates



Output: New primitives

Main Purpose 

Construct new primitives usable for next stages



Finalize the tessellation stage

:: Tessellation Evaluation

Primitives

Tessellation Evaluation Vertices and uv coordinates

:: Geometry Shader 

Primitives

Specification (Programmable, opt.) 



Transform feedback

Primitives

Geometry Shader Primitives

Given a primitive Geometry Shader creates zero or more primitives



Input: primitives (points, lines, triangles)



Output: primitives (points, line-strip, triangle-strip)

Main Purposes 

Create new primitives (general tessellation)



Layered rendering



Transform feedback

:: Geometry Shader 



Transform feedback Primitives

Primitives

Geometry Shader Primitives

Input Primitives 

Points (1 vertex)



Lines (2 vertices), lines_adjacency (4 vertices)



Triangles (3 vertices), triangles_adjacency (6 ver.)

Output Primitives 

Points



Line_strip



Triangle_strip lines_adjacency

triangles_adjacency

:: Geometry Shader 

Layered Rendering 





Transform feedback Primitives

Primitives

Geometry Shader Primitives

Rendering the same geometry into different layers (frame buffers) Eg. rendering into cubemap – 6 different layers

Transform Feedback 



We can run the vertex or geometry shader without rasterization and store modified vertices (primitives) into user defined buffers Use user defined (transform feedback) buffers as geometry input for other vertex/geometry shaders

:: Geometry Shader

Transform feedback Primitives

Primitives

Geometry Shader Primitives

:: Geometry Shader

Transform feedback Primitives

Primitives

Geometry Shader Primitives

:: Geometry Shader

Transform feedback Primitives

Primitives

Geometry Shader Primitives

Primitives

:: Geometry Postprocessing

Geometry Postprocessing, Rasterization Fragments





Specification (Fixed) 

View Frustum Clipping



Perspective Division (homogenous to viewport)



Viewport to Window Mapping (coords to pixels)

Main Purposes 

Final vertex processing before rasterization



Clipping → Perspective → Window

Primitives

:: Geometry Postprocessing

Geometry Postprocessing, Rasterization Fragments



View Frustum Clipping  

Reject all geometry outside view frustum (volume) Clip primitives which intersect clipping planes (view volume)



Vertex (xc, yc, zc, wc)



Is inside if



-wc

Smile Life

When life gives you a hundred reasons to cry, show life that you have a thousand reasons to smile

Get in touch

© Copyright 2015 - 2024 PDFFOX.COM - All rights reserved.