CSCE 641: Computer Graphics Ray Tracing Jinxiang Chai.

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
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.
Christian Lauterbach COMP 770, 2/11/2009
CS 325 Introduction to Computer Graphics 04 / 09 / 2010 Instructor: Michael Eckmann.
CSCE 641: Photon Mapping Jinxiang Chai. Outline Rendering equation Photon mapping.
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.
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.
1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.
Global Illumination May 7, Global Effects translucent surface shadow multiple reflection.
Photorealism Reflection, Refraction Bump maps
CSCE 641 Computer Graphics: Radiosity Jinxiang Chai.
Foundations of Computer Graphics (Spring 2010) CS 184, Lecture 14: Ray Tracing
Ray Tracing Jerry Sui Adam Conner. Part I – Introduction to Ray Tracing Final Product.
1 7M836 Animation & Rendering Global illumination, ray tracing Arjan Kok
CS 376 Introduction to Computer Graphics 04 / 04 / 2007 Instructor: Michael Eckmann.
Ray Tracing 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009.
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.
CSC418 Computer Graphics n Raytracing n Shadows n Global Illumination.
Ray Tracing Primer Ref: SIGGRAPH HyperGraphHyperGraph.
Computer graphics & visualization Ray-Tracing – A Quick review.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
12/05/02(c) 2002 University of Wisconsin Last Time Subdivision techniques for modeling Very brief intro to global illumination.
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.
-Global Illumination Techniques
Project Raytracing. Content Goals Idea of Raytracing Ray Casting – Therory – Practice Raytracing – Theory – Light model – Practice Output images Conclusion.
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.
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
Basic Ray Tracing CMSC 435/634. Visibility Problem Rendering: converting a model to an image Visibility: deciding which objects (or parts) will appear.
Computer graphics & visualization Photon Mapping.
I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam, John Alex October 28, 2003 Raytracing 1/42 Raytracing Basics Part 2 of 2.
1 Ray-Tracing ©Anthony Steed Overview n Recursive Ray Tracing n Shadow Feelers n Snell’s Law for Refraction n When to stop!

Recursion and Data Structures in Computer Graphics Ray Tracing 1.
Basic Ray Tracing CMSC 435/634.
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
In the name of God Computer Graphics. Last Time Some techniques for modeling Today Global illumination and raytracing.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
RENDERING : Global Illumination
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
David Luebke3/12/2016 Advanced Computer Graphics Lecture 3: More Ray Tracing David Luebke
CS 325 Introduction to Computer Graphics 04 / 07 / 2010 Instructor: Michael Eckmann.
CSL 859: Advanced Computer Graphics Dept of Computer Sc. & Engg. IIT Delhi.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
CS552: Computer Graphics Lecture 36: Ray Tracing.
Introduction to Ray Tracing Dr. B. Raghu Professor /CSE Sri Ramanujar Engineering College.
Photorealistic Rendering vs. Interactive 3D Graphics
Ray Tracing Dr. Scott Schaefer.
© University of Wisconsin, CS559 Fall 2004
CS5500 Computer Graphics May 29, 2006
CSCE 441: Computer Graphics Ray Tracing
GR2 Advanced Computer Graphics AGR
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
CSC418 Computer Graphics Raytracing Shadows Global Illumination.
Presentation transcript:

CSCE 641: Computer Graphics Ray Tracing Jinxiang Chai

Ray Tracing Provides rendering method with Refraction/Transparent surfaces Reflective surfaces Shadows

Ray Tracing Provides rendering method with Refraction/Transparent surfaces Reflective surfaces Shadows Image taken from

Ray Tracing Provides rendering method with Refraction/Transparent surfaces Reflective surfaces Shadows Image taken from

Ray Tracing Provides rendering method with Refraction/Transparent surfaces Reflective surfaces Shadows Image taken from Any difference for rendering three pixels?

Overview Ray Tracing Algorithm Shadows, Reflection, Refraction Surface Intersection Infinite planes, spheres, polygons Optimizations

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)

The Reflection Equation

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)

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) What are the radiances?

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) Reverse light path!

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

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 L1 L2

Recursive Ray Tracing L1 L2

Recursive Ray Tracing L1 L2

Recursive Ray Tracing L1 L2

Recursive Ray Tracing L1 L2

Recursive Ray Tracing L1 L2

Recursive Ray Tracing L1 L2

Recursive Ray Tracing L1 L2

Recursive Ray Tracing L1 L2 What are real light paths?

Recursive Ray Tracing and Light path L1 L2 Ray tracing paths just reverses real light paths!

Recursive Ray Tracing and Light path L1 L2 Ray tracing paths just reverses real light paths!

Recursive Ray Tracing and Light path L1 L2 Ray tracing paths just reverses real light paths!

Recursive Ray Tracing and Light path L1 L2 Ray tracing paths just reverses real light paths!

Recursive Ray Tracing and Light path L1 L2 Ray tracing paths just reverses real light paths!

Recursive Ray Tracing and Light path L1 L2 Ray tracing paths just reverses real light paths!

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

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 eye screen Similar to ray casting!

Ray-object Intersection eye screen Similar to ray casting! But how to determine the intersection point between a pixel and triangle?

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

Ray-Triangle Intersection A triangle consists of 3 points (a,b,c), if not co-linear, they create a plane. Use barycentric coordinates. p(α,β,γ) = αa + βb + γc α + β + γ = 1 p is inside the triangle only if: 0 < α < 1 0 < β < 1 0 < γ < 1 If 1 coordinate zero, then on edge, 2 then at a vertex

Ray-Triangle Intersection Barycentric coordinates computed using the areas A a, A b, and A c of the subtriangles above, and total area A. α = A a / A β = A b / A γ = A c / A AcAc AbAb AaAa a b c (α,β,γ)

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 c i Use Snell’s law to find refracted vector Image taken from

Snell’s Law Surface

How to compute Transmission Ray? Surface c1c1 c2c2

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

Ray Tracing Results: Massive Models

Global Illumination Using Ray Tracing: Global Illumination Simulating global lighting through tracing rays Indirect diffuse and caustic illumination Very fast Benefits Add the subtle but highly important clue for realism Allows flexible light planning and control

Limitations of Ray Tracing Only considers totally specular interactions - rays either reflect perfectly or refract perfectly Ray traced scenes don't show "color bleed".

Ray Tracing References Peter Shirley, “Realistic Ray Tracing”, ISBN Andrew Glassner, “An Introduction to Ray Tracing”, ISBN Steve Pettifer ( Anselmo Lastra ( Paul Rademacher ( Mark Harris ( Kenny Hoff ( POV-Ray (