CSCE 441: Computer Graphics Ray Tracing

Slides:



Advertisements
Similar presentations
GR2 Advanced Computer Graphics AGR
Advertisements

13.1 si31_2001 SI31 Advanced Computer Graphics AGR Lecture 13 An Introduction to Ray Tracing.
Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
Lecture 14 Illumination II – Global Models
Computer Graphics In4/MSc Computer Graphics Lecture Notes #15 Illumination III View Independent Rendering.
3D Graphics Rendering and Terrain Modeling
Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.
Light Issues in Computer Graphics Presented by Saleema Amershi.
ATEC Procedural Animation Introduction to Procedural Methods in 3D Computer Animation Dr. Midori Kitagawa.
1. What is Lighting? 2 Example 1. Find the cubic polynomial or that passes through the four points and satisfies 1.As a photon Metal Insulator.
CS 325 Introduction to Computer Graphics 04 / 09 / 2010 Instructor: Michael Eckmann.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Object-Order vs. Screen-Order Rendering April 24, 2003.
Computer Graphics (Fall 2005) COMS 4160, Lecture 21: Ray Tracing
RAY TRACING.
CSCE 641: Computer Graphics Ray Tracing Jinxiang Chai.
Ray Casting Ray-Surface Intersections Barycentric Coordinates Reflection and Transmission [Shirley, Ch.9] Ray Tracing Handouts Ray Casting Ray-Surface.
Parallelizing Raytracing Gillian Smith CMPE 220 February 19 th, 2008.
Global Illumination May 7, Global Effects translucent surface shadow multiple reflection.
CSCE 641 Computer Graphics: Radiosity Jinxiang Chai.
CSCE 641 Computer Graphics: Radiosity Jinxiang Chai.
CSCE 641: Computer Graphics Ray Tracing Jinxiang Chai.
CSCE 441 Computer Graphics: Radiosity Jinxiang Chai.
Real-Time Ray Tracing 3D Modeling of the Future Marissa Hollingsworth Spring 2009.
Basic Ray Tracing CMSC 435/634. Visibility Problem Rendering: converting a model to an image Visibility: deciding which objects (or parts) will appear.
02/04/03 Page 1 Rendering Visibility Lighting Texturing.
Ray Tracing Primer Ref: SIGGRAPH HyperGraphHyperGraph.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Reflections Specular reflection is the perfect reflection of light from a surface. The law a reflection states that the direction of the incoming ray and.
Ray Tracing Sang Il Park SEjong University With lots of slides stolen from Jehee Lee, Doug James, Steve Seitz, Shree Nayar, Alexei Efros, Fredo Durand.
CS 376 Introduction to Computer Graphics 04 / 16 / 2007 Instructor: Michael Eckmann.
Ray Tracing Chapter CAP4730: Computational Structures in Computer Graphics.
1 Dr. Scott Schaefer Ray Tracing. 2/42 Ray Tracing Provides rendering method with  Refraction/Transparent surfaces  Reflective surfaces  Shadows.
Basic Ray Tracing CMSC 435/634. Visibility Problem Rendering: converting a model to an image Visibility: deciding which objects (or parts) will appear.

Recursion and Data Structures in Computer Graphics Ray Tracing 1.
Ray-tracing.
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
CSCE 441: Computer Graphics Ray Tracing
RENDERING : Global Illumination
Global Illumination (3) Path Tracing. Overview Light Transport Notation Path Tracing Photon Mapping.
David Luebke3/12/2016 Advanced Computer Graphics Lecture 3: More Ray Tracing David Luebke
CSL 859: Advanced Computer Graphics Dept of Computer Sc. & Engg. IIT Delhi.
CS552: Computer Graphics Lecture 36: Ray Tracing.
Introduction to Ray Tracing Dr. B. Raghu Professor /CSE Sri Ramanujar Engineering College.
Basic Ray Tracing CMSC 435/634.

CSE 167 [Win 17], Lecture 15: Ray Tracing Ravi Ramamoorthi
Photorealistic Rendering vs. Interactive 3D Graphics
Shading Revisited Some applications are intended to produce pictures that look photorealistic, or close to it The image should look like a photograph A.
CSCE 441: Computer Graphics Hidden Surface Removal (Cont.)
Ray Tracing Dr. Scott Schaefer.
3D Graphics Rendering PPT By Ricardo Veguilla.
RAY TRACING.
Mike Merchant Nicholas Hilbert
© University of Wisconsin, CS559 Fall 2004
CSCE 441: Computer Graphics Hidden Surface Removal
(c) 2002 University of Wisconsin
Path Tracing (some material from University of Wisconsin)
Lighting.
CSCE 441 Computer Graphics: Radiosity
(c) 2002 University of Wisconsin
CSCE 441: Computer Graphics Hidden Surface Removal (Cont.)
Image synthesis using classical optics
Image.
CSCE 441: Computer Graphics Hidden Surface Removal (Cont.)
CS5500 Computer Graphics May 29, 2006
GR2 Advanced Computer Graphics AGR
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
Introduction to Ray Tracing
Presentation transcript:

CSCE 441: Computer Graphics Ray Tracing Jinxiang Chai

Ray Tracing Provides rendering method with Refraction/Transparent surfaces Reflective surfaces Shadows Image taken from http://www.tjhsst.edu/~dhyatt/superap/samplex.jpg

Any difference for rendering three pixels? Ray Tracing Provides rendering method with Refraction/Transparent surfaces Reflective surfaces Shadows Any difference for rendering three pixels? Image taken from http://www.tjhsst.edu/~dhyatt/superap/samplex.jpg

Local Illumination vs. Ray Tracing

Ray Tracing Results Click here

Overview Ray Tracing Algorithm Shadows, Reflection, Refraction Surface Intersection Infinite planes, spheres, polygons Optimizations Readings: HB 10-11

Essential Information for Ray Tracing Eye point Screen position/orientation Objects Material properties Reflection/Refraction coefficients Index of refraction Light sources

Ray Tracing Assumption The illumination of a point is determined by - illumination/shadow ray (direct lighting from light sources)

Ray Tracing Assumption The illumination of a point is determined by - illumination/shadow ray (direct lighting from light sources)

Ray Tracing Assumption The illumination of a point is determined by - illumination/shadow ray (direct lighting from light sources) - reflection ray (light reflected by an object)

Ray Tracing Assumption The illumination of a point is determined by - illumination/shadow ray (direct lighting from light sources) - reflection ray (light reflected by an object) - transparent ray (light passing through an object)

Ray Tracing Assumption The illumination of a point is determined by - illumination/shadow ray (direct lighting from light sources) - reflection ray (light reflected by an object) - transparent ray (light passing through an object)

Ray Tracing Assumption The illumination of a point is determined by - illumination/shadow ray (direct lighting from light sources) - reflection ray (light reflected by an object) - transparent ray (light passing through an object)

Illumination / Shadow Rays A ray is cast from an object’s surface towards a light. If the light is not occluded, then the light contributes to the object’s surface color. If the light is occluded, then the light does not contribute to the object’s surface color. If ray hits a semi-transparent object, scale the contribution of that light and continue to look for intersections Occluder Pixels

Reflected Rays A ray is cast from the surface of an object based on its material properties. The contribution results in the specular reflection.

Transparency/transmission/refracted Rays Some objects are transparent or translucent. The transmitted light also contributes to the surface color, called specular transmission. The ray can be refracted based on the object’s composition.

Recursive Ray Tracing 3 L1 L2 4 1 2

Recursive Ray Tracing 3 L1 L2 4 1 2

Recursive Ray Tracing 3 L1 L2 4 1 2

Recursive Ray Tracing 3 L1 L2 4 1 2

Recursive Ray Tracing 3 L1 L2 4 1 2

Recursive Ray Tracing 3 L1 L2 4 1 2

Recursive Ray Tracing 3 L1 L2 4 1 2

Recursive Ray Tracing 3 L1 L2 4 1 2

Recursive Ray Tracing 3 L1 L2 4 1 2

What are real light paths? Recursive Ray Tracing 3 L1 L2 4 1 2 What are real light paths?

Recursive Ray Tracing and Light path 3 L1 L2 4 1 2 Ray tracing paths just reverses real light paths!

Recursive Ray Tracing and Light path 3 L1 L2 4 1 2 Ray tracing paths just reverses real light paths!

Recursive Ray Tracing and Light path 3 L1 L2 4 1 2 Ray tracing paths just reverses real light paths!

Recursive Ray Tracing and Light path 3 L1 L2 4 1 2 Ray tracing paths just reverses real light paths!

Recursive Ray Tracing and Light path 3 L1 L2 4 1 2 Ray tracing paths just reverses real light paths!

Recursive Ray Tracing and Light path 3 L1 L2 4 1 2 Ray tracing paths just reverses real light paths!

Ray Tree Eye Shadow of Obj 4 Object 1 L2 Reflection Transmission L1 L1

Recursive Ray Tracing For each pixel Intersect ray from eye through pixel with all objects in scene Find closest (positive) intersection to eye Compute lighting at intersection point Recur for reflected and refracted rays (if necessary)

Recursive Ray Tracing

Termination Criterion 1. The ray intersects no surfaces 2. The ray intersects a light source that is not a reflecting surface 3. The tree has been generated to its maximum allowable depth.

Three Issues Ray-object intersection - hidden surface removal Reflection direction - mirror direction Refraction direction - Snell’s law

Ray-object Intersection screen eye Similar to ray casting!

Ray-object Intersection screen eye Similar to ray casting! But how to determine the intersection point between a ray and an object such as sphere or triangle?

Ray Casting Implementation - Parameterize each ray as - Each object Ok returns tk>0 such that first intersection with ok occurs at r(tk) - Q: given the set {tk}, what is the first intersection point?

Ray-Sphere Intersection

Ray-Triangle Intersection First, intersection ray with plane Then, check if point is in triangle

Ray-Plane Intersection

Ray-Triangle Intersection Check if point is inside triangle algebraically For each side of triangle

Reflection Mirror-like/Shiny objects Surface

Refraction Bending of light caused by different speeds of light in different medium Each (semi-)transparent object has an index of refraction ni Use Snell’s law to find refracted vector Image taken from http://hyperphysics.phy-astr.gsu.edu/hbase/geoopt/refr2.html

Snell’s Law Surface

How to compute Transmission Ray? Surface n2

Snell’s Law Surface

Snell’s Law Surface

Snell’s Law Surface

Snell’s Law Surface

Snell’s Law Surface

Snell’s Law Surface

Snell’s Law Surface

Snell’s Law Surface

Snell’s Law Surface

Snell’s Law Surface

Snell’s Law Surface

Recursive Ray Tracing Recur for reflective/transparent objects

Recursive Ray Tracing Recur for reflective/transparent objects

Optimizations Lots of rays to cast! Ray-Surface intersections are expensive Associate with each object Bounding box in 3-space If ray doesn’t intersect box, then ray doesn’t intersect object

Parallel Processing Ray tracing is a trivially parallel algorithm! Cast rays in parallel Cast reflection, refraction, shadow rays in parallel Calculate ray/surface intersections independently in parallel

Ray Tracing Results: Special Effects Copyright Newline Cinema

Ray Tracing Results: Video Games These images are from a prototype computer game running in realtime on the ray tracer. It consists of more than 40 million polygons and all optical effects are fully simulated at rendering time. All trees are fully models and no LOD is being used.

Ray Tracing Results: Massive Models Ray tracing has been the first and (to our knowledge) only technology to interactively render the entire Boeing 777 data set. It consists of 350 million polygons and takes up to 30 GB of data on disk. Every detail is models including tiny screws, cables, pipes, values, and many more. With ray tracing this model can be rendered interactively even on a dual-processor PC with 2-3 fps at video resolution. The right image contains 365 000 plants with a total of roughly 1.5 billion polygons. All leafs use alpha-mapped textures leading to an extremely high depth complexity. Still the scene can be rendered with interactive performance on a decent PC cluster. Even smooth lighting from the sky dome can be integrated. An good approximation is then shown during interaction but the image converges to a high quality solution with a few seconds.

Pros and Cons of Ray Tracing Advantages of ray tracing All the advantages of the local illumination model Also handles shadows, reflection, and refraction Disadvantages of ray tracing Computational expense No diffuse inter-reflection between surfaces (i.e., color bleeding) Not physically accurate Other techniques exist to handle these shortcomings, at even greater expense!

Ray Tracing References Peter Shirley, “Realistic Ray Tracing”, ISBN 1-56881-110-1 Andrew Glassner, “An Introduction to Ray Tracing”, ISBN 0-12-286160-4 Steve Pettifer (http://www.cs.man.ac.uk/people/srp) Anselmo Lastra (http://www.cs.unc.edu/~lastra) Paul Rademacher (http://www.cs.unc.edu/~rademach) Mark Harris (http://www.cs.unc.edu/~harrism) Kenny Hoff (http://www.cs.unc.edu/~hoff) POV-Ray (http://www.povray.org)