Chapter 11 Global Illumination. Part 1 Ray Tracing. Reading: Angel s Interactive Computer Graphics (6 th ed.) Sections 11.1, 11.2, 11.

Similar documents
Ray Tracing III. Wen-Chieh (Steve) Lin National Chiao-Tung University

Acceleration Data Structures

Accelerated Raytracing

Spatial Data Structures

Spatial Data Structures

Topic 12: Texture Mapping. Motivation Sources of texture Texture coordinates Bump mapping, mip-mapping & env mapping

Topic 11: Texture Mapping 11/13/2017. Texture sources: Solid textures. Texture sources: Synthesized

CS580: Ray Tracing. Sung-Eui Yoon ( 윤성의 ) Course URL:

Topic 11: Texture Mapping 10/21/2015. Photographs. Solid textures. Procedural

Computer Graphics. Bing-Yu Chen National Taiwan University The University of Tokyo

Announcements. Written Assignment 2 out (due March 8) Computer Graphics

Computer Graphics (CS 543) Lecture 13b Ray Tracing (Part 1) Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Spatial Data Structures

Ray Tracing. Cornell CS4620/5620 Fall 2012 Lecture Kavita Bala 1 (with previous instructors James/Marschner)

Sung-Eui Yoon ( 윤성의 )

Ray Tracing. CSCI 420 Computer Graphics Lecture 15. Ray Casting Shadow Rays Reflection and Transmission [Ch ]

Ray Tracing. Computer Graphics CMU /15-662, Fall 2016

Spatial Data Structures

CPSC GLOBAL ILLUMINATION

Anti-aliased and accelerated ray tracing. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

Global Rendering. Ingela Nyström 1. Effects needed for realism. The Rendering Equation. Local vs global rendering. Light-material interaction

Last Time: Acceleration Data Structures for Ray Tracing. Schedule. Today. Shadows & Light Sources. Shadows

COMP371 COMPUTER GRAPHICS

Lighting. To do. Course Outline. This Lecture. Continue to work on ray programming assignment Start thinking about final project

Anti-aliased and accelerated ray tracing. University of Texas at Austin CS384G - Computer Graphics

Announcements. Written Assignment2 is out, due March 8 Graded Programming Assignment2 next Tuesday

Computer Graphics. - Ray-Tracing II - Hendrik Lensch. Computer Graphics WS07/08 Ray Tracing II

Advanced Ray Tracing

Computer Graphics. - Spatial Index Structures - Philipp Slusallek

Computer Graphics. Bing-Yu Chen National Taiwan University

Ray tracing. EECS 487 March 19,

Speeding Up Ray Tracing. Optimisations. Ray Tracing Acceleration

Ray Intersection Acceleration

Consider a partially transparent object that is illuminated with two lights, one visible from each side of the object. Start with a ray from the eye

Ray Tracing Acceleration Data Structures

Today. Acceleration Data Structures for Ray Tracing. Cool results from Assignment 2. Last Week: Questions? Schedule

Effects needed for Realism. Computer Graphics (Fall 2008) Ray Tracing. Ray Tracing: History. Outline

Ray Casting. Outline in Code. Outline. Finding Ray Direction. Heckbert s Business Card Ray Tracer. Foundations of Computer Graphics (Fall 2012)

Ray-tracing Acceleration. Acceleration Data Structures for Ray Tracing. Shadows. Shadows & Light Sources. Antialiasing Supersampling.

Spatial Data Structures

Global Illumination The Game of Light Transport. Jian Huang

Questions from Last Week? Extra rays needed for these effects. Shadows Motivation

CS 431/636 Advanced Rendering Techniques

I have a meeting with Peter Lee and Bob Cosgrove on Wednesday to discuss the future of the cluster. Computer Graphics

EECS 487: Interactive Computer Graphics

VIII. Visibility algorithms (II)

Visible-Surface Detection Methods. Chapter? Intro. to Computer Graphics Spring 2008, Y. G. Shin

Computer Graphics 1. Chapter 7 (June 17th, 2010, 2-4pm): Shading and rendering. LMU München Medieninformatik Andreas Butz Computergraphik 1 SS2010

Ray Tracing. Foley & Van Dam, Chapters 15 and 16

Ray Tracing Foley & Van Dam, Chapters 15 and 16

Spatial Data Structures and Speed-Up Techniques. Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology

Ray Casting. To Do. Outline. Outline in Code. Foundations of Computer Graphics (Spring 2012) Heckbert s Business Card Ray Tracer

Logistics. CS 586/480 Computer Graphics II. Questions from Last Week? Slide Credits

Rendering: Reality. Eye acts as pinhole camera. Photons from light hit objects

Photorealism: Ray Tracing

MIT Monte-Carlo Ray Tracing. MIT EECS 6.837, Cutler and Durand 1

Effects needed for Realism. Ray Tracing. Ray Tracing: History. Outline. Foundations of Computer Graphics (Spring 2012)

Ray Tracing. Johns Hopkins Department of Computer Science Course : Rendering Techniques, Professor: Jonathan Cohen

Ray Tracing: Intersection

Ray Tracing. CS334 Fall Daniel G. Aliaga Department of Computer Science Purdue University

CEng 477 Introduction to Computer Graphics Fall 2007

Schedule. MIT Monte-Carlo Ray Tracing. Radiosity. Review of last week? Limitations of radiosity. Radiosity

INFOGR Computer Graphics. J. Bikker - April-July Lecture 10: Ground Truth. Welcome!

Ray tracing. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 3/19/07 1

Intersection Acceleration

Distribution Ray Tracing

Recursive Ray Tracing. Ron Goldman Department of Computer Science Rice University

INFOGR Computer Graphics. J. Bikker - April-July Lecture 11: Acceleration. Welcome!

Other Rendering Techniques CSE 872 Fall Intro You have seen Scanline converter (+z-buffer) Painter s algorithm Radiosity CSE 872 Fall

So far, we have considered only local models of illumination; they only account for incident light coming directly from the light sources.

Point Cloud Filtering using Ray Casting by Eric Jensen 2012 The Basic Methodology

Ray Tracing with Spatial Hierarchies. Jeff Mahovsky & Brian Wyvill CSC 305

Illumination Algorithms

Accelerating Ray Tracing

Global Illumination. Global Illumination. Direct Illumination vs. Global Illumination. Indirect Illumination. Soft Shadows.

Motivation. Sampling and Reconstruction of Visual Appearance. Effects needed for Realism. Ray Tracing. Outline

Ray Intersection Acceleration

Identifying those parts of a scene that are visible from a chosen viewing position, and only process (scan convert) those parts

Accelerating Ray-Tracing

Photorealism. Photorealism: Ray Tracing. Ray Tracing

Computer Graphics. Si Lu. Fall uter_graphics.htm 11/22/2017

Global Illumination. CSCI 420 Computer Graphics Lecture 18. BRDFs Raytracing and Radiosity Subsurface Scattering Photon Mapping [Ch

Distributed Ray Tracing

CMSC427 Advanced shading getting global illumination by local methods. Credit: slides Prof. Zwicker

Photorealistic 3D Rendering for VW in Mobile Devices

Anti-aliasing and Monte Carlo Path Tracing. Brian Curless CSE 557 Autumn 2017

Today. Anti-aliasing Surface Parametrization Soft Shadows Global Illumination. Exercise 2. Path Tracing Radiosity

Reading. Distribution Ray Tracing. BRDF, revisited. Pixel anti-aliasing. ω in. Required: Shirley, section Further reading:

Anti-aliasing and Monte Carlo Path Tracing. Brian Curless CSE 457 Autumn 2017

Advanced 3D-Data Structures

Ray Tracing. Outline. Ray Tracing: History

Solid Modeling. Thomas Funkhouser Princeton University C0S 426, Fall Represent solid interiors of objects

Global Illumination. Global Illumination. Direct Illumination vs. Global Illumination. Indirect Illumination. Soft Shadows.

Distribution Ray-Tracing. Programação 3D Simulação e Jogos

Scene Management. Video Game Technologies 11498: MSc in Computer Science and Engineering 11156: MSc in Game Design and Development

Physically Realistic Ray Tracing

CHAPTER 1 Graphics Systems and Models 3

CS 563 Advanced Topics in Computer Graphics Culling and Acceleration Techniques Part 1 by Mark Vessella

Accelerating Geometric Queries. Computer Graphics CMU /15-662, Fall 2016

Distribution Ray Tracing. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

Transcription:

Chapter 11 Global Illumination Part 1 Ray Tracing Reading: Angel s Interactive Computer Graphics (6 th ed.) Sections 11.1, 11.2, 11.3 CG(U), Chap.11 Part 1:Ray Tracing 1

Can pipeline graphics renders images like these? Picture from http://www.graphics.cornell.edu/online/realistic/ 2

Global Illumination Local (direct) lighting The calculations depend on only the surface material properties, surface s local geometry, and parameters of the light sources Can be added to a fast pipeline graphics architecture No shadow, indirect lighting (reflection, refraction) 3

Global Illumination Global (indirect) lighting Evaluate the light reflected from a surface point taking into account all illumination that arrives at the point, including Direct light, indirect light reflected or refracted from other object Lighting is a recursive process and amounts to an integral equation, the rendering equation 4

Global Illumination Global (indirect) lighting Ray tracing Specular interreflection/refraction Hard shadow Ok for dynamic scenes Radiosity Diffuse interreflection between polygons Soft shadow Good for static scenes Need to compute the form factor between polygon pairs and radiosity for each polygon» Costly, done in preprocessing Render using pipeline 5

Forward vs. backward ray tracing Starting at the light Starting at the eye 6

Recursive ray tracing HSR ray tracing or ray casting (one pass) Computes the visible point for each pixel and then determine the local illumination. Recursive ray tracing Incorporate the following in a single framework HSR Global specular interaction by simulating indirect reflection and refraction of light Hard-shadow calculation 7

Recursive ray tracing Examples -1 by J. L. Lin 8

Recursive ray tracing Examples -2 by J. L. Lin 9

Recursive ray tracing Examples -3 by J. L. Lin 10

Recursive ray tracing Examples -4 by J. L. Lin 11

Recursive ray tracing Another example 12

Recursive ray tracing -1 Ray: a ray from eye through a pixel Recursive ray tracing At each ray-object intersection, a reflected and a refracted ray are fired to trace the light ray propagation. L R L V R V T 13

Recursive ray tracing -2 Ray termination Termination of recursive ray tracing Always terminate if a ray intersects a diffuse surface. Can terminate when a pre-set depth of trace has been reached. Can terminate when the energy of the ray has dropped below a threshold. 14

Recursive ray tracing -3 Ray tracing tree 15

Recursive ray tracing -4 Intensity calculation Pixel s RGB is the intensity at the first ray-object intersection. at each ray-object intersection, the RGB at that point is obtained by I I local k rg I reflected k tg I refracted 16

Recursive ray tracing -5 Main program Select a COP and window on the view plane for each scan line in the window do for each pixel p in the scan line do begin TraceRay(COP, p-cop, 1, pixel_color) end 17

Recursive ray tracing -6 TraceRay() TraceRay(start, direction, depth, var color: colors) begin end if depth > max_depth then color:=black else begin Intersect ray with all objects and find intersection point p that is closest to start; if no intersection then color:=background_color; else begin local_color:=. end Compute reflection direction r TraceRay(p, r, depth+1, reflected_color); Compute refraction direction t TraceRay(p, t, depth+1, refracted_color); Combine(color, local_color, k_local, end reflected_color, k_reflection, refracted_color, k_refraction); 18

Recursive ray tracing -8 Shadow Fire a shadow ray at a visible ray-object intersection. If the shadow ray is interrupted, the point is under shadow Shadow effect Assume the objects are wholly opaque Reduce the local term to the ambient value Produces sharp shadow boundary 19

Recursive ray tracing -8 Shadow using light buffer -1 Light buffer A cube of six faces with the point light source as center, and whose faces are partitioned to cells Set-up All polygons are projected to each face using the light position as the COP Each cell contains a list of polygons that can be seen from the light source through the cell The polygon are sorted in ascending order of the depth 20

Recursive ray tracing -8 Shadow using light buffer -2 Shadow testing Find the cell that the shadow ray passes Check to see if there is a polygon on the cell s sorted list that occludes the point Polygon may partially cover the cell 21

Speed-Up Methods Adaptive depth control Bounding volume and hierarchical BV First-hit speed up Spatial scene coherence Uniform partition Octree Binary Space Partition KD tree 22

Speed-Up Methods Bounding volume Bounding box aims to avoid unnecessary intersection computations. Efficiency gained depends on how small the void area is. Examples of bounding volume Bounding sphere Bounding box Axis-aligned bounding box (AABB) Oriented bounding box (OBB) 23

Speed-Up Methods Bounding volume Sphere AABB OBB 24

Speed-Up Methods Hierarchical bounding volume Hierarchical bounding volume provides an even better void area ratio, and a hierarchical testing steps. Hierarchical bounding sphere Hierarchical axis-aligned bounding box Hierarchical oriented bounding box 25

Speed-Up Methods Bounding volume hierarchy Objects in close spatial proximity form a cluster, and recursive clustering form a BV hierarchy. Difficulties Potential clustering and depth of the hierarchy depend on the nature of the scene. 26

Speed-Up Methods Spatial partition Scene space is subdivided into regions such that each region either is empty or contains only a small set of objects. Only regions intersected by the ray are checked and in a near-to-far order. The checking stops once an intersection is found. Rendering time can be relatively constant and independent on the scene complexity. 27

Speed-Up Methods Uniform partition Easy to implement, Easier for next-region search Hard to set a good cell-size More space requirement Poor results for inhomogeneous scenes See http://www.mpi-inf.mpg.de/departments/irg3/ws0506/cg/slides/08-rt-acceleration.pdf 28

Speed-Up Methods Uniform partition Grid traversal Requires enumeration of voxel along ray, by, ex., 3D-DDA Simple and hardware-friendly See http://www.mpi-inf.mpg.de/departments/irg3/ws0506/cg/slides/08-rt-acceleration.pdf 29

Speed-Up Methods Uniform partition Objects in multiple voxels Store only references Original mailbox uses ray-id stored with each triangle Simple, but likely to destroy CPU caches Use mailboxing to avoid multiple intersection computations Store (ray, object)-tuple in small cache Do not do intersect test if found in cache 30

Speed-Up Methods Uniform partition 31

Speed-Up Methods Uniform partition Object A: tested only once in voxel 1 and the intersection need to be cached as a mailbox. Note in voxel 1: The voxel tracking process can only be terminated when the closest intersection in contained within the current voxel. 32

Speed-Up Methods Octree Adjust to object distribution in the scene Start with bounding box of entire scene Recursively subdivide voxels into 8 equal subvoxels Stopping criteria Too many triangles & maximum depth Problems Each leaf of the octree Contains no object, or Contains objects less than a preset number, or Contains more objects than the preset n umber but has size less than a preset size. 33

Speed-Up Methods Octree 34

Speed-Up Methods Tracing with octree Tracking a ray in octree Starts from the cell first intersected by the ray The ray is tested for intersections with objects lie over this cell The first intersection encountered is the one Tracks to the next cell if there is no intersections. 35

Speed-Up Methods Find the next cell A naive way Derive a point on the ray a short distance into the next cell and search the cell containing the point by a upwardly and downwardly traversal on the octree. Glassner s hash table Derive a hash table contains an entry for each cell Point s coordinate as a code to access the table Fujimoto s SEADS SEADS structure + 3D-DDA algorithm 36

Speed-Up Methods SEADS and 3D-DDA SEADS (Spatially Enumerated Auxiliary Data Structure) A 2x2x2 uniform grid by dividing the cell into equally sized cells. Enable very fast tracking using 3D-DDA Octree + SEADS Standard octree with each leaf a SEADS Traversal in octree Internal nodes: standard octree traversal Within leaf (SEADS): 3D-DDA 37

Speed-Up Methods BSP Binary space partitioning tree (BSP tree) Even more flexible than octree In 3-D, split with cutting plane Useful for Painter s algorithm Sorts the polygons into a back-to-front order Ray tracing uses axis-aligned cutting plane for easier next-cell search 38

Speed-Up Methods BSP 39

Scene spatial coherence BSP tree Each internal node representing a single partition plane that partition the occupied space into two A leaf node represents a cell that contains a small set of objects (1 or 2) The partition planes are usually axisaligned this simplifies the next-cell search Position of the partition plane depends on the object s distribution within the scene 40

Speed-Up Methods K-D tree k-dimensional tree (k-d tree) Is a binary tree, split at arbitrary interior point Split one dimension at a time Good for neighborhood search 41

RRT s problems in quality Point light source vs. area light source Aliasing (due to point sampling) Area sampling : Cone tracing, beam tracing, pencil tracing Stochastic sampling: Distributed ray tracing Specular-to-specular interaction Perfect reflection/refraction, No specular spreading Beam tracing, pencil tracing Distributed ray tracing Specular-to-diffuse interaction Backward ray/beam tracing Photon mapping Diffuse-to-diffuse interaction Combining ray tracing and radiosity 42

Quality improvements Pinhole cameras No depth of field; everything in focus Instantaneous shutters No motion blur; objects complete still 43

Recursive ray tracing -13 Problems RRT can not handle Specular highlight Some light propagations Diffuse-to-diffuse propagation Specular-to-diffuse propagation 44

4 types of light transport 45

Why ray tracing looks fake Hard shadow vs. soft shadow 46

Why ray tracing looks fake Sharp mirrors vs. blurry reflection 47

Why ray tracing looks fake Sharp mirrors vs. blurry reflection [Interactive DRT, Boulos et al.] 48

Why ray tracing looks fake Without/with depth of field 49

Why ray tracing looks fake Without/with depth of field [Interactive DRT, Boulos et al.] 50

Why ray tracing looks fake Motion blur 51

Why ray tracing looks fake Motion blur [Interactive DRT, Boulos et al.] 52

Distributed Ray-Tracing[Cook`84] Stochastic sampling Pixel: Anti-Aliasing Lens: Depth-of-Field BRDF: Glossy reflections Illumination: extended light sources Time: motion-blur 53