Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)

Slides:



Advertisements
Similar presentations
Computer Graphics - Viewing -
Advertisements

Three Dimensional Viewing
Projection.
Three-Dimensional Viewing Sang Il Park Sejong University Lots of slides are stolen from Jehee Lee’s.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Projections II Week 4,
Viewing and Projections
1 Jinxiang Chai CSCE 441 Computer Graphics. 2 Midterm Time: 10:10pm-11:20pm, 10/20 Location: HRBB 113.
Now Playing: Coulibaly Amadou & Mariam from Dimanche a Bamako Released August 2, 2005.
1 Lecture 8 Clipping Viewing transformations Projections.
Lecture 12: Projection CS4670: Computer Vision Noah Snavely “The School of Athens,” Raphael.
Viewing Transformations
Graphics Systems I-Chen Lin’s CG slides, Doug James’s CG slides Angel, Interactive Computer Graphics, Chap 1 Introduction to Graphics Pipeline.
IT- 601: Computer Graphics Lecture-11 Mathematics of Projection Jesmin Akhter Lecturer,IIT Jahangirnagar University, Savar, Dhaka,Bangladesh.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Models and Architectures Ed Angel Professor of Computer Science, Electrical and Computer.
Projection Projection - the transformation of points from a coordinate system in n dimensions to a coordinate system in m dimensions where m
Computer Graphics (fall 2009)
Transformation & Projection Feng Yu Proseminar Computer Graphics :
MIT EECS 6.837, Durand and Cutler Graphics Pipeline: Projective Transformations.
CS559: Computer Graphics Lecture 9: Projection Li Zhang Spring 2008.
Graphics Graphics Korea University cgvr.korea.ac.kr 3D Viewing 고려대학교 컴퓨터 그래픽스 연구실.
Computer Graphics Bing-Yu Chen National Taiwan University.
CSC 461: Lecture 3 1 CSC461 Lecture 3: Models and Architectures  Objectives –Learn the basic design of a graphics system –Introduce pipeline architecture.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1Computer Graphics Lecture 4 - Models and Architectures John Shearer Culture Lab – space 2
CAP4730: Computational Structures in Computer Graphics 3D Transformations.
Angel: Interactive Computer Graphics CSE 409: Computer Graphics Camera Transformations and Projection Acknowledgements: parts of information and pictures.
CS 325 Introduction to Computer Graphics 02 / 22 / 2010 Instructor: Michael Eckmann.
Image Synthesis Rabie A. Ramadan, PhD 4. 2 Review Questions Q1: What are the two principal tasks required to create an image of a three-dimensional scene?
3D Polygon Rendering Pipeline 원본 – ( Thomas Funkhouser (Princeton.
CS 445 / 645 Introduction to Computer Graphics Lecture 10 Camera Models Lecture 10 Camera Models.
Computer Graphics Lecture 08 Fasih ur Rehman. Last Class Ray Tracing.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Jinxiang Chai CSCE 441 Computer Graphics 3-D Viewing 0.
Chapters 5 2 March Classical & Computer Viewing Same elements –objects –viewer –projectors –projection plane.
Three-Dimensional Viewing
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis.
Rendering Pipeline Fall, D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.
Taxonomy of Projections FVFHP Figure Taxonomy of Projections.
Projections Angel: Interactive Computer Graphics.
CS552: Computer Graphics Lecture 11: Orthographic Projection.
CS559: Computer Graphics Lecture 9: 3D Transformation and Projection Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
CS 376 Introduction to Computer Graphics 02 / 21 / 2007 Instructor: Michael Eckmann.
Viewing and Projection. The topics Interior parameters Projection type Field of view Clipping Frustum… Exterior parameters Camera position Camera orientation.
Chapter 1 Graphics Systems and Models Models and Architectures.
Viewing Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Models and Architectures 靜宜大學 資訊工程系 蔡奇偉 副教授 2012.
Viewing. Classical Viewing Viewing requires three basic elements - One or more objects - A viewer with a projection surface - Projectors that go from.
Computer Graphics Lecture 19 PROJECTIONS I Taqdees A. Siddiqi
Outline 3D Viewing Required readings: HB 10-1 to 10-10
Projection. Conceptual model of 3D viewing process.
Computer Graphics Projections.
PROJECTIONS PROJECTIONS 1. Transform 3D objects on to a 2D plane using projections 2 types of projections Perspective Parallel In parallel projection,
Rendering Pipeline Fall, 2015.
Projection Our 3-D scenes are all specified in 3-D world coordinates
3D Viewing cgvr.korea.ac.kr.
Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics
CSCE 441 Computer Graphics 3-D Viewing
Modeling 101 For the moment assume that all geometry consists of points, lines and faces Line: A segment between two endpoints Face: A planar area bounded.
Models and Architectures
Models and Architectures
Models and Architectures
Introduction to Computer Graphics with WebGL
Three Dimensional Viewing
OpenGL 2D Viewing Pipeline
Computer Graphics (Spring 2003)
3D Graphics.
Models and Architectures
Viewing (Projections)
Models and Architectures
Presentation transcript:

Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)

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

3 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination Quake II (Id Software)

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

5 3D Rendering Pipeline 3D Geometric Primitives Modeling Transformation Modeling Transformation Viewing Transformation Viewing Transformation Projection Transformation Projection Transformation Lighting Image Clipping Scan Conversion Scan Conversion This is a pipelined sequence of operations to draw a 3D primitive into a 2D image (this pipeline applies only for direct illumination)

6 Example: OpenGL Modeling Transformation Modeling Transformation Lighting & Texturing Lighting & Texturing Projection Transformation Projection Transformation Viewing Transformation Viewing Transformation Image Clipping Scan Conversion Scan Conversion 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();

7 3D Rendering Pipeline Modeling Transformation Modeling Transformation Lighting & Texturing Lighting & Texturing Projection Transformation Projection Transformation Viewing Transformation Viewing Transformation 3D Geometric Primitives Image Clipping Scan Conversion Scan Conversion Transform into 3D world coordinate system

8 3D Rendering Pipeline Modeling Transformation Modeling Transformation Lighting & Texturing Lighting & Texturing Projection Transformation Projection Transformation Viewing Transformation Viewing Transformation 3D Geometric Primitives Image Clipping Scan Conversion Scan Conversion Transform into 3D world coordinate system Transform into 3D camera coordinate system Done with modeling transformation

9 3D Rendering Pipeline Modeling Transformation Modeling Transformation Lighting & Texturing Lighting & Texturing Projection Transformation Projection Transformation Viewing Transformation Viewing Transformation 3D Geometric Primitives Image Clipping Scan Conversion Scan Conversion Transform into 3D world coordinate system Transform into 3D camera coordinate system Done with modeling transformation Illuminate according to lighting and reflectance Apply texture maps

10 3D Rendering Pipeline Modeling Transformation Modeling Transformation Lighting & Texturing Lighting & Texturing Projection Transformation Projection Transformation Viewing Transformation Viewing Transformation 3D Geometric Primitives Image Clipping Scan Conversion Scan Conversion Transform into 3D world coordinate system Illuminate according to lighting and reflectance Apply texture maps Transform into 2D screen coordinate system Transform into 3D camera coordinate system Done with modeling transformation

11 3D Rendering Pipeline Modeling Transformation Modeling Transformation Lighting & Texturing Lighting & Texturing Projection Transformation Projection Transformation Viewing Transformation Viewing Transformation 3D Geometric Primitives Image Clipping Scan Conversion Scan Conversion Transform into 3D world coordinate system Clip primitives outside camera’s view Transform into 2D screen coordinate system Transform into 3D camera coordinate system Done with modeling transformation Illuminate according to lighting and reflectance Apply texture maps

12 3D Rendering Pipeline Modeling Transformation Modeling Transformation Lighting & Texturing Lighting & Texturing Projection Transformation Projection Transformation Viewing Transformation Viewing Transformation 3D Geometric Primitives Image Clipping Scan Conversion Scan Conversion 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 system Done with modeling transformation Illuminate according to lighting and reflectance Apply texture maps

13 Camera Coordinates Camera right vector maps to X axis Camera up vector maps to Y axis Camera back vector maps 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

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 right up back Camera View plane

15 Viewing Transformations Modeling Transformation Modeling Transformation Viewing Transformation Viewing Transformation 2D Image Coordinates Projection Transformation Projection Transformation Window-to-Viewport Transformation Window-to-Viewport Transformation 3D Object Coordinates 3D World Coordinates 3D Camera Coordinates 2D Screen Coordinates p(x,y,z) p’(x’,y’) Viewing Transformations

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

17 Taxonomy of Projections FVFHP Figure 6.10

18 Parallel Projection Angel Figure 5.4 Center of projection is at infinity Direction of projection (DOP) same for all points DOP View Plane

19 Orthographic Projections Angel Figure 5.5 TopSide Front DOP perpendicular to view plane

20 Oblique Projections H&B Figure DOP not perpendicular to view plane Cavalier (DOP  = 45 o ) Cabinet (DOP  = 63.4 o )

21 Parallel Projection View Volume H&B Figure 12.30

22 Parallel Projection Matrix General parallel projection transformation:

23 Taxonomy of Projections FVFHP Figure 6.10

24 Perspective Projection Map points onto “view plane” along “projectors” emanating from “center of projection” (COP) Angel Figure 5.9 Center of Projection View Plane Projectors

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 Point Perspective 2-Point Perspective 1-Point Perspective

26 Perspective Projection View Volume H&B Figure View Plane

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

28 Overhead View of Our Screen Yeah, similar triangles!

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?

30 Taxonomy of Projections FVFHP Figure 6.10

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

32 Classical Projections Angel Figure 5.3

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

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