24
CSE 5542 - Real Time Rendering Week 2

CSE 5542 - Real Time Rendering Week 2. Graphics Processing 2

Embed Size (px)

Citation preview

Page 1: CSE 5542 - Real Time Rendering Week 2. Graphics Processing 2

CSE 5542 - Real Time Rendering

Week 2

Page 2: CSE 5542 - Real Time Rendering Week 2. Graphics Processing 2

Graphics Processing

2

Page 3: CSE 5542 - Real Time Rendering Week 2. Graphics Processing 2

Physical Approaches

3

Page 4: CSE 5542 - Real Time Rendering Week 2. Graphics Processing 2

Projection-Based

4

Page 5: CSE 5542 - Real Time Rendering Week 2. Graphics Processing 2

Projection3D objects -> 2D image

– Perspective– Parallel/Orthographic

5

Page 6: CSE 5542 - Real Time Rendering Week 2. Graphics Processing 2

The Hardware

6

Page 7: CSE 5542 - Real Time Rendering Week 2. Graphics Processing 2

More 2 come …

Page 8: CSE 5542 - Real Time Rendering Week 2. Graphics Processing 2

The API/System

8

Page 9: CSE 5542 - Real Time Rendering Week 2. Graphics Processing 2

The Graphics Pipeline

9

Page 10: CSE 5542 - Real Time Rendering Week 2. Graphics Processing 2

Object & Primitive & Vertex

10

http://www.3dcadbrowser.com/download.aspx?3dmodel=27814

Page 11: CSE 5542 - Real Time Rendering Week 2. Graphics Processing 2

Object & Triangles & Vertices

http://www.mathworks.com/matlabcentral/fileexchange/37004-uniform-sampling-of-a-sphere

Page 12: CSE 5542 - Real Time Rendering Week 2. Graphics Processing 2

Primitives

12

Page 13: CSE 5542 - Real Time Rendering Week 2. Graphics Processing 2

Example (old style)

glBegin(GL_POLYGON)glVertex3f(0.0, 0.0, 0.0);glVertex3f(0.0, 1.0, 0.0);glVertex3f(0.0, 0.0, 1.0);

glEnd( );

13

type of object

location of vertex

end of object definition

Page 14: CSE 5542 - Real Time Rendering Week 2. Graphics Processing 2

Example (GPU based)

• Put geometric data in an array

• Send array to GPU• Tell GPU to render as triangle

14

vec3 points[3];points[0] = vec3(0.0, 0.0, 0.0);points[1] = vec3(0.0, 1.0, 0.0);points[2] = vec3(0.0, 0.0, 1.0);

Page 15: CSE 5542 - Real Time Rendering Week 2. Graphics Processing 2

Camera Specification• Six degrees of freedom

– Position of center of lens– Orientation

• Lens• Film size• Orientation of film plane

15

Page 16: CSE 5542 - Real Time Rendering Week 2. Graphics Processing 2

Materials

Optical properties– Absorption: color properties– Scattering

• Diffuse• Specular

16

Page 17: CSE 5542 - Real Time Rendering Week 2. Graphics Processing 2

LightsTypes

– Point sources vs distributed sources– Spot lights– Near and far sources– Color properties

17

Page 18: CSE 5542 - Real Time Rendering Week 2. Graphics Processing 2

Vertex Processing

Polygon Soup

Page 19: CSE 5542 - Real Time Rendering Week 2. Graphics Processing 2

Vertex Processing• Define object representations from one

coordinate system to another– Object coordinates– World Coordinates– Camera (eye) coordinates– Screen coordinates

• Enter Linear algebra – Transformations• Material properties

19

Page 20: CSE 5542 - Real Time Rendering Week 2. Graphics Processing 2

World

Page 21: CSE 5542 - Real Time Rendering Week 2. Graphics Processing 2

Primitive AssemblyVertices collected into geometric objects

– Line segments– Polygons– Curves and surfaces

21

Page 22: CSE 5542 - Real Time Rendering Week 2. Graphics Processing 2

Clipping

Page 23: CSE 5542 - Real Time Rendering Week 2. Graphics Processing 2

Rasterization• Output are fragments• Fragments == potential pixels

– Location in frame buffer– Color and depth attributes– Hidden surface removal ?

• Vertex attributes are interpolated over objects

23

Page 24: CSE 5542 - Real Time Rendering Week 2. Graphics Processing 2

Fragment Processing

24