Docsity

3D Graphics Pipeline: Modeling, Illumination, Viewing, Clipping, Projection, Rasterization, Slides of Computer Science

Partial preview of the text

Download 3D Graphics Pipeline: Modeling, Illumination, Viewing, Clipping, Projection, Rasterization and more Slides Computer Science in PDF only on Docsity!

Rasterization

Final projects • Rest of semester

– Weekly meetings with TAs – Office hours on appointment

• This week, with TAs

– Refine timeline – Define high-level architecture

• Project should be a whole, but subparts should be

identified with regular merging of code

Modeling Transformations

• 3D models defined in their own

coordinate system (object space)

• Modeling transforms orient the

models within a commoncoordinate frame (world space)

Modeling

Transformations

Illumination

(Shading)

Viewing Transformation (Perspective / Orthographic)

Clipping Projection

(to Screen Space)^ Scan Conversion

(Rasterization) Visibility / Display

Object space

World space

Illumination (Shading) (Lighting)

• Vertices lit (shaded) according to

material properties, surfaceproperties (normal) and light sources

• Local lighting model

(Diffuse, Ambient, Phong, etc.)

Modeling

Transformations

Illumination

(Shading)

Viewing Transformation (Perspective / Orthographic)

Clipping Projection

(to Screen Space)^ Scan Conversion

(Rasterization) Visibility / Display

Clipping

Modeling

Transformations

Illumination

(Shading)

Viewing Transformation (Perspective / Orthographic)

Clipping Projection

(to Screen Space)^ Scan Conversion

(Rasterization) Visibility / Display

Transform to Normalized Device Coordinates (NDC)

Portions of the object outside the view volume (view frustum)^ are removed

NEAR

EYE

FAR

y

z

z

x

y

x

o

Seth Teller

Image adapted from:

EYE SPACE

NDC

Docsity.com

Projection

The objects are projected to the 2Dimage place (screen space)

Modeling

Transformations

Illumination

(Shading)

Viewing Transformation (Perspective / Orthographic)

Clipping Projection

(to Screen Space)^ Scan Conversion

(Rasterization) Visibility / Display

y

y

x

x z

z

o

NDC

SCREEN SPACE Seth Teller

Image adapted from:

Visibility / Display

• Each pixel remembers the

closest object (depth buffer)

• Almost every step in the

graphics pipeline involves achange of coordinate system.Transformations are central tounderstanding 3D computergraphics.

Modeling

Transformations

Illumination

(Shading)

Viewing Transformation (Perspective / Orthographic)

Clipping Projection

(to Screen Space)^ Scan Conversion

(Rasterization) Visibility / Display

Today • Polygon scan conversion

– smart – back to brute force

• Visibility

2D Scan Conversion • Solution: compute discrete approximation • Scan Conversion:

algorithms for efficient generation of the samples comprising this approximation

Brute force solution for triangles •?

Brute force solution for triangles • For each pixel

– Compute line equations at pixel center – “clip” against the triangle

Problem? If the triangle is small, a lot of useless computation

Brute force solution for triangles • Improvement:

– Compute only for the screen

bounding box

of the

triangle

– How do we get such a bounding box?

Can we do better? Kind of! • We compute the line equation for many useless

pixels

• What could we do?

Use line rasterization • Compute the boundary pixels

Shirley page 55