Download Rendering Pipeline - Computer Graphics and more Exams Computer Graphics in PDF only on Docsity!
Image Processing and Computer Graphics
Rendering Pipeline
Matthias Teschner
Computer Science Department
University of Freiburg
introduction
rendering pipeline
vertex processing
primitive processing
fragment processing
summary
Outline
rendering algorithm for generating 2D images from
3D scenes
transforming geometric primitives such as lines and
polygons into raster image representations, i.e. pixels
Rasterization
[Akenine-Moeller et al.: Real-time Rendering]
3D objects are approximately represented by
vertices (points), lines, polygons
these primitives are processed to obtain a 2D image
Rasterization
[Akenine-Moeller]
introduction
rendering pipeline
vertex processing
primitive processing
fragment processing
summary
Outline
3D input
a virtual camera
position, orientation, focal length
objects
points (vertex / vertices), lines, polygons
geometry and material properties
(position, normal, color, texture coordinates)
light sources
direction, position, color, intensity
textures (images)
2D output
per-pixel color values in the framebuffer
Rendering Pipeline - Task
Rendering Pipeline Main Stages vertex processing / geometry stage / vertex shader processes all vertices independently in the same way performs transformations per vertex, computes lighting per vertex geometry shader generates, modifies, discards primitives primitive assembly and rasterization / rasterization stage assembles primitives such as points, lines, triangles converts primitives into a raster image generates fragments / pixel candidates fragment attributes are interpolated from vertices of a primitive fragment processing / fragment shader processes all fragments independently in the same way fragments are processed, discarded or stored in the framebuffer
Rendering Pipeline Main Stages
[Lighthouse 3D]
vertex position transform lighting per vertex primitive assembly, combine vertices to lines, polygons rasterization, computes pixel positions affected by a primitive fragment generation with interpolated attributes, e.g. color fragment processing (not illustrated), fragment is discarded or used to update the pixel information in the framebuffer, more than one fragment can be processed per pixel position
introduction
rendering pipeline
vertex processing
primitive processing
fragment processing
summary
Outline
model transform view transform lighting projection transform clipping viewport transform Vertex Processing (Geometry Stage)
M 1 , M 2 , M 3 , M 4 , V are matrices representing transformations
M 1 , M 2 , M 3 , M 4 are model transforms to place the objects in the scene
V places and orientates the camera in space
V
transforms the camera to the origin looking along the negative z-axis
model and view transforms are combined in the modelview transform
the modelview transform V
M1..4 is applied to the objects
Model Transform View Transform
V
[Akenine-Moeller et al.: Real-time Rendering]
M 1
M 3 M 2
M 4
V
Inverse
interaction of light sources and surfaces
is represented with a lighting /
illumination model
lighting computes color for each vertex
based on light source positions and properties
based on transformed position, transformed
normal, and material properties of a vertex
Lighting
view volume (cuboid or frustum) is transformed
into a cube (canonical view volume)
objects inside (and outside) the view volume
are transformed accordingly
orthographic
combination of translation and scaling
all objects are translated and scaled in the same way
perspective
complex transformation
scaling factor depends on the distance of an object to the viewer
objects farther away from the camera appear smaller
Projection Transform
primitives, that intersect the boundary of the view
volume, are clipped
primitives, that are inside, are passed to the next processing stage
primitives, that are outside, are discarded
clipping deletes and generates vertices and primitives
Clipping
[Akenine-Moeller et al.: Real-time Rendering]