Presentation is loading. Please wait.

Presentation is loading. Please wait.

Rendering Pipeline Fall, 2015.

Similar presentations


Presentation on theme: "Rendering Pipeline Fall, 2015."— Presentation transcript:

1 Rendering Pipeline Fall, 2015

2 Rendering Generate an image from geometric primitives

3 Overview 3D scene representation 3D viewer representation
Visible surface determination Lighting simulation How is the 3D scene described in a computer?

4 3D Scene Representation
Scene is usually approximated by 3D primitives Point Line segment Polygon Polyhedron Curved surface Solid object etc.

5 3D point Specifies a location Represented by three coordinates
Infinitely small

6 3D Vector Specifies a direction and a magnitude
Represented by three coordinates Magnitude Has no location

7 3D Vector Dot(=Scalar) product of two 3D vectors

8 3D Vector Cross(=Vector) product of two 3D vectors (dx2, dy2, dz2)
V1 X V2 = vector perpendicular V1 and V2 (dx2, dy2, dz2) (dx1, dy1, dz1)

9 3D Ray Line segment with one endpoint at infinity
Parametric representation

10 Overview 3D scene representation 3D viewer representation
Visible surface determination Lighting simulation How is the viewing device described in a computer?

11 Camera Models The most common model is pin-hole camera
All captured light ray arrive along paths toward focal point without lens distortion (everything is in focus) Sensor response proportional to radiance Other models consider… Depth of field Motion blur Lens distortion

12 Camera Parameters Position Orientation Aperture Film plane
Eye position (px, py, pz) Orientation View direction (dx, dy, dz) Up direction (vx, vy, vz) Aperture Field of view (xfov, yfov) Film plane “Look at” point View plane normal

13 View Frustum V Back N Right U View Frustum

14 Overview 3D scene representation 3D viewer representation
Visible surface determination Lighting simulation How can the front-most surface be found with an algorithm?

15 Visible Surface Determination
The color of each pixel on the view plane depends on the radiance emanating from visible surfaces Simple method is ray casting

16 Overview 3D scene representation 3D viewer representation
Visible surface determination Lighting simulation How do we compute the radiance for each sample ray?

17 Lighting Simulation Lighting parameters Light source emission
Surface reflection Atmospheric attenuation Camera response

18 Lighting Simulation

19 Summary Major issues in 3D rendering Conclusion note
3D scene representation 3D viewer representation Visible surface determination Lighting simulation Conclusion note Accurate physical simulation is complex and intractable Rendering algorithms apply many approximations to simplify representations and computations

20 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination

21 3D Polygon Rendering What steps are necessary to utilize spatial coherence while drawing these polygons into a 2D image?

22 3D Rendering Pipeline (for direct illumination)
Transform into 3D world coordinate system Illuminate according to lighting and reflection Transform into 3D camera coordinate system Transform into 2D camera coordinate system Clip primitives outside camera’s view Transform into image coordinate system Draw pixels (includes texturing, hidden surface, …)

23 Transformations

24 Viewing Transformations

25 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 Y X World Z

26 Camera Coordinates Canonical coordinate system
Convention is right-handed (looking down –z axis) Convenient for projection, clipping, etc .

27 Finding the viewing transformation
We have the camera (in world coordinates) We want T taking objects from world to camera Trick: find T-1 taking objects in camera to world

28 Finding the viewing transformation
Trick: map from camera coordinate to world Origin maps to eye position Z axis maps to Back vector Y axis maps to Up vector X axis maps to Right vector This matrix is T-1 so we invert in to get T (easy)

29 Viewing Transformations

30 Projection General definition: In computer Graphics:
Transform points in n-space to m-space (m<n) In computer Graphics: Map 3D camera coordinates to 2D screen coordinates

31 Taxonomy of Projections

32 Parallel Projection Center of projections is at infinity
Direction of projection (DOP) same for all points

33 Orthogonal Projections
DOP perpendicular to view plane

34 Oblique Projections DOP not perpendicular to view plane
1) Cavalier projection when angle between projector and view plane is 45 degree foreshortening ratio for all three principal axis are equal. 2) Cabinet projection the foreshortening ratio for edges that perpendicular to the plane of projection is one-half (angle degree ) perpendicular angle Oblique angle

35 Oblique Projections DOP not perpendicular to view plane
φ describes the angle of the projection of the view plane’s normal L represents the scale factor applied to the view plane’s normal

36 Parallel Projection View Volume

37 Parallel Projection Matrix
General parallel projection transformation

38 Perspective Projection
Map points onto “view plane” along “projectors” emanating from “center of projection” (COP)

39 Perspective Projection
How many vanishing points?

40 Perspective Projection View Volume

41 Perspective Projection
Compute 2D coordinates from 3D coordinates with similar triangles

42 Perspective Projection Matrix
4 x 4 matrix representation?

43 Perspective Projection Matrix
4 x 4 matrix representation?

44 Perspective vs. Parallel
Parallel Projection + Good for exact measurements + Parallel lines remain parallel Angles are not (in general) preserved Less realistic looking Perspective Projection + Size varies inversely with distance – looks realistic Distance and angles are not (in general) preserved Parallel line do not (in general) remain parallel

45 Classical Projections

46 Taxonomy of Projections

47 Viewing Transformations Summary
Camera Transformation Map 3D world coordinates to 3D camera coordinates Matrix has camera vectors are rows Projection Transformation Map 3D camera coordinates to 2D screen coordinates Two type of projections Parallel Perspective

48 3D Rendering Pipeline (for direct illumination)

49 2D Rendering Pipeline Clip portions of geometric primitives
residing outside the window Transform the clipped primitives From screen to image coordinates Fill pixels representing primitives In screen coordinates

50 Clipping Avoid drawing parts of primitives outside window
Window defines part of scene being viewed Must draw geometric primitives only inside window

51 Clipping Avoid drawing parts of primitives outside window Points Lines
Polygons Circles etc.

52 Point Clipping Is point (x, y) inside window?

53 Line Clipping Find the part of a line inside the clip window

54 Polygon Clipping Find the part of a polygon inside the clip window?

55 Sutherland Hodgeman Clipping
Clip each window boundary one at a time

56 2D Rendering Pipeline Clip portions of geometric primitives
residing outside the window Transform the clipped primitives From screen to image coordinates Fill pixels representing primitives In screen coordinates

57 Viewport Transformation
Transformation 2D geometric primitives from screen coordinate system (normalized device coordinates) to image coordinate system (pixels)

58 Viewport Transformation
Window-to-Viewport mapping

59 Summary of Transformations

60 Summary

61 Next Time


Download ppt "Rendering Pipeline Fall, 2015."

Similar presentations


Ads by Google