380 likes | 577 Views
Realtime Caustics using Distributed Photon Mapping. Johannes Günther Ingo Wald * Philipp Slusallek Computer Graphics Group Saarland University ( * now at MPII Saarbrücken). Introduction. What is wrong with this picture?. Introduction. With caustic illumination. Outline.
E N D
Realtime CausticsusingDistributed Photon Mapping Johannes Günther Ingo Wald* Philipp Slusallek Computer Graphics Group Saarland University (*now at MPII Saarbrücken)
Introduction • What is wrong with this picture? EGSR 2004, Norrköping, Sweden
Introduction • With caustic illumination EGSR 2004, Norrköping, Sweden
Outline • Introduction & Motivation • Previous Work • Analysis of Photon Mapping • Faster Photon Mapping • Parallelization Issues • Results & Examples EGSR 2004, Norrköping, Sweden
Previous WorkCaustics • (Bidirectional) path tracing [Lafortune, Veach] • Need many samples too slow / too noisy • Density estimation [Shirley, Walter] • Use of pre-computed, view-independent illumination representation Not interactive • Particles in hierarchical radiosity system [Granier] • Particle tracing accelerated by exploiting HR structure • Still too slow for interactive use • Hardware based projection [Wand] • Implemented via texture lookups on GFX • Limited to far lights and no occluders considered • Only reflective caustic generators EGSR 2004, Norrköping, Sweden
Previous Work Photon Mapping • Photon map [Jensen] • Preferred tool for caustics • Independent of scene geometry • But problematic for interactive use (later) • Hashed photon mapping [Wald] • Approximation lower quality • On programmable graphics hardware [Purcell] • Also approximative • Limited performance (interactive only at low resolution) • No caustics during interaction • Simple scenes EGSR 2004, Norrköping, Sweden
Outline • Introduction & Motivation • Previous Work • Analysis of Photon Mapping • Faster Photon Mapping • Parallelization Issues • Results & Examples EGSR 2004, Norrköping, Sweden
Analysis – Overview Photon Map: • Preprocessing • Photon generation • Construction of kd-tree • Queries during rendering • Search k-nearest photons Density estimation EGSR 2004, Norrköping, Sweden
Analysis • Interactivity: now ‘pre’processing every frame • High quality caustic: > 100K photons • No problem with realtime ray tracing (>4Mrays/s)? • Low caustic photon yield • Several rays per photon • Only few photons contribute to caustics(in many cases below 10%) • Slow photon shooting • Incoherent rays slow ray tracing, no SSE • Costly light source and BRDF sampling(up to 60% of total shooting time) 4-15 times slower EGSR 2004, Norrköping, Sweden
Analysis • Building kd-tree • Serious problem with many photonscomplexity O(n log n) • Hard to parallelize • Small changes in map complete rebuild • Queries are costly • Traversal of kd-tree • Density estimation About 10 times as expensive as tracing a ray Have to address all of these problems EGSR 2004, Norrköping, Sweden
Outline • Introduction & Motivation • Previous Work • Analysis of Photon Mapping • Faster Photon Mapping • Parallelization Issues • Results & Examples EGSR 2004, Norrköping, Sweden
Selective Photon Tracing [Dmitriev] • Adaptive sampling in path space • Exploiting similarity property of Halton numbers • Indirect caustics captured • Improve yield by factor 4 EGSR 2004, Norrköping, Sweden
Improve kd-tree • Balancing kd-tree requires costly median finding • Instead: “split in middle” • Spatial center of current voxel • Now unbalanced Construction 1.5-4 times faster EGSR 2004, Norrköping, Sweden
Improve kd-tree • Balancing kd-tree requires costly median finding • Instead: “split in middle” • Spatial center of current voxel • Now unbalanced Construction 1.5-4 times faster • Not intuitive: also traversal faster [Wald ’04] • Better adaptation to photon density Query 1.5-2.5 times faster EGSR 2004, Norrköping, Sweden
Accumulation of Photons • Performance still not enough for high quality Improve quality by accumulation across frames • kd-tree with “split in middle” allows augmentation • Accumulated result is view-independent! High quality walkthrough EGSR 2004, Norrköping, Sweden
Outline • Introduction & Motivation • Previous Work • Analysis of Photon Mapping • Faster Photon Mapping • Parallelization Issues • Results & Examples EGSR 2004, Norrköping, Sweden
27k photons 5x5 interleaving filtered Interleaved Sampling & Filtering [Keller] • Quality comparable to 25 x 27k = 680k photons EGSR 2004, Norrköping, Sweden
FilteringCaustic Illumination • Originally: restrict filtering to smooth regions • Continuity tests on server limits to 5fps (IGI [Wald ’02]) But: • Only filter caustic illumination • Potential artifacts less visible No need for costly discontinuity checks New: • Simple box filter efficient implementation • SSE, cache friendly, independent of filter size • Performance: CPU 300 fps, network now ~22 fps EGSR 2004, Norrköping, Sweden
Outline • Introduction & Motivation • Previous Work • Analysis of Photon Mapping • Faster Photon Mapping • Parallelization Issues • Results & Examples EGSR 2004, Norrköping, Sweden
Performance • Scalability: roughly linear • Upper limit: about 22 fps (network bounded) EGSR 2004, Norrköping, Sweden
Comparison to IGI [Wald ’02] • Same #clients (9) and frame rate (4.8 fps) new system IGI system 2600 phs 8000 phs 2500 phs 16000 phs EGSR 2004, Norrköping, Sweden
Examples • Indirect caustics • No performance drop EGSR 2004, Norrköping, Sweden
Examples • Headlight simulation • Complex model • Many layers of glass • Pointlights inside bulbs • Using 18 Dual clients 250k phs / 3 fps 25M phs / 11 fps EGSR 2004, Norrköping, Sweden
Examples • Headlight simulation • Complex model • Many layers of glass • Pointlights inside bulbs • Using 18 Dual clients 250k phs / 3 fps 25M phs / 11 fps photo EGSR 2004, Norrköping, Sweden
Video EGSR 2004, Norrköping, Sweden
Conclusion • Improvements on all aspects of the photon map • Improved yield by Selective Photon Tracing • Optimized kd-tree (construction and traversal) • Efficient parallelization • Interleaved Sampling • Faster filtering Realtime caustic simulation High quality walkthrough Linear scalability, up to 22 fps EGSR 2004, Norrköping, Sweden
Questions ? Questions ? EGSR 2004, Norrköping, Sweden
5x5 filter, blurring over edges hardly visible No discontinuity buffer? EGSR 2004, Norrköping, Sweden
Photon Map Two pass approach: • Preprocessing • Generation • Emit photons into scene • Trace path until absorption • Construction of kd-tree • For fast retrieval of hit points • During rendering (ray tracing) • At each point to shade: do query • Search k-nearest photons • Accumulate power & divide by occupied area • Density estimation Concentrate on caustics EGSR 2004, Norrköping, Sweden
Client-Server Approach • High computational cost need parallelization • even more necessary with photon mapping • Commodity PCs • 24 Dual-AthlonMP 1800+ • For ray tracing • “Thin” clients: 100 Mbit Ethernet, no graphics card, ... • 1 server node • Runs application, controls clients, etc. • Fully switched 100MBit network • Gigabit uplink to server EGSR 2004, Norrköping, Sweden
Outlook • Combination with Instant Radiosity / IGI2 to add indirect illumination • Further improve sampling and caustic photon yield • Still need a cluster Special Hardware (e.g. SaarCOR) EGSR 2004, Norrköping, Sweden
Goal • Generate and visualize caustic light effects • Interactive frame rates • At video resolution 640x480 • Support complex scenes • Preview quality acceptable during scene modifications • High quality walkthroughs EGSR 2004, Norrköping, Sweden
Improve Yieldof Caustic Photons • Cannot help on #rays per photon path • But: improve efficiency of sampling • Jensen: • Project caustic generators onto (hemisphere of) light sources, sample only occupied solid angle • Captures only direct caustics • Mesh dependent, not in realtime • Wald: • Project only bounding volume • Geometry independent • Bounding volume often too coarse approximation • Requires manual user interaction / scene preparation EGSR 2004, Norrköping, Sweden
Distribution Options • Generate same photon map on each client • Inefficient, only rendering/queries in parallel • Not scalable • Generate different parts of photon map on clients • Need exchange of photons • But: network bandwidth too small • Rendering can only start after receiving all photons latency • Generate different photon maps on clients • Combine illumination on server by interleaving pixels • Reduce noise by filtering in image space Interleaved sampling & discontinuity buffering [Keller] EGSR 2004, Norrköping, Sweden