Graphics Pipeline Rendering approaches 1. object-oriented 3D - - PowerPoint PPT Presentation

graphics pipeline rendering approaches
SMART_READER_LITE
LIVE PREVIEW

Graphics Pipeline Rendering approaches 1. object-oriented 3D - - PowerPoint PPT Presentation

Graphics Pipeline Rendering approaches 1. object-oriented 3D rendering vertices image pipeline foreach object ... 2. image-oriented foreach pixel ... Z-buffer Rendering Z-buffering is very common approach, also often accelerated with


slide-1
SLIDE 1

Graphics Pipeline

slide-2
SLIDE 2

Rendering approaches

1.object-oriented

foreach object ...

2.image-oriented

foreach pixel ... vertices image 3D rendering pipeline

slide-3
SLIDE 3

3

Z-buffer Rendering

  • Z-buffering is very common approach,

also often accelerated with hardware

  • OpenGL is based on this approach

3D Polygons Image Pixels GRAPHICS PIPELINE

slide-4
SLIDE 4

Pipelining operations

* +

b a c An arithmetic pipeline that computes c+(a*b)

slide-5
SLIDE 5

3D graphics pipeline

Vertex processor Clipper and primitive assembler Rasterizer Fragment processor Vertices Pixels

Geometry: objects - made of primitives - made of vertices Vertex processing: coordinate transformations and color Clipping and primitive assembly: output is a set of primitives Rasterization: output is a set of fragments for each primitive Fragment processing: update pixels in the frame bufger

slide-6
SLIDE 6

3D graphics pipeline

  • optimized for drawing 3D triangles with shared

vertices

  • map 3D vertex locations to 2D screen locations
  • shade triangles and draw them in back to front order

using a z-buffer

  • speed depends on # of triangles
  • most operations on vertices can be represented using a

4D coordinate space - 3D position + homogeneous coordinate for perspective viewing

  • 4x4 matrices and 4-vectors
slide-7
SLIDE 7

Primitives and Attributes

slide-8
SLIDE 8

Choice of primitives

  • Which primitives should an API contain?
  • small set - supported by hardware, or
  • lots of primitives - convenient for user
slide-9
SLIDE 9

Choice of primitives

  • Which primitives should an API contain?

➡small set - supported by hardware

  • lots of primitives - convenient for user
slide-10
SLIDE 10

Choice of primitives

  • Which primitives should an API contain?

➡small set - supported by hardware

  • lots of primitives - convenient for user

GPUs are optimized for points, lines, and triangles

slide-11
SLIDE 11

Choice of primitives

  • Which primitives should an API contain?

➡small set - supported by hardware

  • lots of primitives - convenient for user

GPUs are optimized for points, lines, and triangles

slide-12
SLIDE 12

Two classes of primitives

Angel and Shreiner

Geometric : points, lines, polygons Image : arrays of pixels

slide-13
SLIDE 13

Point and line segment types

Angel and Shreiner

slide-14
SLIDE 14

Polygons

  • Multi-sided planar element composed of edges and

vertices.

  • Vertices (singular vertex) are represented by points
  • Edges connect vertices as line segments

E1 E3 E2 (x1,y1) (x2,y2) (x3,y3)

slide-15
SLIDE 15

Valid polygons

  • Simple
  • Convex
  • Flat
slide-16
SLIDE 16

Valid polygons

  • Simple
  • Convex
  • Flat
slide-17
SLIDE 17

OpenGL polygons

  • Only triangles are supported (in latest versions)

GL_POINTS GL_TRIANGLES

GL_TRIANGLE_STRIP GL_TRIANGLE_FAN

slide-18
SLIDE 18

Other polygons

triangulation

slide-19
SLIDE 19

Graphics Pipeline

(slides courtesy K. Fatahalian)

slide-20
SLIDE 20

Vertex processing

v0 v1 v2 v3 v4 v5

Vertices

Vertices are transformed into “screen space”

Vertex processor Clipper and primitive assembler Rasterizer Fragment processor Vertices Pixels

slide-21
SLIDE 21

Vertex processing

v0 v1 v2 v3 v4 v5

Vertices

Vertices are transformed into “screen space”

EACH VERTEX IS TRANSFORMED INDEPENDENTLY

Vertex processor Clipper and primitive assembler Rasterizer Fragment processor Vertices Pixels

slide-22
SLIDE 22

Primitive processing

v0 v1 v2 v3 v4 v5

Vertices

v0 v1 v2 v3 v4 v5

Primitives (triangles)

Then organized into primitives that are clipped and culled…

Vertex processor Clipper and primitive assembler Rasterizer Fragment processor Vertices Pixels

slide-23
SLIDE 23

Rasterization

Primitives are rasterized into “pixel fragments”

Fragments

Vertex processor Clipper and primitive assembler Rasterizer Fragment processor Vertices Pixels

slide-24
SLIDE 24

Rasterization

Primitives are rasterized into “pixel fragments”

EACH PRIMITIVE IS RASTERIZED INDEPENDENTLY

Vertex processor Clipper and primitive assembler Rasterizer Fragment processor Vertices Pixels

slide-25
SLIDE 25

Fragment processing

Shaded fragments

Fragments are shaded to compute a color at each pixel

Vertex processor Clipper and primitive assembler Rasterizer Fragment processor Vertices Pixels

slide-26
SLIDE 26

Fragment processing

EACH FRAGMENT IS PROCESSED INDEPENDENTLY

Fragments are shaded to compute a color at each pixel

Vertex processor Clipper and primitive assembler Rasterizer Fragment processor Vertices Pixels

slide-27
SLIDE 27

Pixel operations

Pixels

Fragments are blended into the frame bufger at their pixel locations (z-bufger determines visibility)

Vertex processor Clipper and primitive assembler Rasterizer Fragment processor Vertices Pixels

slide-28
SLIDE 28

Pipeline entities

v0 v1 v2 v3 v4 v5 v0 v1 v2 v3 v4 v5

Vertices Primitives Fragments Pixels Fragments (shaded)

slide-29
SLIDE 29

Graphics pipeline

Primitive Generation Vertex Generation Vertex Processing Fragment Generation Fragment Processing Pixel Operations

Fixed-function Programmable

Memory Bufgers

Vertex Data Bufgers Textures Output image (pixels) Textures Textures

Primitive Processing

Vertex stream Vertex stream Primitive stream Primitive stream Fragment stream Fragment stream

Vertices Primitives Fragments Pixels