CSL 859: Advanced Computer Graphics Dept of Computer Sc. & Engg. IIT Delhi.

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.
Advanced Effects CMSC 435/634. General Approach Ray Tracing – Shoot more rays Rasterization – Render more images.
Shadow Rendering Techniques A point is in the shadow of a light source if it can not be “seen” by the light source, i.e. the line segment that connects.
Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.
Advanced Ray Tracing CMSC 435/634. Basic Ray Tracing For each pixel – Compute ray direction – Find closest surface – For each light Compute direct illumination.
Light Issues in Computer Graphics Presented by Saleema Amershi.
ATEC Procedural Animation Introduction to Procedural Methods in 3D Computer Animation Dr. Midori Kitagawa.
Course Website: Computer Graphics 18: Ray-tracing.
Christian Lauterbach COMP 770, 2/11/2009
CS 325 Introduction to Computer Graphics 04 / 09 / 2010 Instructor: Michael Eckmann.
CS 376 Introduction to Computer Graphics 04 / 09 / 2007 Instructor: Michael Eckmann.
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.
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.
CIS 681 Distributed Ray Tracing. CIS 681 Anti-Aliasing Graphics as signal processing –Scene description: continuous signal –Sample –digital representation.
Lecture 8 Advanced Rendering – Ray Tracing, Radiosity & NPR.
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.
Computer graphics & visualization Ray-Tracing – A Quick review.
COMP 175: Computer Graphics March 24, 2015
Today More raytracing stuff –Soft shadows and anti-aliasing More rendering methods –The text book is good on this –I’ll be using images from the CDROM.
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.
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.
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.
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.
CSE 681 DISTRIBUTED RAY TRACING some implementation notes.
Basic Ray Tracing CMSC 435/634.
CS380: Computer Graphics Distributed Ray Tracing TA Course URL:
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
1. Ray Casting Surface intersection Visible surface detection Ray Tracing Bounce the ray Collecting intensity Technique for global reflection and transmission.
RENDERING : Global Illumination
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.
CS 325 Introduction to Computer Graphics 04 / 07 / 2010 Instructor: Michael Eckmann.
Ray Tracing I. Reading Hill, Chapter 14, Sections 14.1 to 14.5 Hill, Chapter 14, Sections and
Ray Tracing (2) Recursive Ray Tracing and Beyond.
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.
Mike Merchant Nicholas Hilbert
© University of Wisconsin, CS559 Fall 2004
Real-Time Volume Graphics [06] Local Volume Illumination
Ray Tracer Project CSE 557.
(c) 2002 University of Wisconsin
Ray Tracing.
(c) 2002 University of Wisconsin
Image synthesis using classical optics
Monte Carlo Rendering Central theme is sampling:
CS5500 Computer Graphics May 29, 2006
CSCE 441: Computer Graphics Ray Tracing
GR2 Advanced Computer Graphics AGR
Ray Tracer Project CSE 557.
Introduction to Ray Tracing
CSC418 Computer Graphics Raytracing Shadows Global Illumination.
Presentation transcript:

CSL 859: Advanced Computer Graphics Dept of Computer Sc. & Engg. IIT Delhi

Ray Tracing Courtesy POV-Ray gallery

Ray Tracing: Forward Rendering Point Directional Or Both Color normal View Direction Light Direction

Basic Ray-casting For each pixel For each pixel Form the Ray Form the Ray For each Object For each Object Find point of intersection Find point of intersection If closest, save object If closest, save object Shade Ray Shade Ray If no intersection, return background color If no intersection, return background color Otherwise, shade(saved object) Otherwise, shade(saved object) For each light: For each light: Form light ray Form light ray Shade surface and accumulate color Shade surface and accumulate color

Ray-traced picture

Shadow Rays Shade Ray: If no intersection, return Background Otherwise, For each light: Compute Shadow Ray If(shadow Ray doesn’t intersect light first) ignore and continue; ignore and continue; Otherwise Otherwise shade surface and accumulate color shade surface and accumulate color

Shadow Rays

Recursive Ray Tracing

L n v c r t c

Color RayTrace(Ray &ray, int depth) { Point IntersectionPoint; Point IntersectionPoint; if (depth > MAX) return Background; if (depth > MAX) return Background; if(! intersect(IntersectionPoint, ray)) if(! intersect(IntersectionPoint, ray)) return Background; return Background; I local = k a I a + I p.v.(k d (n.l) + k s.(h.n) m ) I local = k a I a + I p.v.(k d (n.l) + k s.(h.n) m ) return I local + k r *RayTrace(ReflectRay, depth+1) + return I local + k r *RayTrace(ReflectRay, depth+1) + k t *RayTrace(RefractRay, depth+1); k t *RayTrace(RefractRay, depth+1);}

Computing the reflection direction Ideal reflection  =  -v + r = -2(v.n) n r = v - 2(v.n)n n r v   r

Refraction  Snell’s Law: index of refraction 11 22 ß n v n t m

Refracted Ray Computation Notes: Negative root => Total internal reflection Transparent => Invert light behind object

Specular Transmission A transparent surface can be illuminated from behind and this should be calculated in I local A transparent surface can be illuminated from behind and this should be calculated in I local  11 22 ß v n l l’

Make Ray ref tan(fovx/2) tan(fovy/2) y x Origin Origin Direction Direction o + t d o + t d

Algebraic Intersection Point satisfies Point satisfies o + t d o + t d f (x, y, z) = 0 f (x, y, z) = 0 f (o x + t d x, o y + t d y, o z + t d z ) = 0 f (o x + t d x, o y + t d y, o z + t d z ) = 0 Example Example (0, 0, 5) + t (0, 0, 1) (0, 0, 5) + t (0, 0, 1) X 2 +y 2 +z 2 = 1 X 2 +y 2 +z 2 = (5+t) 2 = 1, i.e., t = +-1 – 5, -4/ (5+t) 2 = 1, i.e., t = +-1 – 5, -4/-6 (0, 0, 5) – 4(0, 0, 1) = (0, 0, 1) (0, 0, 5) – 4(0, 0, 1) = (0, 0, 1)

Geometric Intersection e c d (c-e).d (c-e).(c-e) d 2 = r 2 – {(c-e).(c-e) - (c-e).d}

Triangle Intersection? Intersect with plane Intersect with plane Ax + By + Cz = 1 Ax + By + Cz = 1 Check if point inside triangle Check if point inside triangle Barycentric coordinates must be +ve Barycentric coordinates must be +ve Point must be in the positive half-planes Point must be in the positive half-planes

Half-plane Method Ax + By + Cz = 1 o v1v1v1v1 v2v2v2v2 n = op X oq n.(p-o) > 0 p Orient edges in CW order

Distributed Ray Tracing Multiple randomly jittered rays

Depth of Field Use multiple origins Use multiple origins Distributed on a disk Distributed on a disk

Motion Blur Jitter rays in time Jitter rays in time

Soft Shadows Light has area Light has area Shoot multiple rays to light Shoot multiple rays to light Take average contribution Take average contribution Courtesy H.P. Seidel

Monte-Carlo Integration At intersection At intersection Generate multiple rays Generate multiple rays Typically based on material properties Typically based on material properties Weighted average of resulting ray colors Weighted average of resulting ray colors Path tracing Path tracing Global illumination Global illumination More later More later

Tracing Efficiency “Embarassingly” parallel “Embarassingly” parallel Bounding volume hierarchy Bounding volume hierarchy `

Bounding Box Test tx0tx0 tx1tx1 ty0ty0 ty1ty1 x = a o + t d o x + t d x = a t = (a – o x )/d x