Photon Mapping Combines “backward”/ “reverse” ray tracing Photon Mapping with stochastic ray tracing Used to simulate the interaction of light with a variety transparent substances (caustics) Glass Water Diffuse Inter-reflections between illuminated objects Effects of particulate matter Smoke Water vapor Photon Mapping - Motivation Photon Mapping Henrik Wann Jensen 95/96 Simulates the transport of individual photons emitted from light sources Photons bounce off specular surfaces Photons deposited on diffuse surfaces Photons collected by ray tracing from eye http://www.ypoart.com/ Without With Spatial Subdivision Spatial Subdivision The collected photons will need to be Subdivide your scene volume into hierarchical regions stored in an efficient, 3D accessible Octrees BSP Trees data structure K-D Trees Create a tree structure that indicates for each region: if the region is empty Spatial subdivision algorithms subdivide the object present at that particular region Used in the 3D space for quick and easy query. Ray Tracing Collision detection (animation) Photon Mapping 1
Octrees Spatial Subdivision Subdivision algorithm Volume is subdivided into 4 equal Recursively subdivide volume regions. If subregion is empty or contains a predefined # Each iteration results in 8 subdivisions. of objects, then stop Otherwise, further subdivide. Continue until each subregion is empty or contains a predefined #of objects. Use tree to represent subdivision hierarchy Octrees Oct(quad)trees Subdivisions represented as a tree [Foley/Van Dam] [Watt/Watt,244] Octrees Oct(quad)trees Quadtree applet Images from http://www.flipcode.com/tutorials/tut_octrees.shtml http://njord.umiacs.umd.edu:1601/users/brab ec/quadtree/points/pointquad.html 2
Octrees Octrees BSP Trees Spatial Subdivision Binary Space Partitioning Trees (BSP Octrees vs BSP Trees Trees) Like Octrees but divides space into a pair of subregions Subregions need not be equally spaced Planes separating regions can be placed at object boundaries. [Watt/Watt,246] BSP Trees K-d Trees BSP Trees – Each non-terminal node represents a single K-d Tree is a BSP where dividing planes partitioning plane that divides space in two are axis aligned K-d Tree applet http://donar.umiacs.umd.edu/quadtree/ points/kdtree.html [Watt/Watt,247 ] 3
Spatial Subdivision Spatial Subdivision Advantages Octrees vs BSP trees Efficient means for finding objects within your BSP Trees are generally more balanced space than Octrees Compact representation BSP Traversal more efficient Disadvantages Preprocessing required BSP Trees have additional storage If scene changes, must rebuild your tree overhead as must store subdivision planes Not foolproof Now back to photon mapping Photon Mapping Photon Mapping Pass 1 – Shoot and Store Photons Shooting photons photons are shot from the light into the scene. Photons are allowed to interact with objects in the environment Where photons fall are stored in a special data structure called a “photon map” point directional square general 1000s of photons not billions Statistical approximation based on density [Jensen 2002] Photon Mapping Photon Map Photon Scattering The photon Placed in k-d tree for efficient access [Jensen 2002] 4
Photon Mapping Monte Carlo methods Pass 2 – Gather illumination Driven by chance / randomness Use ray tracing Rendering and Monte Carlo Direct illumination determined by ray Multiple rays per pixel tracing See how many reach a light Indirect illumination determined by Multiple rays from light stochastically sampling photon map See how many reach the eye Gather photon within a volume in the required Photon Mapping direction. Goes from both sides Photon Mapping - Caustics Caustics Pattern of light focused on a surface after having original light path bent by intermediate surface. Reflective caustics Refractive caustics Yves Poissant [Jensen] Photon Mapping Photon Mapping Three separate photon maps Global – photon emitted toward all objects Caustics – specular to diffuse interactions Volume – for volumetric effects caustic global 5
Example Example -- Caustics [Jensen 1996] [Jensen 1996] The Light of Mies van der Rohe Photon Mapping in real time But doesn’t this take a long time. No, grasshopper…not with GPUs… Let’s go to the video. 2000ET Want to learn more? Summary Fixing ray tracing Spawning complex structures (cones, cylinders, etc.) Stochastic sampling (distributed ray tracing, monte carlo) “backwards” ray tracing (Photon Mapping) Questions 6
Recommend
More recommend