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
Advanced Effects CMSC 435/634. General Approach Ray Tracing – Shoot more rays Rasterization – Render more images.
Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.
May Visible Surface Detection Shmuel Wimer Bar Ilan Univ., Eng. Faculty Technion, EE Faculty.
David Luebke1/19/99 CS 551/651: Advanced Computer Graphics David Luebke
Light Issues in Computer Graphics Presented by Saleema Amershi.
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.
Illumination Model & Surface-rendering Method 박 경 와.
Course Website: Computer Graphics 18: Ray-tracing.
Ray Tracing Tutorial. Ray Casting One type of visibility algorithm.
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.
CS 376 Introduction to Computer Graphics 04 / 09 / 2007 Instructor: Michael Eckmann.
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.
Photorealism Reflection, Refraction Bump maps
Ray Tracing Jerry Sui Adam Conner. Part I – Introduction to Ray Tracing Final Product.
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 Ray Tracing Jinxiang Chai.
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.
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.
Project Raytracing. Content Goals Idea of Raytracing Ray Casting – Therory – Practice Raytracing – Theory – Light model – Practice Output images Conclusion.
CSC418 Computer Graphics n Illumination n Lights n Lightinging models.
Ray Tracing Chapter CAP4730: Computational Structures in Computer Graphics.
Ray Tracing Jian Huang, CS 594, Fall, 2002 This set of slides are used at Ohio State by Prof. Roger Crawfis.
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.
1 Ray-Tracing ©Anthony Steed Overview n Recursive Ray Tracing n Shadow Feelers n Snell’s Law for Refraction n When to stop!
Basic Ray Tracing CMSC 435/634.
Graphics Graphics Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.
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.
Project 3 Help Session: Ray Tracing. Getting Started Download the starter pack. 1.sample_ray.exe 2.ray-skel directory 3.scenes directory Look at the Road.
Photo-realistic Rendering and Global Illumination in Computer Graphics Spring 2012 Stochastic Path Tracing Algorithms K. H. Ko School of Mechatronics Gwangju.
CS 445 / 645 Introduction to Computer Graphics Lecture 16 Radiosity Radiosity.
1. Ray Casting Surface intersection Visible surface detection Ray Tracing Bounce the ray Collecting intensity Technique for global reflection and transmission.
CSE 681 Introduction to Ray Tracing. CSE 681 Ray Tracing Shoot a ray through each pixel; Find first object intersected by ray. Image plane Eye Compute.
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.
CS552: Computer Graphics Lecture 33: Illumination and Shading.
CS552: Computer Graphics Lecture 36: Ray Tracing.
Review Ray Tracing III Review. Pseudo codes RayCast-1  Plain ray caster (direct illumination) RayCast-2  RayCast-1 + shadow rays RayTrace-1  Recursive.
Introduction to Ray Tracing Dr. B. Raghu Professor /CSE Sri Ramanujar Engineering College.
Basic Ray Tracing CMSC 435/634.
Ray Tracing Dr. Scott Schaefer.
RAY TRACING.
© University of Wisconsin, CS559 Fall 2004
Ray Tracing.
Lighting.
Reflection and Refraction
CS5500 Computer Graphics May 29, 2006
Advanced Computer Graphics
CSCE 441: Computer Graphics Ray Tracing
GR2 Advanced Computer Graphics AGR
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
Reflection and Refraction
Reflection and Refraction
CSC418 Computer Graphics Raytracing Shadows Global Illumination.
Presentation transcript:

Ray-tracing

Overview Recursive Ray Tracing Shadow Feelers Snell’s Law for Refraction When to stop!

Recap: Light Transport The point to note here is the amount of computation involved in each of these scenarios: In (a) a single beam generates one primary reflection and one secondary reflection. In (b) a single beam generates one primary reflection and N secondary reflections. In (c) a single beam generates N primary reflections, each of which generates one secondary reflection i.e. there are N secondary reflections In (d) a single beam generates N primary reflections, each of which generates N secondary reflections i.e. there are N2 secondary reflections Where N is the number of discrete samples taken over the hemisphere above the surface.

Recap: Local Illumination ( ) å = × + M j m s d i a r n h k l I 1 , I a Ambient, diffuse & specular components The sum is over the specular and diffuse components for each light

Recap: Result of Ray Casting

Correcting for Non-Visible Lights surface

Note consider your intersection points along the ray L carefully Where Sj is the result of intersecting the ray L with the scene objects Note consider your intersection points along the ray L carefully Hint – they might be beyond the light!

Result of Shadow Feeler

Recursive Ray-Tracing We can simulate specular-specular transmission elegantly by recursing and casting secondary rays from the intersection points We must obviously chose a termination depth to cope with multiple reflections

Introducing Reflection H R E L surface Where

Computing the reflection direction   Ideal reflection  =  R same plane as V and N R = aE + bN E.N = N.R = a(N.E)+b If a = -1, b = 2N.E R = -E + 2(N.E)N V is referred to in all preceding slides as E Should read: -V.N = N.R = a(N.-V

Computing Reflectance Where Ilocal is computed as before Ray r' is formed from intersection point and the direction R and is cast into the scene as before

Recursive Ray Tracing L1 L2 p p’ p’’ R1 R2

Pseudo Code Color RayTrace(Point p, Vector direction, int depth) { Point pd /* Intersection point */ Boolean intersection if (depth > MAX) return Black intersect(p,direction, &pd, &intersection) if (!intersection) return Background Ilocal = kaIa + Ip.v.(kd(n.l) + ks.(h.n)m) return Ilocal + kr*RayTrace(pd, R, depth+1) } Normally kr = ks

Result of Recursion

Perfect Specular Transmission H E R Snell’s Law L  1  is index of refraction 2 T ß

Using Snell’s Law Using this law it is possible to show that: Note that if the root is negative then total internal reflection has occurred and you just reflect the vector as normal

Recursive Ray Tracing Including Transparent Objects

New Pseudo Code Color RayTrace(Point p, Vector D, int depth) { Point pd /* Intersection point */ Boolean intersection if (depth > MAX) return Black intersect(p,direction, &pd, &intersection) if (!intersection) return Background Ilocal = kaIa + Ip.v.(kd(n.l) + ks.(h.n)m) return Ilocal + kr*RayTrace(pd, R, depth+1) + kt*RayTrace(pd, T, depth+1) }

Direct Specular Transmission A transparent surface can be illuminated from behind and this should be calculated in Ilocal H' E L

Calculating H' Use H‘ instead of H in specular term

Putting Everything Together

Discussion – What Can’t We Simulate? Can do (a) and (c) Can’t do (b) and (d) Do hands up for this!

Remark Specular and transmission only Why it’s expensive What should be added to consider diffuse reflection? Why it’s expensive Intersection of rays with polygons (90%) How to reduce the cost? Reduce the number of rays Reduce the cost on each ray First check with bounding box of the object Methods to sort the scene and make it faster

Summary Recursive ray tracing is a good simulation of specular reflections We’ve seen how the ray-casting can be extended to include shadows, reflections and transparent surfaces However this is a very slow process and still misses some types of effect!