advanced computer graphics cs vpl based rt gi...

45
Advanced Computer Graphics CS 563: VPLbased RTGI Techniques William DiSanto Computer Science Dept. Worcester Polytechnic Institute (WPI)

Upload: others

Post on 10-Aug-2021

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Advanced Computer Graphics CS 563: VPL‐based RT‐GI Techniques

William DiSanto

Computer Science Dept.Worcester Polytechnic Institute (WPI)

Page 2: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Instant Radiosity 1997 Keller Fast and physically accurate Models diffuse lighting

Page 3: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Virtual Point Light Hemispherical light with cosine falloff Positioned by emitting particles from light source Some way to end bounces

Page 4: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Derivation of Instant Radiocity

Rendering Equation

Operator R: Express as sum of indirect illumination

Page 5: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Derivation of Instant Radiocity

Express rendering equation as an integration over the observable light from first hit surface

Express surface lighting term by sampling direct and indirect paths

Page 6: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Rendering Operator: Reflect >= 1

Express Rendering Equation as sampling along variable length paths Function V could be visibility from AO (inviting error)

Compute Indirect: over Path Lengths (j), Pixels, Paths, and Light Sources

Page 7: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Derivation of Instant Radiocity

Radiance after j reflections:

Assume perfectly diffuse BRDF (constant term)

Page 8: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

IR ResultSamples from Area Light

Bounces

Page 9: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Making the Algorithm Practical

Limit number of samples virtual point lights and number of bounces  Proportional to reflectivity of the media Assume less the perfect reflection ( < 1)

Compute light observed in terms of radiance from original light source propagated over some number of bounces

Page 10: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Implementation of Instant Radiocity

Start with N particles at light

Determine samples remaining

Select a originator from light source

Trace through reflections

Loop until no samples are left

: Light Power: Average Diffuse: Projection Direction

Next Slide

Page 11: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Implementation of Instant Radiocity

Render all 1st 2nd, 3rd bounce VPLs together

All radiation from a sample particle rendered in one iteration

: hit point: diffuse attenuation:random direction

Page 12: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Sampling

Random  Jitter  Halton

Page 13: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Omni‐Directional RSMs

Page 14: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Problems with IR

Requires many renders, possibly shadow maps

Requires many VPLs 100+ for static scene Interactive rates reached with averaging renders

1000+ for dynamic scene

Page 15: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Problems with IR

Specular surfaces reveal locations of VPLs

Page 16: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Problems with IR

Render many detailed shadow maps

Page 17: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Incremental Instant Radiosity

Scenes can be rendered fairly accurately with only one bounce

Use Reflective Shadow Map to distribute first bounce Virtual Point Lights

Page 18: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Incremental Instant Radiosity

Reuse VPLs from previous renders Budget 4‐8 new VPLs per new frame

Allows for moving light sources Assumes a static scene (could be large) Good frame rates 40+ 

Page 19: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Procedure: Find Bad VPLs 1. Determine valid VPLs 2. Remove invalid VPLs Occluded from light source Behind view of light source

Page 20: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Procedure: Find Bad VPLs Generate Voronoi Diagram and Delaunay Triangulation for 

point set (left) Some VPLS may be removed if they contribute to regions 

where virtual point light density is too great (right) Characterized by having short edge lengths

Page 21: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Procedure: Seed VPLs 3.a Create VPLs within budget and render SMs

Long edges are good places to seed new VPLs

4. Compute new Voronoi Area and weight intensity for VPLs accordingly 

Page 22: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Procedure: Project

3.b    Render Shadow maps for new VPLs Project new VPL distribution onto hemisphere

Page 23: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Procedure: Render 5. Perform deferred render pass  store: position, normals, color

6. Tile the G‐Buffer (will reduce texture lookups) 7. Loop over tiles use subset of VPLs to color each tile, results in noise 

Page 24: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Procedure: Recombine + Smooth

8. Combine tiles back into full resolution image 9. Use spatially aware box filter (example on 4x4 tiling) Same size as tiling May require some tuning

Page 25: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

IIR: Results

Page 26: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

IIR: Problems  Diffuse surfaces only  View dependent Dynamic scenes will have lagging shadows This GI takes 70+ % of rendering budget

Does have nice overall render times

Page 27: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Imperfect Shadow Maps

Attempts indirect illumination for dynamic scenes For many scenes: Indirect illumination varies smoothly Each VPL has a small contribution

Page 28: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Imperfect Shadow Maps

Depth Renders do not need to be terribly accurate Attempt to render 1000+ ISMs

Page 29: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Procedure: VPL Generation

Render Omni‐Directional RSM Randomly seed VPLs by importance (some PDF) 

Page 30: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Procedure: Pre‐Processing Randomly sample geometry Select triangles with probability proportional to area

Select a random 3D point on each selected triangle 

Store barycentric coordinates with points Used to calculate normal and reflectance 

Page 31: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Procedure: ISM Generation Each VPL selects a sub sample of points Points are splat onto each depth map (GL_Points)  Dynamic scenes are handled by deforming points

Page 32: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Procedure: Pull Push Interpolation Vertex buffer distributes points to ISMs evenly Gaps are filled with push‐pull, errors average out 

Page 33: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Procedure: Pull Push Interpolation Interpolation performed in texture space Parallel operation Averaging of all ISM increases shadow smoothness 

Page 34: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Procedure: Interleaved Sampling Filter indirect light separately from direct light Indirect light is interleaved  Same as in incremental instant radiocity May need to tune parameters

Page 35: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Procedure: Multiple Bounces Distribute from cube maps of omni‐directional light

1024 VPLs first bounce (left) + 256 VPLs second bounce (middle) + 256 VPLs third bounce (right)

Page 36: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Problems

Works best with low gloss surfaces Arbitrary tuning Will not operate the same for every scene For different kinds of lighting

As of 2009 offers only interactive frame rates Does not scale well for large scenes Indirect lighting still accounts for the majority of the render budget

Page 37: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Results: Complex Geometry 

Extends well to arbitrary shapes 1024 VPLs 256x256 with subset of 4,000 points each

Page 38: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Results: Direct Lighting Complex area lights

512 VPLS 256x256 with subset of 8,000 points each

Page 39: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Results: Glossy  4096 VPLs, 64x64 resolution, subset of 2,000 points each Problem with hard shadows

Page 40: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Results: Environmental Maps  Direct Environment Lighting

1024 VPLs 256x256 with subset of 8,000 points each

Page 41: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Results: Sponza Scene

7 ms VPL generation 44 ms ISM 8 ms Pull‐Push

15 ms Rendering 4 ms Blur 11 ms Direct Lighting

Page 42: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Results: Accuracy  

Parameters can be manually adjusted to fit the scene(splat size, resolution, point samples)

Page 43: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

Results: Render Time 

Page 44: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

References

Alexander Keller, Instant Radiosity, Proceedings of the 24th annual conference on Computer graphics and interactive techniques, p.49‐56, August 1997

Laine, S., Saransaari, H., Kontkanen, J., Lehtinen, J., and Aila, T. 2007. Incremental Instant Radiosity for Real‐Time Indirect Illumination. In Proc. of the Eurographics Symposium on Rendering, 277‐‐286.

Page 45: Advanced Computer Graphics CS VPL based RT GI Techniquesweb.cs.wpi.edu/.../cs563_Will_Disanto_vpl_gi_wk7_p1.pdf · 2012. 2. 29. · Carsten Dachsbacher , Jan Kautz, Real‐time global

References

T. Ritschel , T. Grosch , M. H. Kim , H.‐P. Seidel , C. Dachsbacher , J. Kautz, Imperfect shadow maps for efficient computation of indirect illumination, ACM Transactions on Graphics (TOG), v.27 n.5, December 2008

Carsten Dachsbacher , Jan Kautz, Real‐time global illumination for dynamic scenes, ACM SIGGRAPH 2009 Courses, p.1‐217, August 03‐07, 2009, New Orleans, Louisiana