Ray Tracing Foley & Van Dam, Chapters 15 and 16

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

Computer Graphics Ray Casting. Matthias Teschner

Lecture 11. More Ray Casting/Tracing

Ray Tracing III. Wen-Chieh (Steve) Lin National Chiao-Tung University

Ray casting. Ray casting/ray tracing

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

Lecture 11: Ray tracing (cont.)

Ray Tracing I. Internet Raytracing Competition

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

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

Spatial Data Structures

Spatial Data Structures

1999, Denis Zorin. Ray tracing

Spatial Data Structures

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

Computer Graphics (CS 543) Lecture 13b Ray Tracing (Part 1) Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Ray Tracing I. History

Solid Modeling. Thomas Funkhouser Princeton University C0S 426, Fall Represent solid interiors of objects

Computer Graphics and Image Processing Ray Tracing I

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

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

CPSC GLOBAL ILLUMINATION

Intro to Ray-Tracing & Ray-Surface Acceleration

Surface and Solid Geometry. 3D Polygons

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

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

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

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

Chapter 11 Global Illumination. Part 1 Ray Tracing. Reading: Angel s Interactive Computer Graphics (6 th ed.) Sections 11.1, 11.2, 11.

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

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

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

Photorealism: Ray Tracing

Intersecting Simple Surfaces. Dr. Scott Schaefer

Ray Tracing. Outline. Ray Tracing: History

Spatial Data Structures

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

Solid Modeling. Ron Goldman Department of Computer Science Rice University

Spatial Data Structures

Recursive Ray Tracing. Ron Goldman Department of Computer Science Rice University

Topic 11: Texture Mapping 10/21/2015. Photographs. Solid textures. Procedural

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

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

SUMMARY. CS380: Introduction to Computer Graphics Ray tracing Chapter 20. Min H. Kim KAIST School of Computing 18/05/29. Modeling

Announcements. Written Assignment 2 out (due March 8) Computer Graphics

Implicit Surfaces & Solid Representations COS 426

Ray Tracing. Shandong University

Ray Tracing. Cornell CS4620/5620 Fall 2012 Lecture Kavita Bala 1 (with previous instructors James/Marschner)

COMP 175 COMPUTER GRAPHICS. Lecture 11: Recursive Ray Tracer. COMP 175: Computer Graphics April 9, Erik Anderson 11 Recursive Ray Tracer

Last Time: Acceleration Data Structures for Ray Tracing. Schedule. Today. Shadows & Light Sources. Shadows

Ray Tracing: Intersection

these real phenomena because in Computer Graphics we know that we are creating reality.

8. Hidden Surface Elimination

Sung-Eui Yoon ( 윤성의 )

CS348B Lecture 2 Pat Hanrahan, Spring Greeks: Do light rays proceed from the eye to the light, or from the light to the eye?

Last week. Machiraju/Zhang/Möller

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

VIII. Visibility algorithms (II)

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

Computer Graphics. Bing-Yu Chen National Taiwan University The University of Tokyo

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

Questions??? Announcements Assignment 3 due today

Ray Tracer Due date: April 27, 2011

3D Rendering and Ray Casting

3D Rendering and Ray Casting

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

Programming projects. Assignment 1: Basic ray tracer. Assignment 1: Basic ray tracer. Assignment 1: Basic ray tracer. Assignment 1: Basic ray tracer

Photorealism. Photorealism: Ray Tracing. Ray Tracing

The University of Calgary

I have a meeting with Peter Lee and Bob Cosgrove on Wednesday to discuss the future of the cluster. Computer Graphics

Lecture 8 Ray tracing Part 1: Basic concept Yong-Jin Liu.

CS Computer Graphics: Introduction to Ray Tracing

CS Computer Graphics: Introduction to Ray Tracing

Ray tracing. EECS 487 March 19,

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

Ray Genealogy. Raytracing: Performance. Bounding Volumes. Bounding Volume. Acceleration Classification. Acceleration Classification

Acceleration Data Structures

Supplement to Lecture 16

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

Ray Casting. Outline in Code. Outline. Finding Ray Direction. Heckbert s Business Card Ray Tracer. Foundations of Computer Graphics (Fall 2012)

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

Geometric Queries for Ray Tracing

Recursion and Data Structures in Computer Graphics. Ray Tracing

CS559 Computer Graphics Fall 2015

8.1 Geometric Queries for Ray Tracing

Shading, Advanced Rendering. Week 7, Wed Feb 28

Advanced Ray Tracing

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

Lecture 17: Solid Modeling.... a cubit on the one side, and a cubit on the other side Exodus 26:13

Clipping. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

Second degree equations - quadratics. nonparametric: x 2 + y 2 + z 2 = r 2

Ray Casting. To Do. Outline. Outline in Code. Foundations of Computer Graphics (Spring 2012) Heckbert s Business Card Ray Tracer

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

Rendering. Mike Bailey. Rendering.pptx. The Rendering Equation

Photorealism. Ray Tracing Texture Mapping Radiosity

Point Cloud Filtering using Ray Casting by Eric Jensen 2012 The Basic Methodology

COMP371 COMPUTER GRAPHICS

Assignment 6: Ray Tracing

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

Ray Intersection Acceleration

Transcription:

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 to the objects in the scene Image precision algorithm VSRT is sometimes called Ray Casting Simple Ray Tracer: Problem: computing intersections between the ray and the objects Each point (x,y,x) of the ray from (x 0,y 0,z 0 ) to (x 1,y 1,z 1 ) is defined by: x x t x, y y t y, z z t z where: 0 0 0 x x x, y y y, z z z 1 0 1 0 1 0 Simplest case: Intersection with a sphere of center (a,b,c) and radius r ( x a) ( y b) ( z c) r 2 2 2 2

Ray: x x0 t x, y y0 t y, z z0 t z 2 2 2 2 Sphere: ( x a) ( y b) ( z c) r Collecting terms: 2 Quadratic equation in t At Bt C 0 Has zero, one or two real roots t 2A 2 B B 4AC Zero real roots: no intersections One root: ray grazes the sphere Two roots: smallest positive t is the closest At the intersection point, the surface has normal: x a y b z c,, r r r Similar approach with other quadratic surfaces Intersection between a ray and a polygon is harder to find: - Find the intersection between the ray and the polygon s plane; - Check whether the intersection lies within the polygon Similar approach for other quadratic surfaces: Sphere: x2 + y2 + z2 r2 Cylinder: x2 + y2 r2 Cone: x2 + y2 z2 Paraboloid: x2 + y2 z Hyperboloid: x2 + y2 z2 r2 Roots of equations of degree higher than 2 can be found with an iterative method like Newton Intersection between a ray and a polygon is harder to find: - Find the intersection between the ray and the polygon s plane; - Check whether the intersection lies within the polygon

Ray: x x0 t x, y y0 t y, z z0 t z Plane: Ax By Cz D 0 If the denominator is 0, the ray and the plane are parallel Ax0 By0 Cz0 D t A x B y C z If the denominator is 0, the ray and the plane are parallel Testing whether the intersection lies within the polygon is done with an orthographic projection and 2D tests Efficiency considerations: Ray tracing is slow because it intersects every ray with every object To make ray tracing faster we can use coherence: Image coherence - neighboring pixel, same object,... Spatial coherence - neighboring points, same object Problem: - Cartman is composed by 100000 polygons - Ray tracing computes 100000 ray-polygon intersections - Even when the ray misses Cartman Solution: - Place a sphere around Cartman - If ray misses sphere then the ray misses Cartman Efficiency considerations: optimizing intersection calculations by bounding objects with parametrized slabs intersection calculations with bounding volumes hierarchies

intersection calculation with spatial partitioning 3-D array of cells Each cell contains list of all objects it intersects Ray intersected with all objects in a given cell s list Cells visited in Bresenham order intersection calculation with spatial partitioning Must be careful when excluding objects, since an object may intersect in a different voxel than the current one Useful to compute Boolean Set Operations that can be used in Constructive Solid Geometry: - Union - Intersection - Difference Recursive Extends the basic algorithm to handle shadows, reflection and refraction Shadows: fire an additional ray from the intersection to the light source. If this shadow ray intersects any object along the way, then the point is in shadow Reflection and Refraction: secondary reflection and refraction rays are fired at intersections. In turn, these rays may spawn shadow, reflection and refraction rays The rays form a ray tree N: Surface normal L: Shadow ray R: Reflected ray T: Transmitted ray

Recursive Recursive Depth of Field with a camera model Recursive Motion Blur Software Ray tracer: Persistence Of Vision POV-Ray http://www.povray.org/ Wireframe modeller for POV-Ray: MoRay http://www.stmuc.com/moray/