3D Rendering and Ray Casting

Size: px
Start display at page:

Download "3D Rendering and Ray Casting"

Transcription

1 3D Rendering and Ray Casting Michael Kazhdan ( /657) HB Ch. 13.7, 14.6 FvDFH 15.5, 15.10

2 Rendering Generate an image from geometric primitives Rendering Geometric Primitives (3D) Raster Image (2D)

3 3D Rendering Example What issues must be addressed by a 3D rendering system?

4 Overview 3D scene representation 3D viewer representation What do we see? How does it look?

5 Overview 3D scene representation 3D viewer representation What do we see? How does it look? How is the 3D scene described in a computer?

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

7 3D Point Specifies a location Origin

8 3D Point Specifies a location Represented by three coordinates Infinitely small struct Point3D { float x, y, z; }; (x, y, z) Origin

9 3D Vector Specifies a direction and a magnitude

10 3D Vector Specifies a direction and a magnitude Represented by three coordinates Magnitude v = dx 2 + dy 2 + dz 2 Has no location struct Vector3D { float dx, dy, dz; }; v = (dx, dy, dz)

11 3D Vector Specifies a direction and a magnitude Represented by three coordinates Magnitude v = dx 2 + dy 2 + dz 2 Has no location Dot product of two 3D vectors v 1, v 2 = dx 1 dx 2 + dy 1 dy 2 + dz 1 dz 2 v 1, v 2 = v 1 v 2 cos θ Cross product of two 3D vectors v 1 v 2 = Vector normal to plane v 1, v 2 v 1 v 2 = v 1 v 2 sin θ θ v 1 = (dx 1, dy 1, dz 1 ) v 2 = (dx 2, dy 2, dz 2 )

12 Cross Product: Review Let v 1 = v 2 v 3 : dx 1 = dy 2 dz 3 dz 2 dy 3 dy 1 = dz 2 dx 3 dx 2 dz 3 dz 1 = dx 2 dy 3 dy 2 dx 3 v w = w v (remember right-hand rule) We can show: v w = v w sin θ n, where n is unit vector normal to v and w v v = 0

13 3D Line Segment Linear path between two points Origin

14 3D Line Segment Use a linear combination of two points Parametric representation:» p t = p 1 + t (p 2 p 1 ), (0 t 1) p 2 struct Segment3D { Point3D p1, p2; }; p 1 Origin

15 3D Ray Line segment with one endpoint at infinity Parametric representation:» p t = p 1 + t v, (0 t < ) struct Ray3D { Point3D p1; Vector3D v; }; p 1 v Origin

16 3D Line Line segment with both endpoints at infinity Parametric representation:» p t = p 1 + t v, ( < t < ) struct Line3D { Point3D p1; Vector3D v; }; p 1 v Origin

17 3D Plane A linear combination of three points p 2 p 3 p 1 Origin

18 3D Plane A linear combination of three points Implicit representation:» Φ p = ax + by + cz d = 0» Φ p = p, n d = 0, or struct Plane3D { Vector3D n; float d; }; p 2 n is the plane normal» (May be) unit-length vector» Perpendicular to plane d is the signed (weighted) distance of the plane from the origin. p 1 n = (a, b, c) d p 3 Origin

19 3D Polygon Area inside a sequence of coplanar points Triangle Quadrilateral Convex Star-shaped Concave Self-intersecting struct Polygon3D { Point3D *points; int npoints; }; Points are in counter-clockwise order Holes (use > 1 polygon struct)

20 3D Sphere All points at distance r from center point c = (c x, c y, c z ) Implicit representation:» Φ p = p c 2 r 2 = 0 Parametric representation:» x φ, θ = r cos φ sin θ + c x» y φ, θ = r cos φ sin θ + c y» z θ, φ = r sin φ + c z c r struct Sphere3D { Point3D center; float radius; }; Origin

21 Other 3D primitives Cone Cylinder Ellipsoid Box Etc.

22 3D Geometric Primitives More detail on 3D modeling later in course Point Line segment Polygon Polyhedron Curved surface Solid object etc.

23 Overview 3D scene representation 3D viewer representation What do we see? How does it look? How is the viewing device described in a computer?

24 Camera Models The most common model is pin-hole camera All captured light rays arrive along paths toward focal point without lens distortion (everything is in focus) View plane Other models consider... Depth of field Motion blur Lens distortion Eye position (focal point)

25 Camera Parameters What are the parameters of a camera?

26 Camera Parameters Position Eye position: Point3D eye Orientation View direction: Vector3D view Up direction: Vector3D up Aperture Field of view: float xfov, yfov Film plane (View plane normal) back right Up direction Eye Position View Plane Look at Point

27 Other Models: Depth of Field Close Focused Distance Focused P. Haeberli

28 Other Models: Motion Blur Mimics effect of open camera shutter Gives perceptual effect of high-speed motion Generally involves temporal super-sampling Brostow & Essa

29 Traditional Pinhole Camera The film sits behind the pinhole of the camera. Rays come in from the outside, pass through the pinhole, and hit the film plane. Film Plane Pinhole

30 Traditional Pinhole Camera The film sits behind the pinhole of the camera. Rays come in from the outside, pass through the pinhole, and hit the film plane. Photograph is upside down Film Plane Pinhole

31 Virtual Camera The film sits in front of the pinhole of the camera. Rays come in from the outside, pass through the film plane, and hit the pinhole. Pinhole Film Plane

32 Virtual Camera The film sits in front of the pinhole of the camera. Rays come in from the outside, pass through the film plane, and hit the pinhole. Photograph is right side up Pinhole Film Plane

33 Overview 3D scene representation 3D viewer representation Ray Casting Where are we looking? What do we see? How does it look?

34 Ray Casting For each sample Where: Construct ray from eye through view plane What: Find first surface intersected by ray through pixel How: Compute color sample based on surface radiance

35 Ray Casting Simple implementation: Image RayCast(Camera camera, Scene scene, int width, int height) { Image image = new Image(width, height); for( int i=0 ; i<width ; i++ ) for( int j=0 ; j<height ; j++ ) { Ray ray = ConstructRayThroughPixel( camera, i, j ); Intersection hit = FindIntersection( ray, scene ); image[i][j] = GetColor( hit ); } } return image; }

36 Ray Casting Where? Image RayCast(Camera camera, Scene scene, int width, int height) { Image image = new Image(width, height); for( int i=0 ; i<width ; i++ ) for( int j=0 ; j<height ; j++ ) { Ray ray = ConstructRayThroughPixel( camera, i, j ); Intersection hit = FindIntersection( ray, scene ); image[i][j] = GetColor( hit ); } } return image; }

37 Constructing a Ray Through a Pixel Up direction View Plane back p 0 right v p i [j]

38 Constructing a Ray Through a Pixel Up direction View Plane back p 0 right v The ray has to originate at p 0 (the position of the camera). So the equation for the ray is: Ray t = p 0 + t v p i [j]

39 Constructing a Ray Through a Pixel Up direction View Plane back p 0 right v If the ray passes through the point p i [j], then the solution for v is: v = p i [j] p 0 p i [j] p 0 p i [j]

40 Constructing a Ray Through a Pixel Up direction View Plane back p 0 right v p i [j] If p i [j] represents the (i, j)-th pixel of the image, what is its position?

41 Constructing Ray Through a Pixel 2D Example: Side view of camera at p 0 Where is the i-th pixel, p[i]? (i [0, height)) θ = frustum half-angle (given), or field of view d = distance to view plane (arbitrary = you pick) up p 0 θ towards d

42 Constructing Ray Through a Pixel 2D Example: Side view of camera at p 0 Where is the i-th pixel, p[i]? (i [0, height)) θ = frustum half-angle (given), or field of view d = distance to view plane (arbitrary = you pick) p 2 p 1 = p 0 + d towards d tan θ up p 2 = p 0 + d towards + d tan θ up p 0 up θ towards d 2 d tan θ p 1

43 Constructing Ray Through a Pixel 2D Example: Side view of camera at p 0 Where is the i-th pixel, p[i]? (i [0, height)) θ = frustum half-angle (given), or field of view d = distance to view plane (arbitrary = you pick) p 2 p 1 = p 0 + d towards d tan θ up p 2 = p 0 + d towards + d tan θ up p 0 up θ towards d 2 d tan θ p i = p 1 + = p 1 + i height i height p 2 p 1 2 d tan θ up p[i] p 1

44 Constructing Ray Through a Pixel 2D Example: The ray passing through the i-th pixel is defined by: Ray t = p 0 + t v p 0 : camera position v: direction to the i-th pixel: v = p i p 0 p i p 0 p 0 θ p[i]: i-th pixel location: i p i = p 1 + p height 2 p 1 p 1 and p 2 are the endpoints of the view plane: p 1 = p 0 + d towards d tan θ up p 2 = p 0 + d towards + d tan θ up up towards d p[i] p 2 p 1 2 d tan θ

45 Constructing Ray Through a Pixel Figuring out how to do this in 3D is assignment 2 p 2 p 0 up θ towards d 2 d tan θ p[i] p 1

46 Ray Casting Where? Image RayCast(Camera camera, Scene scene, int width, int height) { Image image = new Image(width, height); for( int i=0 ; i<width ; i++ ) for( int j=0 ; j<height ; j++ ) { Ray ray = ConstructRayThroughPixel( camera, i, j ); Intersection hit = FindIntersection( ray, scene ); image[i][j] = GetColor( hit ); } } return image; }

47 Ray Casting What? Image RayCast(Camera camera, Scene scene, int width, int height) { Image image = new Image(width, height); for( int i=0 ; i<width ; i++ ) for( int j=0 ; j<height ; j++ ) { Ray ray = ConstructRayThroughPixel( camera, i, j ); Intersection hit = FindIntersection( ray, scene ); image[i][j] = GetColor( hit ); } } return image; }

48 Ray-Scene Intersection Intersections with geometric primitives Sphere Triangle

49 Ray-Sphere Intersection Ray: p t = p 0 + t v, (0 t < ) Sphere: Φ p = p c 2 r 2 = 0 p p p 0 v r c

50 Ray-Sphere Intersection Ray: p t = p 0 + t v, (0 t < ) Sphere: Φ p = p c 2 r 2 = 0 Substituting for p(t), we get: Φ t = p 0 t v c 2 r 2 = 0 p 0 v p r c p

51 Ray-Sphere Intersection Ray: p t = p 0 + t v, (0 t < ) Sphere: Φ p = p c 2 r 2 = 0 Substituting for p(t), we get: Φ t = p 0 t v c 2 r 2 = 0 Solve quadratic equation: a t 2 + b t + c = 0 where: a = 1 b = 2 v, p 0 c c = p 0 c 2 r 2 p 0 v p r c p

52 Ray-Sphere Intersection Ray: p t = p 0 + t v, (0 t < ) Sphere: Φ p = p c 2 r 2 = 0 Substituting for p(t), we get: Φ t = p 0 t v c 2 r 2 = 0 Solve quadratic equation: a t 2 + b t + c = 0 where: a = 1 b = 2 v, p 0 c p 0 v Generally, there are two solutions to the c = quadratic p 0 c 2 equation, r 2 giving rise to points p and p. Want to return the first positive hit. p r c p

53 Ray-Sphere Intersection Need normal vector at intersection for lighting calculations: p c n = p c n p 0 v p r c

54 Ray-Scene Intersection Intersections with geometric primitives Sphere» Triangle

55 Ray-Triangle Intersection First, intersect ray with plane Then, check if point is inside triangle p v p 0

56 Ray-Plane Intersection Ray: p t = p 0 + t v, (0 t < ) Plane: Φ p = p, n d = 0 Substituting for P, we get: Φ t = p 0 + t v, n d = 0 Algebraic Method Solution: t = p 0, n d v, n v p n p 0

57 Ray-Triangle Intersection I Check if point is inside triangle algebraically: Generate triangles by connecting the ray source to each edge Check if the point of intersection is above each of these triangles For each side of triangle v 1 = T 1 p 0 v 2 = T 2 p 0 n 1 = v 2 v 1 if ( p p 0, n 1 < 0 ) return FALSE; v 1 T 1 n 1 v 2 p T 3 T 2 p 0

58 Ray-Triangle Intersection II Check if point is inside triangle parametrically A point p is inside the triangle iff. it can be expressed as the weighted average of the corners: p = α T 1 + β T 2 + γ T 3 where: 0 α, β, γ 1 α + β + γ = 1 α T 1 p γ T 3 β T2

59 Ray-Triangle Intersection II Check if point is inside triangle parametrically Solve for α, β, γ such that: p = α T 1 + β T 2 + γ T 3 And α + β + γ = 1 γ T 3 Check if the point is in the triangle: 0 α, β, γ 1 T 1 α p β v T2 p 0

3D Rendering and Ray Casting

3D Rendering and Ray Casting 3D Rendering and Ray Casting Michael Kazhdan (601.457/657) HB Ch. 13.7, 14.6 FvDFH 15.5, 15.10 Rendering Generate an image from geometric primitives Rendering Geometric Primitives (3D) Raster Image (2D)

More information

3D Rendering. Course Syllabus. Where Are We Now? Rendering. 3D Rendering Example. Overview. Rendering. I. Image processing II. Rendering III.

3D Rendering. Course Syllabus. Where Are We Now? Rendering. 3D Rendering Example. Overview. Rendering. I. Image processing II. Rendering III. Course Syllabus I. Image processing II. Rendering III. Modeling 3D Rendering Rendering I. Animation (Michael Bostock, CS426, Fall99) Image Processing Adam Finkelstein Princeton University COS 426, Spring

More information

Rendering. Generate an image from geometric primitives II. Rendering III. Modeling IV. Animation. (Michael Bostock, CS426, Fall99)

Rendering. Generate an image from geometric primitives II. Rendering III. Modeling IV. Animation. (Michael Bostock, CS426, Fall99) 1 Course Syllabus 2 I. Image processing 3D Adam Finkelstein Princeton University C0S 426, Fall 2001 II. III. Modeling IV. Animation Image Processing (Rusty Coleman, CS426, Fall99) (Michael Bostock, CS426,

More information

Ray Casting. Connelly Barnes CS 4810: Graphics

Ray Casting. Connelly Barnes CS 4810: Graphics Ray Casting Connelly Barnes CS 4810: Graphics Acknowledgment: slides by Jason Lawrence, Misha Kazhdan, Allison Klein, Tom Funkhouser, Adam Finkelstein and David Dobkin Traditional Pinhole Camera The film

More information

Ray-Tracing. Misha Kazhdan

Ray-Tracing. Misha Kazhdan Ray-Tracing Misha Kazhdan Ray-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Goal: Ray-Tracing Take a collection of triangles representing a 3D scene and render

More information

קורס גרפיקה ממוחשבת 2010/2009 סמסטר א' Rendering 1 חלק מהשקפים מעובדים משקפים של פרדו דוראנד, טומס פנקהאוסר ודניאל כהן-אור

קורס גרפיקה ממוחשבת 2010/2009 סמסטר א' Rendering 1 חלק מהשקפים מעובדים משקפים של פרדו דוראנד, טומס פנקהאוסר ודניאל כהן-אור קורס גרפיקה ממוחשבת 2010/2009 סמסטר א' Rendering 1 חלק מהשקפים מעובדים משקפים של פרדו דוראנד, טומס פנקהאוסר ודניאל כהן-אור What is 3D rendering? Construct an image from a 3D model מצלמה תאורה View Plane

More information

Modeling Transformations

Modeling Transformations Modeling Transformations Michael Kazhdan (601.457/657) HB Ch. 5 FvDFH Ch. 5 Announcement Assignment 2 has been posted: Due: 10/24 ASAP: Download the code and make sure it compiles» On windows: just build

More information

Illumination. Michael Kazhdan ( /657) HB Ch. 14.1, 14.2 FvDFH 16.1, 16.2

Illumination. Michael Kazhdan ( /657) HB Ch. 14.1, 14.2 FvDFH 16.1, 16.2 Illumination Michael Kazhdan (601.457/657) HB Ch. 14.1, 14.2 FvDFH 16.1, 16.2 Ray Casting Image RayCast(Camera camera, Scene scene, int width, int height) { Image image = new Image(width, height); for

More information

Modeling Transformations

Modeling Transformations Modeling Transformations Michael Kazhdan (601.457/657) HB Ch. 5 FvDFH Ch. 5 Overview Ra-Tracing so far Modeling transformations Ra Tracing Image RaTrace(Camera camera, Scene scene, int width, int heigh,

More information

Indirect Illumination

Indirect Illumination Indirect Illumination Michael Kazhdan (601.457/657) HB Ch. 14.1, 14.2 FvDFH 16.1, 16.2 Surface Illumination Calculation Multiple light source: 2 Viewer N 1 V I = I E + K A I A + K D N, + K S V, R n I Overview

More information

Ray Tracing Part 1. CSC418/2504 Introduction to Computer Graphics. TA: Muhammed Anwar & Kevin Gibson

Ray Tracing Part 1. CSC418/2504 Introduction to Computer Graphics. TA: Muhammed Anwar & Kevin Gibson Ray Tracing Part 1 CSC418/2504 Introduction to Computer Graphics TA: Muhammed Anwar & Kevin Gibson Email: manwar@cs.toronto.edu Overview Introduction / Motivation Rasterization vs Ray Tracing Basic Pseudocode

More information

Indirect Illumination

Indirect Illumination Indirect Illumination Michael Kazhdan (601.457/657) HB Ch. 14.1, 14.2 FvDFH 16.1, 16.2 Announcements Midterm on October 17 th Office hours: Misha: Monday 2-3 Malone 229 Sing Chun: Friday 9-10 Malone 216

More information

Geometric Queries for Ray Tracing

Geometric Queries for Ray Tracing CSCI 420 Computer Graphics Lecture 16 Geometric Queries for Ray Tracing Ray-Surface Intersection Barycentric Coordinates [Angel Ch. 11] Jernej Barbic University of Southern California 1 Ray-Surface Intersections

More information

Ray Tracing I. History

Ray Tracing I. History History Ray Tracing came from the Physics of lens making. The process was that of drawing lines or rays through a glass shape to determine it s lens properties. It is also related to early perspective

More information

Ray Tracing I. Internet Raytracing Competition

Ray Tracing I. Internet Raytracing Competition History Ray Tracing came from the Physics of lens making. The process was that of drawing lines or rays through a glass shape to determine it s lens properties. It is also related to early perspective

More information

Ray tracing. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 3/19/07 1

Ray tracing. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 3/19/07 1 Ray tracing Computer Graphics COMP 770 (236) Spring 2007 Instructor: Brandon Lloyd 3/19/07 1 From last time Hidden surface removal Painter s algorithm Clipping algorithms Area subdivision BSP trees Z-Buffer

More information

Supplement to Lecture 16

Supplement to Lecture 16 Supplement to Lecture 16 Global Illumination: View Dependent CS 354 Computer Graphics http://www.cs.utexas.edu/~bajaj/ Notes and figures from Ed Angel: Interactive Computer Graphics, 6 th Ed., 2012 Addison

More information

Ray casting. Ray casting/ray tracing

Ray casting. Ray casting/ray tracing Ray casting Ray casting/ray tracing Iterate over pixels, not objects Effects that are difficult with Z-buffer, are easy with ray tracing: shadows, reflections, transparency, procedural textures and objects

More information

Ray Tracing. CS334 Fall Daniel G. Aliaga Department of Computer Science Purdue University

Ray Tracing. CS334 Fall Daniel G. Aliaga Department of Computer Science Purdue University Ray Tracing CS334 Fall 2013 Daniel G. Aliaga Department of Computer Science Purdue University Ray Casting and Ray Tracing Ray Casting Arthur Appel, started around 1968 Ray Tracing Turner Whitted, started

More information

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

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

More information

COMP 175 COMPUTER GRAPHICS. Ray Casting. COMP 175: Computer Graphics April 26, Erik Anderson 09 Ray Casting

COMP 175 COMPUTER GRAPHICS. Ray Casting. COMP 175: Computer Graphics April 26, Erik Anderson 09 Ray Casting Ray Casting COMP 175: Computer Graphics April 26, 2018 1/41 Admin } Assignment 4 posted } Picking new partners today for rest of the assignments } Demo in the works } Mac demo may require a new dylib I

More information

Polygonal Meshes. 3D Object Representations. 3D Object Representations. 3D Polygonal Mesh. 3D Polygonal Mesh. Geometry background

Polygonal Meshes. 3D Object Representations. 3D Object Representations. 3D Polygonal Mesh. 3D Polygonal Mesh. Geometry background 3D Object Representations Polygonal Meshes Adam Finkelstein & Tim Weyrich Princeton University C0S 426, Spring 2008 Points o Range image o Point cloud Surfaces o Polygonal mesh o Subdivision o Parametric

More information

Raycasting. Chapter Raycasting foundations. When you look at an object, like the ball in the picture to the left, what do

Raycasting. Chapter Raycasting foundations. When you look at an object, like the ball in the picture to the left, what do Chapter 4 Raycasting 4. Raycasting foundations When you look at an, like the ball in the picture to the left, what do lamp you see? You do not actually see the ball itself. Instead, what you see is the

More information

Last Time? Ray Casting. Administrivia: Lab & Office Hours. Notes on Assignments. Ray Casting. Overview of Today

Last Time? Ray Casting. Administrivia: Lab & Office Hours. Notes on Assignments. Ray Casting. Overview of Today Ray Casting Last Time? Luxo Jr. Applications of Computer Graphics Overview of the semester IFS Assignment 0 due tomorrow @ 11:59pm Questions? 1 2 Notes on Assignments Make sure you turn in a linux or windows

More information

Chapter 23. Geometrical Optics (lecture 1: mirrors) Dr. Armen Kocharian

Chapter 23. Geometrical Optics (lecture 1: mirrors) Dr. Armen Kocharian Chapter 23 Geometrical Optics (lecture 1: mirrors) Dr. Armen Kocharian Reflection and Refraction at a Plane Surface The light radiate from a point object in all directions The light reflected from a plane

More information

1999, Denis Zorin. Ray tracing

1999, Denis Zorin. Ray tracing Ray tracing Ray tracing shadow rays normal reflected ray pixel ray camera normal Ray casting/ray tracing Iterate over pixels, not objects. Effects that are difficult with Z-buffer, are easy with ray tracing:

More information

Ray Casting. 3D Rendering. Ray Casting. Ray Casting. Ray Casting. Ray Casting

Ray Casting. 3D Rendering. Ray Casting. Ray Casting. Ray Casting. Ray Casting Rendering Ray asting The color of each pixel on the view plane depends on the radiance emanating from visible surfaces dam inkelstein rinceton University OS 6, Spring 00 Simplest method is ray casting

More information

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

Computer Graphics. Si Lu. Fall uter_graphics.htm 11/22/2017 Computer Graphics Si Lu Fall 2017 http://web.cecs.pdx.edu/~lusi/cs447/cs447_547_comp uter_graphics.htm 11/22/2017 Last time o Splines 2 Today o Raytracing o Final Exam: 14:00-15:30, Novermber 29, 2017

More information

8.1 Geometric Queries for Ray Tracing

8.1 Geometric Queries for Ray Tracing Fall 2017 CSCI 420: Computer Graphics 8.1 Geometric Queries for Ray Tracing Hao Li http://cs420.hao-li.com 1 Outline Ray-Surface Intersections Special cases: sphere, polygon Barycentric coordinates 2 Outline

More information

Ray Tracer I: Ray Casting Due date: 12:00pm December 3, 2001

Ray Tracer I: Ray Casting Due date: 12:00pm December 3, 2001 Computer graphics Assignment 5 1 Overview Ray Tracer I: Ray Casting Due date: 12:00pm December 3, 2001 In this assignment you will implement the camera and several primitive objects for a ray tracer. We

More information

Ray Tracing. Foley & Van Dam, Chapters 15 and 16

Ray Tracing. Foley & Van Dam, Chapters 15 and 16 Ray Tracing Foley & Van Dam, Chapters 15 and 16 Ray Tracing Visible Surface Ray Tracing (Ray Casting) Examples Efficiency Issues Computing Boolean Set Operations Recursive Ray Tracing Determine visibility

More information

Ray Tracing Foley & Van Dam, Chapters 15 and 16

Ray Tracing Foley & Van Dam, Chapters 15 and 16 Foley & Van Dam, Chapters 15 and 16 (Ray Casting) Examples Efficiency Issues Computing Boolean Set Operations Recursive Determine visibility of a surface by tracing rays of light from the viewer s eye

More information

INFOGR Computer Graphics. Jacco Bikker - April-July Lecture 3: Ray Tracing (Introduction) Welcome!

INFOGR Computer Graphics. Jacco Bikker - April-July Lecture 3: Ray Tracing (Introduction) Welcome! INFOGR Computer Graphics Jacco Bikker - April-July 2016 - Lecture 3: Ray Tracing (Introduction) Welcome! Today s Agenda: Primitives (contd.) Ray Tracing Intersections Assignment 2 Textures INFOGR Lecture

More information

Three Main Themes of Computer Graphics

Three Main Themes of Computer Graphics Three Main Themes of Computer Graphics Modeling How do we represent (or model) 3-D objects? How do we construct models for specific objects? Animation How do we represent the motion of objects? How do

More information

Lecture 11: Ray tracing (cont.)

Lecture 11: Ray tracing (cont.) Interactive Computer Graphics Ray tracing - Summary Lecture 11: Ray tracing (cont.) Graphics Lecture 10: Slide 1 Some slides adopted from H. Pfister, Harvard Graphics Lecture 10: Slide 2 Ray tracing -

More information

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

Introduction Ray tracing basics Advanced topics (shading) Advanced topics (geometry) Graphics 2010/2011, 4th quarter. Lecture 11: Ray tracing Lecture 11 Ray tracing Introduction Projection vs. ray tracing Projection Ray tracing Rendering Projection vs. ray tracing Projection Ray tracing Basic methods for image generation Major areas of computer

More information

Intersecting Simple Surfaces. Dr. Scott Schaefer

Intersecting Simple Surfaces. Dr. Scott Schaefer Intersecting Simple Surfaces Dr. Scott Schaefer 1 Types of Surfaces Infinite Planes Polygons Convex Ray Shooting Winding Number Spheres Cylinders 2/66 Infinite Planes Defined by a unit normal n and a point

More information

Topics and things to know about them:

Topics and things to know about them: Practice Final CMSC 427 Distributed Tuesday, December 11, 2007 Review Session, Monday, December 17, 5:00pm, 4424 AV Williams Final: 10:30 AM Wednesday, December 19, 2007 General Guidelines: The final will

More information

Illumination. Courtesy of Adam Finkelstein, Princeton University

Illumination. Courtesy of Adam Finkelstein, Princeton University llumination Courtesy of Adam Finkelstein, Princeton University Ray Casting mage RayCast(Camera camera, Scene scene, int width, int height) { mage image = new mage(width, height); for (int i = 0; i < width;

More information

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

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane Rendering Pipeline Rendering Converting a 3D scene to a 2D image Rendering Light Camera 3D Model View Plane Rendering Converting a 3D scene to a 2D image Basic rendering tasks: Modeling: creating the world

More information

Viewing and Ray Tracing. CS 4620 Lecture 4

Viewing and Ray Tracing. CS 4620 Lecture 4 Viewing and Ray Tracing CS 4620 Lecture 4 2014 Steve Marschner 1 Projection To render an image of a 3D scene, we project it onto a plane Most common projection type is perspective projection 2014 Steve

More information

Ray Tracing. Last Time? Reading for Today. Reading for Today

Ray Tracing. Last Time? Reading for Today. Reading for Today Last Time? Ray Tracing Keyframing Procedural Animation Physically-Based Animation Forward and Inverse Kinematics Motion Capture Two solutions Reading for Today Artist-Directed Dynamics for 2D Animation,

More information

Viewing and Ray Tracing

Viewing and Ray Tracing Viewing and Ray Tracing CS 4620 Lecture 4 2018 Steve Marschner 1 Projection To render an image of a 3D scene, we project it onto a plane Most common projection type is perspective projection 2018 Steve

More information

From Vertices To Fragments-1

From Vertices To Fragments-1 From Vertices To Fragments-1 1 Objectives Clipping Line-segment clipping polygon clipping 2 Overview At end of the geometric pipeline, vertices have been assembled into primitives Must clip out primitives

More information

Motivation. Sampling and Reconstruction of Visual Appearance. Effects needed for Realism. Ray Tracing. Outline

Motivation. Sampling and Reconstruction of Visual Appearance. Effects needed for Realism. Ray Tracing. Outline Sampling and Reconstruction of Visual Appearance CSE 274 [Fall 2018], Special Lecture Ray Tracing Ravi Ramamoorthi http://www.cs.ucsd.edu/~ravir Motivation Ray Tracing is a core aspect of both offline

More information

Questions??? Announcements Assignment 3 due today

Questions??? Announcements Assignment 3 due today Announcements Assignment 3 due today Questions??? Remember that you have late days (if you haven t used them yet ) Problem set 3 out at the end of the day Movie for Assignment 2 at the end of class 1 Ray

More information

ECE-161C Cameras. Nuno Vasconcelos ECE Department, UCSD

ECE-161C Cameras. Nuno Vasconcelos ECE Department, UCSD ECE-161C Cameras Nuno Vasconcelos ECE Department, UCSD Image formation all image understanding starts with understanding of image formation: projection of a scene from 3D world into image on 2D plane 2

More information

Temporal Resolution. Flicker fusion threshold The frequency at which an intermittent light stimulus appears to be completely steady to the observer

Temporal Resolution. Flicker fusion threshold The frequency at which an intermittent light stimulus appears to be completely steady to the observer Temporal Resolution Flicker fusion threshold The frequency at which an intermittent light stimulus appears to be completely steady to the observer For the purposes of presenting moving images (animations),

More information

Models and Architectures

Models and Architectures Models and Architectures Objectives Learn the basic design of a graphics system Introduce graphics pipeline architecture Examine software components for an interactive graphics system 1 Image Formation

More information

CS 563 Advanced Topics in Computer Graphics Lecture 2: Bare-Bones Raytracer. by Emmanuel Agu

CS 563 Advanced Topics in Computer Graphics Lecture 2: Bare-Bones Raytracer. by Emmanuel Agu CS 563 Advanced Topics in Computer Graphics Lecture 2: Bare-Bones Raytracer by Emmanuel Agu Ray Casting (Appel, 1968) direct illumination Recursive ray tracing (Whitted, 1980) Pseudocode for Ray Tracer

More information

Computer Science 426 Midterm 3/11/04, 1:30PM-2:50PM

Computer Science 426 Midterm 3/11/04, 1:30PM-2:50PM NAME: Login name: Computer Science 46 Midterm 3//4, :3PM-:5PM This test is 5 questions, of equal weight. Do all of your work on these pages (use the back for scratch space), giving the answer in the space

More information

Surfaces. Ron Goldman Department of Computer Science Rice University

Surfaces. Ron Goldman Department of Computer Science Rice University Surfaces Ron Goldman Department of Computer Science Rice University Representations 1. Parametric Plane, Sphere, Tensor Product x = f (s,t) y = g(s,t) z = h(s,t) 2. Algebraic Plane, Sphere, Torus F(x,

More information

CS 563 Advanced Topics in Computer Graphics. by Emmanuel Agu

CS 563 Advanced Topics in Computer Graphics. by Emmanuel Agu CS 563 Advanced Topics in Computer Graphics by Emmanuel Agu Parsing: uses lex and yacc: core/pbrtlex.l and core/pbrtparse.y After parsing, a scene object is created (core/scene.*) Rendering: Scene::Render()

More information

Effects needed for Realism. Ray Tracing. Ray Tracing: History. Outline. Foundations of Computer Graphics (Spring 2012)

Effects needed for Realism. Ray Tracing. Ray Tracing: History. Outline. Foundations of Computer Graphics (Spring 2012) Foundations of omputer Graphics (Spring 202) S 84, Lecture 5: Ray Tracing http://inst.eecs.berkeley.edu/~cs84 Effects needed for Realism (Soft) Shadows Reflections (Mirrors and Glossy) Transparency (Water,

More information

Ray Tracing I: Basics

Ray Tracing I: Basics Ray Tracing I: Basics Today Basic algorithms Overview of pbrt Ray-surface intersection Next lecture Techniques to accelerate ray tracing of large numbers of geometric primitives Light Rays Three ideas

More information

EECS 487, Fall 2005 Exam 2

EECS 487, Fall 2005 Exam 2 EECS 487, Fall 2005 Exam 2 December 21, 2005 This is a closed book exam. Notes are not permitted. Basic calculators are permitted, but not needed. Explain or show your work for each question. Name: uniqname:

More information

The University of Calgary

The University of Calgary The University of Calgary Department of Computer Science Final Examination, Questions ENEL/CPSC 555 Computer Graphics Time: 2 Hours Closed Book, calculators are permitted. The questions carry equal weight.

More information

Implicit Surfaces & Solid Representations COS 426

Implicit Surfaces & Solid Representations COS 426 Implicit Surfaces & Solid Representations COS 426 3D Object Representations Desirable properties of an object representation Easy to acquire Accurate Concise Intuitive editing Efficient editing Efficient

More information

Ray Tracing. Outline. Ray Tracing: History

Ray Tracing. Outline. Ray Tracing: History Foundations of omputer Graphics Online Lecture 9: Ray Tracing 1 History and asic Ray asting Ravi Ramamoorthi Effects needed for Realism (Soft) Shadows Reflections (Mirrors and Glossy) Transparency (Water,

More information

So far, we have considered only local models of illumination; they only account for incident light coming directly from the light sources.

So far, we have considered only local models of illumination; they only account for incident light coming directly from the light sources. 11 11.1 Basics So far, we have considered only local models of illumination; they only account for incident light coming directly from the light sources. Global models include incident light that arrives

More information

FROM VERTICES TO FRAGMENTS. Lecture 5 Comp3080 Computer Graphics HKBU

FROM VERTICES TO FRAGMENTS. Lecture 5 Comp3080 Computer Graphics HKBU FROM VERTICES TO FRAGMENTS Lecture 5 Comp3080 Computer Graphics HKBU OBJECTIVES Introduce basic implementation strategies Clipping Scan conversion OCTOBER 9, 2011 2 OVERVIEW At end of the geometric pipeline,

More information

The Law of Reflection

The Law of Reflection If the surface off which the light is reflected is smooth, then the light undergoes specular reflection (parallel rays will all be reflected in the same directions). If, on the other hand, the surface

More information

Homework #2. Shading, Projections, Texture Mapping, Ray Tracing, and Bezier Curves

Homework #2. Shading, Projections, Texture Mapping, Ray Tracing, and Bezier Curves Computer Graphics Instructor: Brian Curless CSEP 557 Autumn 2016 Homework #2 Shading, Projections, Texture Mapping, Ray Tracing, and Bezier Curves Assigned: Wednesday, Nov 16 th Due: Wednesday, Nov 30

More information

Projective Geometry and Camera Models

Projective Geometry and Camera Models /2/ Projective Geometry and Camera Models Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem Note about HW Out before next Tues Prob: covered today, Tues Prob2: covered next Thurs Prob3:

More information

COMP30019 Graphics and Interaction Perspective & Polygonal Geometry

COMP30019 Graphics and Interaction Perspective & Polygonal Geometry COMP30019 Graphics and Interaction Perspective & Polygonal Geometry Department of Computing and Information Systems The Lecture outline Introduction Perspective Geometry Virtual camera Centre of projection

More information

Intro to Modeling Modeling in 3D

Intro to Modeling Modeling in 3D Intro to Modeling Modeling in 3D Polygon sets can approximate more complex shapes as discretized surfaces 2 1 2 3 Curve surfaces in 3D Sphere, ellipsoids, etc Curved Surfaces Modeling in 3D ) ( 2 2 2 2

More information

Rendering. What is 3D rendering? קורס גרפיקה ממוחשבת 2008 סמסטר ב' מצלמה תאורה. Rendering Scenarios. Rendering Scenarios. 3D Rendering Issues

Rendering. What is 3D rendering? קורס גרפיקה ממוחשבת 2008 סמסטר ב' מצלמה תאורה. Rendering Scenarios. Rendering Scenarios. 3D Rendering Issues What is rendering? onstruct an image from a model קורס גרפיקה ממוחשבת 008 סמסטר ב' מצלמה תאורה iew lane Rendering Rendering מודל חלק מהשקפים מעובדים משקפים של פרדו דוראנד, טומס פנקהאוסר ודניאל כהן-אור

More information

Part Images Formed by Flat Mirrors. This Chapter. Phys. 281B Geometric Optics. Chapter 2 : Image Formation. Chapter 2: Image Formation

Part Images Formed by Flat Mirrors. This Chapter. Phys. 281B Geometric Optics. Chapter 2 : Image Formation. Chapter 2: Image Formation Phys. 281B Geometric Optics This Chapter 3 Physics Department Yarmouk University 21163 Irbid Jordan 1- Images Formed by Flat Mirrors 2- Images Formed by Spherical Mirrors 3- Images Formed by Refraction

More information

TEAMS National Competition Middle School Version Photometry Solution Manual 25 Questions

TEAMS National Competition Middle School Version Photometry Solution Manual 25 Questions TEAMS National Competition Middle School Version Photometry Solution Manual 25 Questions Page 1 of 14 Photometry Questions 1. When an upright object is placed between the focal point of a lens and a converging

More information

Scanline Rendering 1 1/42

Scanline Rendering 1 1/42 Scanline Rendering 1 1/42 Scanline Renderer Think of it as setting up a virtual environment/world that mimics the real world but cheats a bit for efficiency, using what we know about light and our eye

More information

CS770/870 Spring 2017 Ray Tracing Implementation

CS770/870 Spring 2017 Ray Tracing Implementation Useful ector Information S770/870 Spring 07 Ray Tracing Implementation Related material:angel 6e: h.3 Ray-Object intersections Spheres Plane/Polygon Box/Slab/Polyhedron Quadric surfaces Other implicit/explicit

More information

Answer Key: Three-Dimensional Cross Sections

Answer Key: Three-Dimensional Cross Sections Geometry A Unit Answer Key: Three-Dimensional Cross Sections Name Date Objectives In this lesson, you will: visualize three-dimensional objects from different perspectives be able to create a projection

More information

Sung-Eui Yoon ( 윤성의 )

Sung-Eui Yoon ( 윤성의 ) CS380: Computer Graphics Ray Tracing Sung-Eui Yoon ( 윤성의 ) Course URL: http://sglab.kaist.ac.kr/~sungeui/cg/ Class Objectives Understand overall algorithm of recursive ray tracing Ray generations Intersection

More information

Homework #1. Displays, Alpha Compositing, Image Processing, Affine Transformations, Hierarchical Modeling

Homework #1. Displays, Alpha Compositing, Image Processing, Affine Transformations, Hierarchical Modeling Computer Graphics Instructor: Brian Curless CSE 457 Spring 2014 Homework #1 Displays, Alpha Compositing, Image Processing, Affine Transformations, Hierarchical Modeling Assigned: Saturday, April th Due:

More information

Ray Tracing. Shandong University

Ray Tracing. Shandong University Ray Tracing Shandong University Introduction OpenGL is based on a pipeline model in which primitives are rendered one at time - No shadows (except by tricks or multiple renderings) - No multiple reflections

More information

High-Dimensional Computational Geometry. Jingbo Shang University of Illinois at Urbana-Champaign Mar 5, 2018

High-Dimensional Computational Geometry. Jingbo Shang University of Illinois at Urbana-Champaign Mar 5, 2018 High-Dimensional Computational Geometry Jingbo Shang University of Illinois at Urbana-Champaign Mar 5, 2018 Outline 3-D vector geometry High-D hyperplane intersections Convex hull & its extension to 3

More information

Moore Catholic High School Math Department

Moore Catholic High School Math Department Moore Catholic High School Math Department Geometry Vocabulary The following is a list of terms and properties which are necessary for success in a Geometry class. You will be tested on these terms during

More information

Computer Graphics Ray Casting. Matthias Teschner

Computer Graphics Ray Casting. Matthias Teschner Computer Graphics Ray Casting Matthias Teschner Outline Context Implicit surfaces Parametric surfaces Combined objects Triangles Axis-aligned boxes Iso-surfaces in grids Summary University of Freiburg

More information

2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into

2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into 2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into the viewport of the current application window. A pixel

More information

Ray Casting. COS 426, Spring 2015 Princeton University

Ray Casting. COS 426, Spring 2015 Princeton University Ray Casting COS 426, Spring 2015 Princeton University Ray Casting The color of each pixel on the view plane depends on the radiance emanating along rays from visible surfaces in scene Light Surfaces Camera

More information

Introduction to Computer Graphics with WebGL

Introduction to Computer Graphics with WebGL Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science Laboratory University of New Mexico Models and Architectures

More information

Illumination Models III: Ray Tracing (View Dependent Global Illumination)

Illumination Models III: Ray Tracing (View Dependent Global Illumination) Illumination Models III: Ray Tracing (View Dependent Global Illumination) The University of Texas at Austin 1 Basic Definitions Ray Tracing/Casting: Setting: eyepoint, virtual screen (an array of virtual

More information

Solution Notes. COMP 151: Terms Test

Solution Notes. COMP 151: Terms Test Family Name:.............................. Other Names:............................. ID Number:............................... Signature.................................. Solution Notes COMP 151: Terms

More information

Computer Graphics and Image Processing Ray Tracing I

Computer Graphics and Image Processing Ray Tracing I Computer Graphics and Image Processing Ray Tracing I Part 1 Lecture 9 1 Today s Outline Introduction to Ray Tracing Ray Casting Intersecting Rays with Primitives Intersecting Rays with Transformed Primitives

More information

Ray Casting. Outline. Similar to glulookat derivation. Foundations of Computer Graphics

Ray Casting. Outline. Similar to glulookat derivation. Foundations of Computer Graphics Foundations of omputer Graphics Online Lecture 10: Ray Tracing 2 Nuts and olts amera Ray asting Outline amera Ray asting (choose ray directions) Ravi Ramamoorthi Outline in ode Image Raytrace (amera cam,

More information

Ray scene intersections

Ray scene intersections Ray scene intersections 1996-2018 Josef Pelikán CGG MFF UK Praha pepca@cgg.mff.cuni.cz http://cgg.mff.cuni.cz/~pepca/ Intersection 2018 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 1 / 26 Ray scene intersection

More information

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. Calculus III-Final review Name MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. Find the corresponding position vector. 1) Define the points P = (-,

More information

CS452/552; EE465/505. Geometry Transformations

CS452/552; EE465/505. Geometry Transformations CS452/552; EE465/505 Geometry Transformations 1-26-15 Outline! Geometry: scalars, points & vectors! Transformations Read: Angel, Chapter 4 (study cube.html/cube.js example) Appendix B: Spaces (vector,

More information

9. Three Dimensional Object Representations

9. Three Dimensional Object Representations 9. Three Dimensional Object Representations Methods: Polygon and Quadric surfaces: For simple Euclidean objects Spline surfaces and construction: For curved surfaces Procedural methods: Eg. Fractals, Particle

More information

Models and The Viewing Pipeline. Jian Huang CS456

Models and The Viewing Pipeline. Jian Huang CS456 Models and The Viewing Pipeline Jian Huang CS456 Vertex coordinates list, polygon table and (maybe) edge table Auxiliary: Per vertex normal Neighborhood information, arranged with regard to vertices and

More information

Lecture 11. More Ray Casting/Tracing

Lecture 11. More Ray Casting/Tracing Lecture 11 More Ray Casting/Tracing Basic Algorithm For each pixel { } Shoot a ray from camera to pixel for all objects in scene Compute intersection with ray Find object with closest intersection Display

More information

CPSC GLOBAL ILLUMINATION

CPSC GLOBAL ILLUMINATION CPSC 314 21 GLOBAL ILLUMINATION Textbook: 20 UGRAD.CS.UBC.CA/~CS314 Mikhail Bessmeltsev ILLUMINATION MODELS/ALGORITHMS Local illumination - Fast Ignore real physics, approximate the look Interaction of

More information

Today. Acceleration Data Structures for Ray Tracing. Cool results from Assignment 2. Last Week: Questions? Schedule

Today. Acceleration Data Structures for Ray Tracing. Cool results from Assignment 2. Last Week: Questions? Schedule Today Acceleration Data Structures for Ray Tracing Cool results from Assignment 2 Last Week: koi seantek Ray Tracing Shadows Reflection Refraction Local Illumination Bidirectional Reflectance Distribution

More information

Input Nodes. Surface Input. Surface Input Nodal Motion Nodal Displacement Instance Generator Light Flocking

Input Nodes. Surface Input. Surface Input Nodal Motion Nodal Displacement Instance Generator Light Flocking Input Nodes Surface Input Nodal Motion Nodal Displacement Instance Generator Light Flocking The different Input nodes, where they can be found, what their outputs are. Surface Input When editing a surface,

More information

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

Models and Architectures. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico Models and Architectures Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico 1 Objectives Learn the basic design of a graphics system Introduce

More information

Overview. Pipeline implementation I. Overview. Required Tasks. Preliminaries Clipping. Hidden Surface removal

Overview. Pipeline implementation I. Overview. Required Tasks. Preliminaries Clipping. Hidden Surface removal Overview Pipeline implementation I Preliminaries Clipping Line clipping Hidden Surface removal Overview At end of the geometric pipeline, vertices have been assembled into primitives Must clip out primitives

More information

C O M P U T E R G R A P H I C S. Computer Graphics. Three-Dimensional Graphics I. Guoying Zhao 1 / 52

C O M P U T E R G R A P H I C S. Computer Graphics. Three-Dimensional Graphics I. Guoying Zhao 1 / 52 Computer Graphics Three-Dimensional Graphics I Guoying Zhao 1 / 52 Geometry Guoying Zhao 2 / 52 Objectives Introduce the elements of geometry Scalars Vectors Points Develop mathematical operations among

More information

Algebra Based Physics

Algebra Based Physics Slide 1 / 66 Slide 2 / 66 Algebra Based Physics Geometric Optics 2015-12-01 www.njctl.org Table of ontents Slide 3 / 66 lick on the topic to go to that section Reflection Spherical Mirror Refraction and

More information

Precalculus 2 Section 10.6 Parametric Equations

Precalculus 2 Section 10.6 Parametric Equations Precalculus 2 Section 10.6 Parametric Equations Parametric Equations Write parametric equations. Graph parametric equations. Determine an equivalent rectangular equation for parametric equations. Determine

More information

Texture. Texture Mapping. Texture Mapping. CS 475 / CS 675 Computer Graphics. Lecture 11 : Texture

Texture. Texture Mapping. Texture Mapping. CS 475 / CS 675 Computer Graphics. Lecture 11 : Texture Texture CS 475 / CS 675 Computer Graphics Add surface detail Paste a photograph over a surface to provide detail. Texture can change surface colour or modulate surface colour. Lecture 11 : Texture http://en.wikipedia.org/wiki/uv_mapping

More information