RENDERING : Global Illumination

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.
3D Graphics Rendering and Terrain Modeling
CHAPTER 12 Height Maps, Hidden Surface Removal, Clipping and Level of Detail Algorithms © 2008 Cengage Learning EMEA.
Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.
Light Issues in Computer Graphics Presented by Saleema Amershi.
Ray Tracing Tutorial. Ray Casting One type of visibility algorithm.
Christian Lauterbach COMP 770, 2/11/2009
Chapter 11: Advanced Rendering Part 1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley Mohan Sridharan Based on Slides.
Vertices and Fragments I CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
Ray Tracing Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University of.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2008 Alla Sheffer Advanced Rendering Week.
MC930/MO603 Ray Casting. Light is bouncing photons.
Computer Graphics (Fall 2005) COMS 4160, Lecture 21: 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.
Foundations of Computer Graphics (Spring 2010) CS 184, Lecture 14: Ray Tracing
1 7M836 Animation & Rendering Global illumination, ray tracing Arjan Kok
CIS 310: Visual Programming, Spring 2006 Western State College 310: Visual Programming Ray Tracing.
Ray Tracing 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009.
CSCE 641: Computer Graphics Ray Tracing Jinxiang Chai.
Advanced Computer Graphics (Fall 2010) CS 283, Lecture 2: Basic Ray Tracing Ravi Ramamoorthi Some slides courtesy.
Now Playing: Quicksand Under Carpet New Radiant Storm King from Leftover Blues: Released 2004.
Basic Ray Tracing CMSC 435/634. Visibility Problem Rendering: converting a model to an image Visibility: deciding which objects (or parts) will appear.
Introduction to 3D Graphics John E. Laird. Basic Issues u Given a internal model of a 3D world, with textures and light sources how do you project it.
Cornell CS465 Fall 2004 Lecture 3© 2004 Steve Marschner 1 Ray Tracing CS 465 Lecture 3.
Cornell CS465 Fall 2004 Lecture 3© 2004 Steve Marschner 1 Ray Tracing CS 465 Lecture 3.
Advanced Rendering University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013 Tamara Munzner.
COMP 175: Computer Graphics March 24, 2015
Computer Graphics Panos Trahanias ΗΥ358 Spring 2009.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
1 Ray Casting. CLASS 1 Ray Casting 2 3 Overview of Today Ray Casting Basics Camera and Ray Generation Ray-Plane Intersection.
Ray Tracing Chapter CAP4730: Computational Structures in Computer Graphics.
Visible-Surface Detection Jehee Lee Seoul National University.
Foundations of Computer Graphics (Spring 2012) CS 184, Lectures 16, 18: Nuts and bolts of Ray Tracing Acknowledgements:
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.
Week 10 - Wednesday.  What did we talk about last time?  Shadow volumes and shadow mapping  Ambient occlusion.
CS 325 Introduction to Computer Graphics 03 / 24 / 2010 Instructor: Michael Eckmann.
Basic Ray Tracing CMSC 435/634.
Ray Tracing. 2 Introduction OpenGL is based on a pipeline model in which primitives are rendered one at time ­No shadows (except by tricks or multiple.
CS380: Computer Graphics Distributed Ray Tracing TA Course URL:
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
MIT EECS 6.837, Durand and Cutler The Graphics Pipeline: Projective Transformations.
CS 480/680 Computer Graphics Compositing and Blending Dr. Frederick C Harris, Jr.
CSCE 441: Computer Graphics Ray Tracing
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 29, 2015 RENDERING RASTERIZATION RAY CASTING PROGRAMMABLE SHADERS.
CS 445 / 645 Introduction to Computer Graphics Lecture 16 Lighting Lighting.
More on Ray Tracing Glenn G. Chappell U. of Alaska Fairbanks CS 481/681 Lecture Notes Wednesday, April 14, 2004.
Ray Tracing I. Reading Hill, Chapter 14, Sections 14.1 to 14.5 Hill, Chapter 14, Sections and
CS552: Computer Graphics Lecture 33: Illumination and Shading.
Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
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.
3D Rendering 2016, Fall.
Advanced Computer Graphics
Rendering Pipeline Fall, 2015.
CSE 167 [Win 17], Lecture 15: Ray Tracing Ravi Ramamoorthi
Photorealistic Rendering vs. Interactive 3D Graphics
Ray Tracing Forward Ray Tracing
3D Graphics Rendering PPT By Ricardo Veguilla.
© University of Wisconsin, CS559 Fall 2004
Image synthesis using classical optics
CS5500 Computer Graphics May 29, 2006
CSCE 441: Computer Graphics Ray Tracing
GR2 Advanced Computer Graphics AGR
Presentation transcript:

RENDERING : Global Illumination Ray Tracing (1)

What issues must be addressed by a 3D rendering system? 3D scene representation 3D viewer representation Visible surface determination Lighting simulation In order to implement this algorithm we had to address these six issues.

What issues must be addressed by a 3D rendering system? 3D scene representation 3D viewer representation Visible surface determination Lighting simulation How do we compute the radiance for each sample ray? In order to implement this algorithm we had to address these six issues. Let’s improve it

Effects needed for realism Shadows Reflections (Mirrors) Transparency Interreflections Detail (Textures etc.) Complex Illumination Realistic Materials And many more In order to implement this algorithm we had to address these six issues.

Reading Hill, Chapter 14, Sections 14.1 to 14.5 Hill, Chapter 14, Sections 14.7.1 and 14.7.2

References Hill Chapter 14 Specialized books: Online resources http://www.irtc.org/ http://www.acm.org/tog/resources/RTNews/html/ http://www.povray.org/ http://www.siggraph.org/education/materials/HyperGraph/raytrace/rtrace0.htm http://www.siggraph.org/education/materials/HyperGraph/raytrace/rt_java/raytrace.html

Graphics Pipeline Overview Properties of the Graphics Pipeline Primitives are processed one at a time All analytic processing early on Sampling occurs late Minimal state required ( immediate mode rendering) Processing is forward-mapping

Alternative Approaches There are other ways to compute views of scenes defined by geometric primitives. One of the most common is ray-casting. Ray-casting searches along lines of sight, or rays, to determine the primitive that is visible along it. from the eye through the pixel.

Properties of ray-casting: Go through all primitives at each pixel Sample first Analytic processing afterwards Requires a display list

Lighting Simulation Direct illumination Global illumination Polygon shading Ray casting Global illumination Ray tracing Radiosity Photon Mapping (…) In order to implement this algorithm we had to address these six issues.

Ray Tracing In order to implement this algorithm we had to address these six issues.

Simplest method is Ray Casting The color of each pixel on the view plane depends on the radiance emanating from visible surfaces In order to implement this algorithm we had to address these six issues. Simplest method is Ray Casting

Ray Casting / Ray Tracing Iterate over pixels, not objects. Effects that are difficult with Z-buffer, are easy with ray tracing: shadows, reflections, transparency, procedural textures and objects. Assume image plane is placed in the virtual space Direct illumination Polygon shading Ray casting Global illumination Ray tracing In order to implement this algorithm we had to address these six issues.

RAY CASTING Shoot rays through pixels into the world For each pixel: Find closest intersection in scene Evaluate illumination model to color pixel In order to implement this algorithm we had to address these six issues.

RAY CASTING For each sample … Construct ray from eye position through view plane Find first surface intersected by ray through pixel Compute color sample based on surface radiance In order to implement this algorithm we had to address these six issues.

Ray Casting Simple implementation: Image RayCast (Camera camera, Scene scene, int width, int height) { Image image = new Image(width, height); for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) { Ray ray = ConstructRayThroughPixel(camera, i, j); Intersection hit = FindIntersection(ray, scene); image[i][j] = GetColor(hit); } return image; In order to implement this algorithm we had to address these six issues.

Ray Casting Simple implementation: Image RayCast (Camera camera, Scene scene, int width, int height) { Image image = new Image(width, height); for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) { Ray ray = ConstructRayThroughPixel(camera, i, j); Intersection hit = FindIntersection(ray, scene); image[i][j] = GetColor(hit); } return image; In order to implement this algorithm we had to address these six issues.

Ray Casting Simple implementation: Image RayCast (Camera camera, Scene scene, int width, int height) { Image image = new Image(width, height); for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) { Ray ray = ConstructRayThroughPixel(camera, i, j); Intersection hit = FindIntersection(ray, scene); image[i][j] = GetColor(hit); } return image; In order to implement this algorithm we had to address these six issues.

Ray Casting Simple implementation: Image RayCast (Camera camera, Scene scene, int width, int height) { Image image = new Image(width, height); for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) { Ray ray = ConstructRayThroughPixel(camera, i, j); Intersection hit = FindIntersection(ray, scene); image[i][j] = GetColor(hit); } return image; In order to implement this algorithm we had to address these six issues.

Ray Casting Simple implementation: Image RayCast (Camera camera, Scene scene, int width, int height) { Image image = new Image(width, height); for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) { Ray ray = ConstructRayThroughPixel(camera, i, j); Intersection hit = FindIntersection(ray, scene); image[i][j] = GetColor(hit); } return image; In order to implement this algorithm we had to address these six issues.

Ray Casting Simple implementation: Image RayCast (Camera camera, Scene scene, int width, int height) { Image image = new Image(width, height); for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) { Ray ray = ConstructRayThroughPixel(camera, i, j); Intersection hit = FindIntersection(ray, scene); image[i][j] = GetColor(hit); } return image; In order to implement this algorithm we had to address these six issues.

In order to implement this algorithm we had to address these six issues.

Image image = new Image (width, height); In order to implement this algorithm we had to address these six issues. Image image = new Image (width, height);

Ray ray = ConstructRayThroughPixel (camera, i, j); In order to implement this algorithm we had to address these six issues. Ray ray = ConstructRayThroughPixel (camera, i, j);

Intersection hit = FindIntersection (ray, scene); In order to implement this algorithm we had to address these six issues. Intersection hit = FindIntersection (ray, scene);

image[i][j] = GetColor (hit); In order to implement this algorithm we had to address these six issues.

image[i][j] = GetColor (hit); In order to implement this algorithm we had to address these six issues.

Ray ray = ConstructRayThroughPixel (camera, i, j); In order to implement this algorithm we had to address these six issues. Ray ray = ConstructRayThroughPixel (camera, i, j);

Intersection hit = FindIntersection (ray, scene); In order to implement this algorithm we had to address these six issues. Intersection hit = FindIntersection (ray, scene);

image[i][j] = GetColor (hit); In order to implement this algorithm we had to address these six issues.

image[i][j] = GetColor (hit); In order to implement this algorithm we had to address these six issues.

Ray ray = ConstructRayThroughPixel (camera, i, j); In order to implement this algorithm we had to address these six issues. Ray ray = ConstructRayThroughPixel (camera, i, j);

Intersection hit = FindIntersection (ray, scene); In order to implement this algorithm we had to address these six issues. Intersection hit = FindIntersection (ray, scene);

image[i][j] = GetColor (hit); In order to implement this algorithm we had to address these six issues.

image[i][j] = GetColor (hit); In order to implement this algorithm we had to address these six issues.

Ray ray = ConstructRayThroughPixel (camera, i, j); In order to implement this algorithm we had to address these six issues. Ray ray = ConstructRayThroughPixel (camera, i, j);

Intersection hit = FindIntersection (ray, scene); In order to implement this algorithm we had to address these six issues. Intersection hit = FindIntersection (ray, scene);

image[i][j] = GetColor (hit); In order to implement this algorithm we had to address these six issues.

image[i][j] = GetColor (hit); In order to implement this algorithm we had to address these six issues.

RAY CASTING In order to implement this algorithm we had to address these six issues.

Remember: still direct illumination! RAY CASTING Direct Direct In order to implement this algorithm we had to address these six issues. Remember: still direct illumination!

RAY CASTING Comparison to scan-line (rasterization) algorithm: In order to implement this algorithm we had to address these six issues. Comparison to scan-line (rasterization) algorithm: Per-pixel evaluation, per-pixel rays (not scan-convert each object) More complex shading, lighting effects possible

Ray Casting Simple implementation: Image RayCast (Camera camera, Scene scene, int width, int height) { Image image = new Image(width, height); for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) { Ray ray = ConstructRayThroughPixel(camera, i, j); Intersection hit = FindIntersection(ray, scene); image[i][j] = GetColor(hit); } return image; In order to implement this algorithm we had to address these six issues.

Ray Casting Simple implementation: Image RayCast (Camera camera, Scene scene, int width, int height) { Image image = new Image(width, height); for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) { Ray ray = ConstructRayThroughPixel (camera, i, j); Intersection hit = FindIntersection(ray, scene); image[i][j] = GetColor(hit); } return image; In order to implement this algorithm we had to address these six issues.

Constructing Ray Through a Pixel In order to implement this algorithm we had to address these six issues.

Constructing Ray Through a Pixel 2D example: frustum half-angle distance to view plane In order to implement this algorithm we had to address these six issues.

Perspective Camera Eye point Look-At Point Up Vector Horizontal FOV (degrees) Look-At Up Eye

Perspective Ray Generation

Perspective Ray Generation

Ray Casting Simple implementation: Image RayCast (Camera camera, Scene scene, int width, int height) { Image image = new Image(width, height); for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) { Ray ray = ConstructRayThroughPixel (camera, i, j); Intersection hit = FindIntersection (ray, scene); image[i][j] = GetColor(hit); } return image; In order to implement this algorithm we had to address these six issues.

Ray-Scene Intersection Intersections with geometric primitives: Sphere Triangle Groups of primitives (scene) In order to implement this algorithm we had to address these six issues.

Ray-Sphere Intersection In order to implement this algorithm we had to address these six issues.

Ray-Sphere Intersection I Algebraic Method Substituting for P, we get: Solve quadratic equation: In order to implement this algorithm we had to address these six issues. where:

Ray-Sphere Intersection I Algebraic Method the ray and sphere do not intersect ray grazes sphere the smallest positive t corresponds to the intersection: In order to implement this algorithm we had to address these six issues.

Ray-Sphere Intersection I Algebraic Method Intersection POINT (xi, yi, zi): Intersection NORMAL: the surface normal at the intersection point P is In order to implement this algorithm we had to address these six issues. DONE! We are ready for lighting calculations!

Ray-Sphere Intersection II Geometric Method In order to implement this algorithm we had to address these six issues.

Ray-Sphere Intersection II Geometric Method In order to implement this algorithm we had to address these six issues.

Early Rejection The performance of ray casting is determined by how efficiently ray object intersections can be determined. Let's re-think the series of computations used to determine the ray-sphere intersection while looking for ways to eliminate unnecessary work.

Ray-Sphere Intersection II Geometric Method In order to implement this algorithm we had to address these six issues.

Ray-Sphere Intersection Need normal vector at intersection for lighting calculations In order to implement this algorithm we had to address these six issues.

Geometric vs. Algebraic Algebraic is simple & generic Geometric is more efficient Timely tests In particular for rays outside and pointing away

Recursive Ray-Casting Starting from the viewing position, first compute the visible object along each ray. Then compute the visibility of each light source from the visible surface point, using a new ray. If there is an object between the light source and the object point it is in shadow, and we ignore the illumination from that source. We can also model reflection and refraction similarly.

Recursive Ray-Casting: Shadows! Similar strategy for reflection and refraction!

More later on… Ray Tracing Illumination

Ray-Scene Intersection Intersections with geometric primitives: Sphere Triangle Groups of primitives (scene) In order to implement this algorithm we had to address these six issues.

Ray-Triangle Intersection Intersect ray with plane Check if point is inside triangle In order to implement this algorithm we had to address these six issues.

Ray-Plane Intersection Algebraic Method Substituting for P, we get: Solution: In order to implement this algorithm we had to address these six issues.

Ray-Triangle Intersection I Point inside triangle? Algebraic Method For each side of triangle: In order to implement this algorithm we had to address these six issues. end

Ray-Triangle Intersection II Point inside triangle? Parametric Method In order to implement this algorithm we had to address these six issues.

Other Ray-Primitive Intersections Cone, cylinder, ellipsoid: Similar to sphere Box Intersect 3 front-facing planes, return closest Convex Polygon Same as triangle (check point-in-polygon algebraically) Concave Polygon Same plane intersection More complex point-in-polygon test In order to implement this algorithm we had to address these six issues.

Ray-Scene Intersection Intersections with geometric primitives: Sphere Triangle Groups of primitives (scene) In order to implement this algorithm we had to address these six issues.

Ray-Scene Intersection In order to implement this algorithm we had to address these six issues.