![Page 1: Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)](https://reader031.vdocuments.net/reader031/viewer/2022032310/56649d895503460f94a6f32d/html5/thumbnails/1.jpg)
Rendering Pipeline
Aaron BloomfieldCS 445: Introduction to Graphics
Fall 2006(Slide set originally by Greg Humphreys)
![Page 2: Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)](https://reader031.vdocuments.net/reader031/viewer/2022032310/56649d895503460f94a6f32d/html5/thumbnails/2.jpg)
2
3D Polygon Rendering
Many applications use rendering of 3D polygonswith direct illumination
![Page 3: Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)](https://reader031.vdocuments.net/reader031/viewer/2022032310/56649d895503460f94a6f32d/html5/thumbnails/3.jpg)
3
3D Polygon Rendering
Many applications use rendering of 3D polygonswith direct illumination
Quake II(Id Software)
![Page 4: Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)](https://reader031.vdocuments.net/reader031/viewer/2022032310/56649d895503460f94a6f32d/html5/thumbnails/4.jpg)
4
3D Polygon Rendering
Many applications use rendering of 3D polygonswith direct illumination
![Page 5: Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)](https://reader031.vdocuments.net/reader031/viewer/2022032310/56649d895503460f94a6f32d/html5/thumbnails/5.jpg)
5
3D Rendering Pipeline3D Geometric Primitives
ModelingTransformation
ModelingTransformation
ViewingTransformation
ViewingTransformation
ProjectionTransformation
ProjectionTransformation
LightingLighting
Image
ClippingClipping
ScanConversion
ScanConversion
This is a pipelinedsequence of operations to draw a 3D primitive
into a 2D image
(this pipeline applies only for direct illumination)
![Page 6: Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)](https://reader031.vdocuments.net/reader031/viewer/2022032310/56649d895503460f94a6f32d/html5/thumbnails/6.jpg)
6
Example: OpenGL
ModelingTransformation
ModelingTransformation
Lighting &TexturingLighting &Texturing
ProjectionTransformation
ProjectionTransformation
ViewingTransformation
ViewingTransformation
Image
ClippingClipping
ScanConversion
ScanConversion
OpenGL executes steps of 3D rendering pipeline
for each polygon
OpenGL executes steps of 3D rendering pipeline
for each polygon
glBegin(GL_POLYGON);glVertex3f(0.0, 0.0, 0.0);glVertex3f(1.0, 0.0, 0.0);glVertex3f(1.0, 1.0, 1.0);glVertex3f(0.0, 1.0, 1.0);glEnd();
![Page 7: Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)](https://reader031.vdocuments.net/reader031/viewer/2022032310/56649d895503460f94a6f32d/html5/thumbnails/7.jpg)
7
3D Rendering Pipeline
ModelingTransformation
ModelingTransformation
Lighting &TexturingLighting &Texturing
ProjectionTransformation
ProjectionTransformation
ViewingTransformation
ViewingTransformation
3D Geometric Primitives
Image
ClippingClipping
ScanConversion
ScanConversion
Transform into 3D world coordinate system
![Page 8: Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)](https://reader031.vdocuments.net/reader031/viewer/2022032310/56649d895503460f94a6f32d/html5/thumbnails/8.jpg)
8
3D Rendering Pipeline
ModelingTransformation
ModelingTransformation
Lighting &TexturingLighting &Texturing
ProjectionTransformation
ProjectionTransformation
ViewingTransformation
ViewingTransformation
3D Geometric Primitives
Image
ClippingClipping
ScanConversion
ScanConversion
Transform into 3D world coordinate system
Transform into 3D camera coordinate systemDone with modeling transformation
![Page 9: Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)](https://reader031.vdocuments.net/reader031/viewer/2022032310/56649d895503460f94a6f32d/html5/thumbnails/9.jpg)
9
3D Rendering Pipeline
ModelingTransformation
ModelingTransformation
Lighting &TexturingLighting &Texturing
ProjectionTransformation
ProjectionTransformation
ViewingTransformation
ViewingTransformation
3D Geometric Primitives
Image
ClippingClipping
ScanConversion
ScanConversion
Transform into 3D world coordinate system
Transform into 3D camera coordinate systemDone with modeling transformation
Illuminate according to lighting and reflectanceApply texture maps
![Page 10: Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)](https://reader031.vdocuments.net/reader031/viewer/2022032310/56649d895503460f94a6f32d/html5/thumbnails/10.jpg)
10
3D Rendering Pipeline
ModelingTransformation
ModelingTransformation
Lighting &TexturingLighting &Texturing
ProjectionTransformation
ProjectionTransformation
ViewingTransformation
ViewingTransformation
3D Geometric Primitives
Image
ClippingClipping
ScanConversion
ScanConversion
Transform into 3D world coordinate system
Illuminate according to lighting and reflectanceApply texture maps
Transform into 2D screen coordinate system
Transform into 3D camera coordinate systemDone with modeling transformation
![Page 11: Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)](https://reader031.vdocuments.net/reader031/viewer/2022032310/56649d895503460f94a6f32d/html5/thumbnails/11.jpg)
11
3D Rendering Pipeline
ModelingTransformation
ModelingTransformation
Lighting &TexturingLighting &Texturing
ProjectionTransformation
ProjectionTransformation
ViewingTransformation
ViewingTransformation
3D Geometric Primitives
Image
ClippingClipping
ScanConversion
ScanConversion
Transform into 3D world coordinate system
Clip primitives outside camera’s view
Transform into 2D screen coordinate system
Transform into 3D camera coordinate systemDone with modeling transformation
Illuminate according to lighting and reflectanceApply texture maps
![Page 12: Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)](https://reader031.vdocuments.net/reader031/viewer/2022032310/56649d895503460f94a6f32d/html5/thumbnails/12.jpg)
12
3D Rendering Pipeline
ModelingTransformation
ModelingTransformation
Lighting &TexturingLighting &Texturing
ProjectionTransformation
ProjectionTransformation
ViewingTransformation
ViewingTransformation
3D Geometric Primitives
Image
ClippingClipping
ScanConversion
ScanConversion
Transform into 3D world coordinate system
Draw pixels (includes texturing, hidden surface, ...)
Clip primitives outside camera’s view
Transform into 2D screen coordinate system
Transform into 3D camera coordinate systemDone with modeling transformation
Illuminate according to lighting and reflectanceApply texture maps
![Page 13: Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)](https://reader031.vdocuments.net/reader031/viewer/2022032310/56649d895503460f94a6f32d/html5/thumbnails/13.jpg)
13
Camera Coordinates
Camera right vectormaps to X axis
Camera up vector maps to Y axis
Camera back vectormaps to Z axis(pointing out of screen)
Canonical coordinate system Convention is right-handed (looking down -z axis) Convenient for projection, clipping, etc.
x
y
z
![Page 14: Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)](https://reader031.vdocuments.net/reader031/viewer/2022032310/56649d895503460f94a6f32d/html5/thumbnails/14.jpg)
14
Viewing Transformation
Mapping from world to camera coordinates Eye position maps to origin Right vector maps to X axis Up vector maps to Y axis Back vector maps to Z axis
x
y
z
World
rightup
back
Camera
View plane
![Page 15: Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)](https://reader031.vdocuments.net/reader031/viewer/2022032310/56649d895503460f94a6f32d/html5/thumbnails/15.jpg)
15
Viewing Transformations
ModelingTransformation
ModelingTransformation
ViewingTransformation
ViewingTransformation
2D Image Coordinates
ProjectionTransformation
ProjectionTransformation
Window-to-ViewportTransformation
Window-to-ViewportTransformation
3D Object Coordinates
3D World Coordinates
3D Camera Coordinates
2D Screen Coordinates
p(x,y,z)
p’(x’,y’)
Viewing Transformations
![Page 16: Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)](https://reader031.vdocuments.net/reader031/viewer/2022032310/56649d895503460f94a6f32d/html5/thumbnails/16.jpg)
16
Projection
General definition: Transform points in n-space to m-space (m<n)
In computer graphics: Map 3D camera coordinates to 2D screen coordinates
For perspective transformations, no two “rays” are parallel to each other
![Page 17: Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)](https://reader031.vdocuments.net/reader031/viewer/2022032310/56649d895503460f94a6f32d/html5/thumbnails/17.jpg)
17
Taxonomy of Projections
FVFHP Figure 6.10
![Page 18: Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)](https://reader031.vdocuments.net/reader031/viewer/2022032310/56649d895503460f94a6f32d/html5/thumbnails/18.jpg)
18
Parallel Projection
Angel Figure 5.4
Center of projection is at infinity Direction of projection (DOP) same for all points
DOP
ViewPlane
![Page 19: Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)](https://reader031.vdocuments.net/reader031/viewer/2022032310/56649d895503460f94a6f32d/html5/thumbnails/19.jpg)
19
Orthographic Projections
Angel Figure 5.5Top Side
Front
DOP perpendicular to view plane
![Page 20: Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)](https://reader031.vdocuments.net/reader031/viewer/2022032310/56649d895503460f94a6f32d/html5/thumbnails/20.jpg)
20
Oblique Projections
H&B Figure 12.24
DOP not perpendicular to view plane
Cavalier
(DOP = 45o)
Cabinet
(DOP = 63.4o)
45 45
![Page 21: Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)](https://reader031.vdocuments.net/reader031/viewer/2022032310/56649d895503460f94a6f32d/html5/thumbnails/21.jpg)
21
Parallel Projection View Volume
H&B Figure 12.30
![Page 22: Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)](https://reader031.vdocuments.net/reader031/viewer/2022032310/56649d895503460f94a6f32d/html5/thumbnails/22.jpg)
22
Parallel Projection Matrix
General parallel projection transformation:
11000
0000
0sin10
0cos01
1
1
c
c
c
s
s
s
s
z
y
x
L
L
w
z
y
x
11000
0000
0sin10
0cos01
1
1
c
c
c
s
s
s
s
z
y
x
L
L
w
z
y
x
![Page 23: Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)](https://reader031.vdocuments.net/reader031/viewer/2022032310/56649d895503460f94a6f32d/html5/thumbnails/23.jpg)
23
Taxonomy of Projections
FVFHP Figure 6.10
![Page 24: Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)](https://reader031.vdocuments.net/reader031/viewer/2022032310/56649d895503460f94a6f32d/html5/thumbnails/24.jpg)
24
Perspective Projection
Map points onto “view plane” along “projectors” emanating from “center of projection” (COP)
Angel Figure 5.9
Center ofProjection
View Plane
Proje
ctor
s
![Page 25: Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)](https://reader031.vdocuments.net/reader031/viewer/2022032310/56649d895503460f94a6f32d/html5/thumbnails/25.jpg)
25
How many vanishing points?
The difference is how many of the three principle directions are parallel/orthogonal to the projection plane
Perspective Projection
Angel Figure 5.10
3-PointPerspective
2-PointPerspective
1-PointPerspective
![Page 26: Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)](https://reader031.vdocuments.net/reader031/viewer/2022032310/56649d895503460f94a6f32d/html5/thumbnails/26.jpg)
26
Perspective Projection View Volume
H&B Figure 12.30
ViewPlane
![Page 27: Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)](https://reader031.vdocuments.net/reader031/viewer/2022032310/56649d895503460f94a6f32d/html5/thumbnails/27.jpg)
27
Camera to Screen
Remember: Object Camera Screen Just like raytracer
“screen” is the z=d plane for some constant d Origin of screen coordinates is (0,0,d) Its x and y axes are parallel to the x and y axes of
the eye coordinate system All these coordinates are in camera space now
![Page 28: Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)](https://reader031.vdocuments.net/reader031/viewer/2022032310/56649d895503460f94a6f32d/html5/thumbnails/28.jpg)
28
Overhead View of Our Screen
Yeah, similar triangles!
z
dxx
d
x
z
x
z
dyy
d
y
z
y
, ,x y d , ,x y z
d
0,0,0
![Page 29: Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)](https://reader031.vdocuments.net/reader031/viewer/2022032310/56649d895503460f94a6f32d/html5/thumbnails/29.jpg)
29
The Perspective Matrix
This “division by z” can be accomplished by a 4x4 matrix too!
What happens to the point (x,y,z,1)?
What point is this in non-homogeneous coordinates?
0100
0100
0010
0001
d
P
dzzyx ,,,
dzdyzdx ,,
![Page 30: Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)](https://reader031.vdocuments.net/reader031/viewer/2022032310/56649d895503460f94a6f32d/html5/thumbnails/30.jpg)
30
Taxonomy of Projections
FVFHP Figure 6.10
![Page 31: Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)](https://reader031.vdocuments.net/reader031/viewer/2022032310/56649d895503460f94a6f32d/html5/thumbnails/31.jpg)
31
Perspective projection+ Size varies inversely with distance - looks realistic– Distance and angles are not (in general) preserved– Parallel lines do not (in general) remain parallel
Parallel projection+ Good for exact measurements+ Parallel lines remain parallel– Angles are not (in general) preserved– Less realistic looking
Perspective vs. Parallel
![Page 32: Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)](https://reader031.vdocuments.net/reader031/viewer/2022032310/56649d895503460f94a6f32d/html5/thumbnails/32.jpg)
32
Classical Projections
Angel Figure 5.3
![Page 33: Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)](https://reader031.vdocuments.net/reader031/viewer/2022032310/56649d895503460f94a6f32d/html5/thumbnails/33.jpg)
33
Viewing in OpenGL
OpenGL has multiple matrix stacks – trans-formation functions right-multiply the top of the stack
Two most important stacks: GL_MODELVIEW and GL_PROJECTION
Points get multiplied by the modelview matrix first, and then the projection matrix
GL_MODELVIEW: Object->Camera GL_PROJECTION: Camera->Screen glViewport(0,0,w,h): Screen->Device
![Page 34: Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)](https://reader031.vdocuments.net/reader031/viewer/2022032310/56649d895503460f94a6f32d/html5/thumbnails/34.jpg)
34
Summary
Camera transformation Map 3D world coordinates to 3D camera coordinates Matrix has camera vectors as columns
Projection transformation Map 3D camera coordinates to 2D screen coordinates Two types of projections:
Parallel Perspective