Global Illumination (3) Cone Tracing / Distributed Ray Tracing.

Slides:



Advertisements
Similar presentations
Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
Advertisements

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.
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics1 Ray Tracing Variants Distributed ray tracing Generalized rays Cone Tracing Beam Tracing Pencil.
Optics. Spherical Mirrors Spherical mirror – a section of a sphere of radius R and with a center of curvature C R C Mirror.
Chapter 26 Geometrical Optics. Units of Chapter 26 The Reflection of Light Forming Images with a Plane Mirror Spherical Mirrors Ray Tracing and the Mirror.
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.
Christian Lauterbach COMP 770, 2/11/2009
1 Advanced Ray Tracing Mani Thomas CISC 440/640 Computer Graphics.
Parallelizing Raytracing Gillian Smith CMPE 220 February 19 th, 2008.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 23: Reflection and Refraction of Light.
1 7M836 Animation & Rendering Global illumination, ray tracing Arjan Kok
CIS 681 Distributed Ray Tracing. CIS 681 Anti-Aliasing Graphics as signal processing –Scene description: continuous signal –Sample –digital representation.
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.
© 2010 Pearson Education, Inc. Conceptual Physics 11 th Edition Chapter 28: REFLECTION & REFRACTION Reflection Principle of Least Time Law of Reflection.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Copyright © 2010 Pearson Education, Inc. Lecture Outline Chapter 26 Physics, 4 th Edition James S. Walker.
Chapter 18: Ray Optics Lisa & Becky. Ray Model of Light  Light rays travel in straight lines  Light rays cross but do not interact  Light rays travel.
Fundamental Physics II PETROVIETNAM UNIVERSITY FUNDAMENTAL SCIENCES DEPARTMENT Vungtau, 2013 Pham Hong Quang
01/28/05© 2005 University of Wisconsin Last Time Improving Monte Carlo Efficiency.
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.
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.
University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Distribution Ray Tracing.
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 Jian Huang, CS 594, Fall, 2002 This set of slides are used at Ohio State by Prof. Roger Crawfis.
02/10/03© 2003 University of Wisconsin Last Time Participating Media Assignment 2 –A solution program now exists, so you can preview what your solution.
University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Ray Tracing.
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!

Cameras Digital Image Synthesis Yung-Yu Chuang 10/26/2006 with slides by Pat Hanrahan and Matt Pharr.
CSE 681 DISTRIBUTED RAY TRACING some implementation notes.
Graphics Graphics Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.
Ray-tracing.
Dispersion The spreading of light into its color components is called dispersion. When light enters a prism, the refracted ray is bent towards the normal,
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
Bounding Volume Hierarchy. The space within the scene is divided into a grid. When a ray travels through a scene, it only passes a few boxes within the.
Cameras Digital Image Synthesis Yung-Yu Chuang with slides by Pat Hanrahan and Matt Pharr.
Physics.
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.
Global Illumination (3) Path Tracing. Overview Light Transport Notation Path Tracing Photon Mapping.
Distributed Ray Tracing. Can you get this with ray tracing?
CSL 859: Advanced Computer Graphics Dept of Computer Sc. & Engg. IIT Delhi.
Distributed Ray Tracing. Can you get this with ray tracing?
CS552: Computer Graphics Lecture 33: Illumination and Shading.
Geometrical Optics.
CIS 681 Distributed Ray Tracing. CIS 681 Anti-Aliasing Graphics as signal processing –Scene description: continuous signal –Sample –digital representation.
Basic Ray Tracing CMSC 435/634.

Rendering Pipeline Fall, 2015.
Reconstruction For Rendering distribution Effect
Distributed Ray Tracing
© University of Wisconsin, CS559 Fall 2004
Ray Tracer Project CSE 557.
(c) 2002 University of Wisconsin
Distribution Ray Tracing
Lighting.
Distributed Ray Tracing
Distributed Ray Tracing
Monte Carlo Rendering Central theme is sampling:
Distributed Ray Tracing
Ray Tracer Project CSE 557.
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
Distributed Ray Tracing
CSC418 Computer Graphics Raytracing Shadows Global Illumination.
Distributed Ray Tracing
Presentation transcript:

Global Illumination (3) Cone Tracing / Distributed Ray Tracing

Conventional Ray Tracing Light Image Plane Object Infinitesimally thin rays Perfect sharp multiple reflections and shadows Not in reality! Surfaces are not perfectly smooth!

On the same object: blurred reflection of the direct light sources with perfect reflection of nearby objects Hybrid Model

Cone Tracing Amantides (1984) idea: rather than send a single thin ray, we send out a cone and determine intersections with that cone cone –circular –represented with apex, center line, spread angle –spread angle of primary ray determined by eyepoint –spread angle of secondary rays determined by material of the object Intersect the cone base with the second object, then merge those intersection intensities to determine the intensity at the original intersection point

Diffuse reflection Perturb directions reflection/transmission, with distribution based on angle from ideal ray Depth of field Perturb eye position on lens Soft shadows shadow Perturb illumination rays across area light Motion blur Perturb eye ray samples in time Distributed Ray Tracing Cook-Porter-Carpenter (1984) Apply distribution-based sampling to many parts of the ray-tracing algorithm Rays can also be stochastically distributed in object space to simulate

Diffuse reflection rays are distributed reflections around reflection direction to simulate non- smooth surfaces Depth of field origin of rays is distributed with respect to lens to get out-of-focus effect Soft shadows shadow rays are distributed around light direction to simulate area light sources Motion blur rays are distributed in time to simulate object movement Distributed Ray Tracing Apply distribution-based sampling to many parts of the ray-tracing algorithm Rays can also be stochastically distributed in object space to simulate

Distributed Ray Tracing

Diffuse reflection rays are distributed reflections around reflection direction to simulate non- smooth surfaces Depth of field origin of rays is distributed with respect to lens to get out-of-focus effect Soft shadows shadow rays are distributed around light direction to simulate area light sources Motion blur rays are distributed in time to simulate object movement Distributed Ray Tracing Rays can also be stochastically distributed in object space to simulate

DRT: Diffuse reflection Blurry reflections and refractions are produced by randomly perturbing the reflection and refraction rays from their "true" directions.

void RenderStandrad (Color *fb) { int i, j; Ray r; Color color; fb = new Color[resY*resX]; for (i = 0; I < resY; i++) { for (j = 0; j < resX; j++) { color.Set(0,0,0); calcRay (&r, j, i); color += traceRay (r); fb[i*resX + j] = color; }

void calcRay (Ray *r, int x, int y) { double a = ((double)resX) / resY; double d = 1.0 / tan((camera.FOV()/2)*(PI/180)); Vec3d L = camera.LookAt() - camera.Eye(); L.Normalize(); Vec3d v = L.crossProd(camera.Up()); v.Normalize(); Vec3d u = v.crossProd(L); Vec3d LL = camera.Eye() + d*L - a*v - u; Vec3d p = LL + 2*a*v*(((double)x)/resX) + 2*u*(((double)y)/resY); Vec3d dir = p - camera.Eye(); dir.Normalize(); r->setPos(camera.Eye()); r->setDir(dir); }

void calcRay (Ray *r, int x, int y) { double a = ((double)resX) / resY; double d = 1.0 / tan((camera.FOV()/2)*(PI/180)); Vec3d L = camera.LookAt() - camera.Eye(); L.Normalize(); Vec3d v = L.crossProd(camera.Up()); v.Normalize(); Vec3d u = v.crossProd(L); Vec3d LL = camera.Eye() + d*L - a*v - u; Vec3d p = LL + 2*a*v*(((double)x)/resX) + 2*u*(((double)y)/resY); Vec3d dir = p - camera.Eye(); dir.Normalize(); r->setPos(camera.Eye()); r->setDir(dir); } p

void RenderDistributed_v1 (Color *fb, int numSamples) { int i, j, k; Ray r; Color color; fb = new Color[resY*resX]; for (i = 0; I < resY; i++) { for (j = 0; j < resX; j++) { color.Set(0,0,0); for (k = 0; k < numSamples; k++) { calcRandomRay (&r, j, i); color += traceRay (r); } color /= (double) numSamples; fb[i*resX + j] = color; } } } (…) RenderDistributed_v1 (fb, 12); (…)

void calcRandomRay(Ray *r, int x, int y) { double a = ((double)resX) / resY; double d = 1.0 / tan((camera.FOV()/2)*(PI/180)); Vec3d L = camera.LookAt() - camera.Eye(); L.Normalize(); Vec3d v = L.crossProd(camera.Up()); v.Normalize(); Vec3d u = v.crossProd(L); Vec3d LL = camera.Eye() + d*L - a*v - u; Vec3d p = LL + 2*a*v*((((double)x)+RAND3())/resX) + 2*u*((((double)y)+RAND3())/resY); Vec3d dir = p - camera.Eye(); dir.Normalize(); r->setPos(camera.Eye()); r->setDir(dir); } #define RAND3() (float)((rand()/(float)RAND_MAX)-0.5) // NORMALIZED RAND FUNCTION [-0.5,0.5]

void RenderDistributed_v2 (Color *fb, int numSamples) { int i, j, k; Ray r; Color color; fb = new Color[resY*resX]; for (i = 0; I < resY; i++) { for (j = 0; j < resX; j++) { color.Set(0,0,0); for (k = 0; k < numSamples; k++) { calcJitteredRay (&r, j, i, (k% numSamples)); color += traceRay (r); } color /= (double) numSamples; fb[i*resX + j] = color; } (…) RenderDistributed_v2 (fb, 4); (…)

#define RAND3() (float)((rand()/(float)RAND_MAX)-0.5) // NORMALIZED RAND FUNCTION [-0.5,0.5] void calcRandomRay (Ray *r, int x, int y, int quadrant) { double a = ((double)resX) / resY; double d = 1.0 / tan((camera.FOV()/2)*(PI/180)); Vec3d L = camera.LookAt() - camera.Eye(); L.Normalize(); Vec3d v = L.crossProd(camera.Up()); v.Normalize(); Vec3d u = v.crossProd(L); double xOffset = (quadrant == 0 || quadrant == 3) ? 0.5 : 0; double yOffset = (quadrant == 0 || quadrant == 2) ? 0.5 : 0; Vec3d LL = camera.Eye() + d*L - a*v - u; Vec3d p = LL + 2*a*v*((((double)x)+xOffset-RAND1())/resX) + 2*u*((((double)y)+yOffset-RAND1())/resY); Vec3d dir = p - camera.Eye(); dir.Normalize(); r->setPos(camera.Eye()); r->setDir(dir); }

Jitter magnitude Range of reflection angles 16 ray samples Look Up Table

Importance Sampling Divide sample space into blocks of equal area under weighting function Assign each pixel sample a different (random) block Perturb randomly within block (ideally, points in block have nearly equal weight…) Possible block arrangement for reflection ray direction

Importance Sampling cos(x)]^n for n = 2.cos(x)]^n for n = 4.cos(x)]^n for n = 8. phong-style cos(x)]^n

4 rays64 rays Reflection

4 rays16 rays Transparency

Diffuse reflection rays are distributed reflections around reflection direction to simulate non- smooth surfaces Depth of field origin of rays is distributed with respect to lens to get out-of-focus effect Soft shadows shadow rays are distributed around light direction to simulate area light sources Motion blur rays are distributed in time to simulate object movement Distributed Ray Tracing Rays can also be stochastically distributed in object space to simulate

Depth of Field The area in front of your camera where everything looks sharp and in focus. For example, if you're focused on somebody standing 10 feet in front of the camera, your depth of field might be from 8 feet to 14 feet. That means: –objects falling within that area will be acceptably-sharp and in focus; –objects falling outside the area will be soft and out of focus.

CG Camera Models Pinhole – ideal camera All rays go through single point Everything in focus -- unrealistic

More Realistic Model Lenses with spherical surfaces Depth of field control

DRT: Depth of Field

Depth of Field

Cook (1986) The first fully CG character, a medieval knight, springs to life from a stained glass window in "Young Sherlock Holmes." The 30-second sequence takes six months to accomplish.

Diffuse reflection rays are distributed reflections around reflection direction to simulate non- smooth surfaces Depth-of-view origin of rays is distributed with respect to lens to get out-of-focus effect Soft shadows shadow rays are distributed around light direction to simulate area light sources Motion blur rays are distributed in time to simulate object movement Distributed Ray Tracing Rays can also be stochastically distributed in object space to simulate

Soft Shadows Consider the light source to be an area, not a point Trace rays to random areas on the surface of the light source distribute rays according to areas of varying intensity of light source (if any) Use the fraction of the light intensity equal to the fraction of rays which indicate an unobscured light source

Cook (1986)

Diffuse reflection rays are distributed reflections around reflection direction to simulate non- smooth surfaces Depth-of-view origin of rays is distributed with respect to lens to get out-of-focus effect Soft shadows shadow rays are distributed around light direction to simulate area light sources Motion blur rays are distributed in time to simulate object movement Distributed Ray Tracing Rays can also be stochastically distributed in object space to simulate

Motion Blur Two objects moving so that one always obscures the other –Can’t render and blur objects separately A spinning top with texture blurred but highlights sharp –Can’t post-process blur a rendered object The blades of a fan creating a blurred shadow –Must consider the movement of other objects time Post-process blurring can get some effects, but consider:

Temporal Jittering Sampling

Motion Blur

Cook (1986)

Distributed Ray Tracing (Summary)