Overview: Ray Tracing & The Perspective Projection Pipeline

Similar documents
3D Modeling & Sketchup

Photorealism: Ray Tracing

Models and Architectures

Models and Architectures. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

CHAPTER 1 Graphics Systems and Models 3

Lecture 19: All Together with Refraction

Introduction to Computer Graphics with WebGL

Movie: Geri s Game. Announcements. Ray Casting 2. Programming 2 Recap. Programming 3 Info Test data for part 1 (Lines) is available

Computer Graphics I Lecture 11

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

Lecturer Athanasios Nikolaidis

Introduction Ray tracing basics Advanced topics (shading) Advanced topics (geometry) Graphics 2010/2011, 4th quarter. Lecture 11: Ray tracing

Turn on the Lights: Reflectance

Computer Graphics. Lecture 13. Global Illumination 1: Ray Tracing and Radiosity. Taku Komura

Ray Tracing Basics I. Computer Graphics as Virtual Photography. camera (captures light) real scene. photo. Photographic print. Photography: processing

CS354 Computer Graphics Ray Tracing. Qixing Huang Januray 24th 2017

Chapter 7 - Light, Materials, Appearance

Computer Graphics 1. Chapter 7 (June 17th, 2010, 2-4pm): Shading and rendering. LMU München Medieninformatik Andreas Butz Computergraphik 1 SS2010

Pipeline Operations. CS 4620 Lecture 10

lecture 18 - ray tracing - environment mapping - refraction

Intro to Ray-Tracing & Ray-Surface Acceleration

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

CS 381 Computer Graphics, Fall 2008 Midterm Exam Solutions. The Midterm Exam was given in class on Thursday, October 23, 2008.

(a) rotating 45 0 about the origin and then translating in the direction of vector I by 4 units and (b) translating and then rotation.

Computer Graphics (CS 543) Lecture 10: Soft Shadows (Maps and Volumes), Normal and Bump Mapping

Interactive Computer Graphics A TOP-DOWN APPROACH WITH SHADER-BASED OPENGL

Recollection. Models Pixels. Model transformation Viewport transformation Clipping Rasterization Texturing + Lights & shadows

COMP environment mapping Mar. 12, r = 2n(n v) v

Lighting. To do. Course Outline. This Lecture. Continue to work on ray programming assignment Start thinking about final project

Computer Graphics. Lecture 10. Global Illumination 1: Ray Tracing and Radiosity. Taku Komura 12/03/15

Computer Graphics: Programming, Problem Solving, and Visual Communication

Level of Details in Computer Rendering

Ray-Tracing. Misha Kazhdan

Computer Graphics. Shadows

CMSC427 Final Practice v2 Fall 2017

CS5620 Intro to Computer Graphics

Consider a partially transparent object that is illuminated with two lights, one visible from each side of the object. Start with a ray from the eye

Today. Rendering algorithms. Rendering algorithms. Images. Images. Rendering Algorithms. Course overview Organization Introduction to ray tracing

Luxo Jr. (Pixar, 1986) Last Time. Real Cameras and Ray Tracing. Standard Rasterization. Lights, Cameras, Surfaces. Now Playing:

Overview. Computer Graphics CS324. OpenGL. Books. Learning Resources. CS131 Notes. 30 Lectures 3hr Exam

Computer Graphics 10 - Shadows

COMP371 COMPUTER GRAPHICS

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

Computer Graphics. Si Lu. Fall uter_graphics.htm 11/22/2017

Computer Graphics. Instructor: Oren Kapah. Office Hours: T.B.A.

Camera Placement for Ray Tracing

Rendering Algorithms: Real-time indirect illumination. Spring 2010 Matthias Zwicker

Rasterization Overview

Computer Graphics Introduction. Taku Komura

Ray Polygon Intersection.

Computer Graphics. Lecture 02 Graphics Pipeline. Edirlei Soares de Lima.

Pipeline Operations. CS 4620 Lecture 14

Global Illumination CS334. Daniel G. Aliaga Department of Computer Science Purdue University

Interpolation using scanline algorithm

Ray Tracing. Kjetil Babington

CMSC427 Advanced shading getting global illumination by local methods. Credit: slides Prof. Zwicker

Computer Graphics. Lecture 14 Bump-mapping, Global Illumination (1)

Topics and things to know about them:

Ray Tracing. CSCI 420 Computer Graphics Lecture 15. Ray Casting Shadow Rays Reflection and Transmission [Ch ]

Problem Set 4 Part 1 CMSC 427 Distributed: Thursday, November 1, 2007 Due: Tuesday, November 20, 2007

Module Contact: Dr Stephen Laycock, CMP Copyright of the University of East Anglia Version 1

Global Rendering. Ingela Nyström 1. Effects needed for realism. The Rendering Equation. Local vs global rendering. Light-material interaction

GLOBAL EDITION. Interactive Computer Graphics. A Top-Down Approach with WebGL SEVENTH EDITION. Edward Angel Dave Shreiner

Survey in Computer Graphics Computer Graphics and Visualization

03 RENDERING PART TWO

lecture 19 Shadows - ray tracing - shadow mapping - ambient occlusion Interreflections

Movie: For The Birds. Announcements. Ray Tracing 1. Programming 2 Recap. Programming 3 Info Test data for part 1 (Lines) is available

Graphics for VEs. Ruth Aylett

Ray Casting of Trimmed NURBS Surfaces on the GPU

Lahore University of Management Sciences. CS 452 Computer Graphics

Computer Graphics. Chapter 1 (Related to Introduction to Computer Graphics Using Java 2D and 3D)

Image Formation. Introduction to Computer Graphics. Machiraju/Zhang/Möller/Klaffenböck

Topic 12: Texture Mapping. Motivation Sources of texture Texture coordinates Bump mapping, mip-mapping & env mapping

Lecture 11: Ray tracing (cont.)

EF432. Introduction to spagetti and meatballs

Reflection and Refraction

CPSC GLOBAL ILLUMINATION

Orthogonal Projection Matrices. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

Graphics and Interaction Rendering pipeline & object modelling

Illumination and Shading

CIS 581 Interactive Computer Graphics

CS230 : Computer Graphics Lecture 4. Tamar Shinar Computer Science & Engineering UC Riverside

Global Illumination. COMP 575/770 Spring 2013

Rendering: Reality. Eye acts as pinhole camera. Photons from light hit objects

CSE328 Fundamentals of Computer Graphics: Concepts, Theory, Algorithms, and Applications

INTRODUCTION. Slides modified from Angel book 6e

RASTERISED RENDERING

Reflection and Refraction

Chapter 4. Chapter 4. Computer Graphics 2006/2007 Chapter 4. Introduction to 3D 1

Topic 11: Texture Mapping 11/13/2017. Texture sources: Solid textures. Texture sources: Synthesized

Introduction to Visualization and Computer Graphics

CS 325 Computer Graphics

COMP30019 Graphics and Interaction Rendering pipeline & object modelling

Lecture outline. COMP30019 Graphics and Interaction Rendering pipeline & object modelling. Introduction to modelling

Mach band effect. The Mach band effect increases the visual unpleasant representation of curved surface using flat shading.

Effects needed for Realism. Computer Graphics (Fall 2008) Ray Tracing. Ray Tracing: History. Outline

Computer Graphics Shadow Algorithms

Lighting and Shading Computer Graphics I Lecture 7. Light Sources Phong Illumination Model Normal Vectors [Angel, Ch

Computer Graphics. Bing-Yu Chen National Taiwan University

Transcription:

Overview: Ray Tracing & The Perspective Projection Pipeline Lecture #2 Thursday, August 28 2014 About this Lecture! This is an overview.! Think of it as a quick tour moving fast.! Some parts, e.g. math, go by quickly.! We will come back and spend more time.! Why a quick tour?! Context is key and comes first! 8/28/14 Ross Beveridge & Bruce A. Draper, 2014 2

Two Approaches to Graphics! Common starting point:! Create a scene model in world coordinates.! Place a synthetic camera in the scene.! Typically made by combining local models.! Approach #1: Projective Pipeline! Move model into camera coordinates.! Project vertices onto the image plane.! Fill in other pixels (fragment processing). 8/28/14 Ross Beveridge & Bruce A. Draper, 2014 3 Approaches (II)! Approach #2: Ray Tracing! Rays project from pixels into the world model.! Rays intersect objects.! Pass back appearance (illumination) to pixels.! More commonalities! Calculate pixel values for images.! Still have to map image onto screen/printer/etc.! Sometimes called the Workstation Transform 8/28/14 Ross Beveridge & Bruce A. Draper, 2014 4

The Projection Pipeline (in more detail, with cartoons) Step #0: The starting point We start with a set of 3D object models. Most models are polygonal. Every model has its own coordinate frame. Step #1: The model transform Puts every object into a single global coordinate system (frame). e.g. place the teapot on the TV set. 8/28/14 Ross Beveridge & Bruce A. Draper, 2014 5 The Projection Pipeline (II) Step #2: The Viewing Transform Converts data from the 3D world coordinate system to a camera-centered (and camera-oriented) 3D coordinate system Note: at this point projection pipeline and ray tracing may start diverging. 8/28/14 Ross Beveridge & Bruce A. Draper, 2014 6

The Projection Pipeline (III) Field of View Step #3: Clipping The step eliminates all vertices (data points) falling outside the field of view of your synthetic camera 8/28/14 Ross Beveridge & Bruce A. Draper, 2014 7 The Projection Pipeline (IV) Step #4: Projection This step projects 3D data points onto a 2D image plane, according to the camera parameters (e.g. focal length) 8/28/14 Ross Beveridge & Bruce A. Draper, 2014 8

The Perspective Pipeline (V) Step #5: Rasterization Play connect the dots (well, vertices) to form line segments and closed polygons (collectively, fragments) 8/28/14 Ross Beveridge & Bruce A. Draper, 2014 9 The Perspective Pipeline (VI) Step #6: Fragment Processing This is where surfaces are shaded and hidden surfaces are removed. 8/28/14 Ross Beveridge & Bruce A. Draper, 2014 10

The Projection Pipeline (VII) Step #7: Workstation Transform Moves the data from the 2D image plane coordinate system to the 2D coordinate system of your display device Note: this is where the projective pipeline and ray tracing come back together. 8/28/14 Ross Beveridge & Bruce A. Draper, 2014 11 Ray Tracing (the alternative) Step #0: The starting point We start with a set of 3D object models. Most models are polygonal. Every model has its own coordinate frame. Step #1: The model transform Puts every object into a single global coordinate system (frame). e.g. place the teapot on the TV set 8/28/14 Ross Beveridge & Bruce A. Draper, 2014 12

Ray Tracing (II) Step #2: 3D Camera model The image plane (representing film or a CCD/ CMOS chip) is a plane located in the 3D world model. This step calculates the 3D position of every pixel on that plane. 8/28/14 Ross Beveridge & Bruce A. Draper, 2014 13 Ray Tracing (III) Step #3: Ray Casting Send a ray through every pixel, intersect rays with objects in the world model. 8/28/14 Ross Beveridge & Bruce A. Draper, 2014 14

Ray Tracing (IV) Step #4: Diffuse Reflection Calculate rays from surface intersection points to light sources; calculate diffuse reflection and shadows. Source: http://morawietz.me/ 8/28/14 Ross Beveridge & Bruce A. Draper, 2014 15 Ray Tracing (V) L S N S R V C θ θ Q Step #5: Specular & Translucent Reflections Calculate rays in the direction of specular and translucent reflections; recursively calculate appearance 8/28/14 Ross Beveridge & Bruce A. Draper, 2014 16

Ray Tracing (VI) ( ( ) + ki l (( 2N ( N L) L) V ) n ) I = KI l N L l l Relax, we will come back to this properly later. Step #6: Sum reflections, store in pixel Add together diffuse, specular and translucent reflections, store resulting (R,G,B) value in pixel 8/28/14 Ross Beveridge & Bruce A. Draper, 2014 17 Ray Tracing (VII) Step #7: Workstation Transform Moves the data from the 2D image plane coordinate system to the 2D coordinate system of your display device Note: at this last step is where the projective pipeline and ray tracing approaches converge 8/28/14 Ross Beveridge & Bruce A. Draper, 2014 18

Projection Pipeline vs Ray Tracing! Projection Pipeline:! Fast (currently real-time)! Current standard (e.g. video games)! SOA: OpenGL 3.0! Ray Tracing:! More realistic (e.g. inter-reflections)! Getting faster (e.g. Pov-Ray)! Future hardware will make it real-time 8/28/14 Ross Beveridge & Bruce A. Draper, 2014 19 Recent Tour-de-Force http://www.youtube.com/watch?v=h5mrrelxy-w 8/28/14 Ross Beveridge & Bruce A. Draper, 2014 20

Course Plan! Objective: Understand image creation! Assignment 1: Cast a ray! Global coordinates emphasis on basics.! Ray intersection calculations.! Assignment 2: Reference frames! Add proper and distinct coordinate systems! and relate them to each other. 8/28/14 Ross Beveridge & Bruce A. Draper, 2014 21 Course Plan (II)! Assignment #3: Better lighting and models! Extend modeling to support complexity! Add multi-bounce lighting! Add richer material properties! Assignment #4: Motion and Transparency! See through objects - refraction! Put things in motion short animations Disclaimer: This is a plan, not a contract, the exact nature of the programming assignments will change. 8/28/14 Ross Beveridge & Bruce A. Draper, 2014 22

A Quick Peak at Modeling Vertices, Polygons and setting up to start geometry in earnest. The Ubiquitous Polygonal Mesh! A surface patch is often a polygon in 3D! 3 or more vertices! Each vertex is an (x, y, z) triple! Vertices are supplied in order! Boundary of polygon goes from vertex #1 to vertex #2 to vertex #N, and back to vertex #1! All vertices must be co-planar! Polygon must be convex 8/28/14 Ross Beveridge & Bruce A. Draper, 2014 24

For Example! A simple (4-vertex) polygon in 3D (0,1,0) (1,1,0) (0,0,0) (1,0,0) 8/28/14 Ross Beveridge & Bruce A. Draper, 2014 Slide 25 Common Mistakes! Order of vertices:! Non co-planar vertices: z x y The polygons above have the same vertices in a different order! The 4th vertex is not in the plane defined by the 1 st three! 8/28/14 Ross Beveridge & Bruce A. Draper, 2014 Slide 26

Surfaces: Connected Polygons! A mesh surface is then just a set of nonoverlapping polygons that share vertices and edges Triangle Strip Quad Mesh http://groups.csail.mit.edu/graphics/classes/6.837/f98/talecture/ 8/28/14 Ross Beveridge & Bruce A. Draper, 2014 Slide 27 Surfaces generally not planar! Although every polygon in the mesh must be.! Patches form a locally linear approximation to a curved surface. Permission to use requested from Daniel Rypl at the Czech Technical University in Prague (8/22/12) 8/28/14 Ross Beveridge & Bruce A. Draper, 2014 28

Meshes as Matrices! A mesh is a set of N 3D vertices! Represented as a 3 N matrix! Each column is a vertex " x 1 x 2 x 3 L x N % $ ' M = $ y 1 y 2 y 3 L y N ' # $ z 1 z 2 z 3 L z N &'! With an index vector to show which vertices belong to which polygon! E.g. ((1,2,3), (2,3,4), ) 8/28/14 Ross Beveridge & Bruce A. Draper, 2014 Slide 29 A Touch of Reality?! How many polygons?! Why make them?! Quote from Wired article:! Animating a Blockbuster: How Pixar Built Toy Story 3 Bobby Podesta, supervising animator of Toy Story 3, has been with Pixar since 1997 and, like most animators, considers himself an actor. My job is to convince you that the stack of polygons on the screen is actually alive, he says. Link to Story: http://www.wired.com/magazine/2010/05/process_pixar/ 8/28/14 Ross Beveridge & Bruce A. Draper, 2014 30