Radiance Cache Splatting: A GPU-Friendly Global Illumination Algorithm
description
Transcript of Radiance Cache Splatting: A GPU-Friendly Global Illumination Algorithm
Radiance Cache Splatting:A GPU-Friendly Global Illumination Algorithm
P. Gautron J. Křivánek
K. Bouatouch S. Pattanaik
EGSR 2005 – Konstanz, Germany 2
Global IlluminationWhy?
Direct Indirect
Global Illumination
EGSR 2005 – Konstanz, Germany 3
Global IlluminationHow?
Lo(P, ωo) ∫ Li(P, ωi)= * BRDF(ωo, ωi) *cos(θ)dωi
EGSR 2005 – Konstanz, Germany 4
Global IlluminationHow?
Lo(P, ωo) ∫ Li(P, ωi)= * BRDF(ωo, ωi) *cos(θ)dωi
No analytical solution
Numerical methods
- Radiosity
- Photon mapping- Path tracing- Bidirectional path tracing
- Irradiance & Radiance caching- …
EGSR 2005 – Konstanz, Germany 5
GPUs
GPUSpeed
Time
Speed
EGSR 2005 – Konstanz, Germany 6
GPUsVersatility
Time
Linear algebraFluid dynamicsSignal processingDatabases…
And graphics!Simple 3D graphics only
EGSR 2005 – Konstanz, Germany 7
Global Illumination & GPUs
CPU
GPU
EGSR 2005 – Konstanz, Germany 8
Global Illumination & GPUsPrevious work
HemicubeCohen et al. 1985
PRTSloan et al. 2002
Photon mapping on GPUPurcell et al. 2003
EGSR 2005 – Konstanz, Germany 9
Contributions
A reformulation of (Ir)Radiance caching …
- No complex data structure
- Fast, image-space (ir)radiance interpolation
- Fast approximation of hemisphere sampling
… for fast and easy GPU implementation
EGSR 2005 – Konstanz, Germany 10
Outline
Introduction
Irradiance & Radiance Caching
Our method: Radiance Cache Splatting
Results
Conclusion & Future Work
EGSR 2005 – Konstanz, Germany 11
Outline
Introduction
Irradiance & Radiance Caching
Our method: Radiance Cache Splatting
Results
Conclusion & Future Work
EGSR 2005 – Konstanz, Germany 12
Irradiance Caching
Sparse computation of indirect diffuse lighting
EGSR 2005 – Konstanz, Germany 13
Irradiance CachingSparse computation of indirect diffuse lighting
EGSR 2005 – Konstanz, Germany 14
Irradiance Caching
Interpolation
Sparse computation of indirect diffuse lighting
EGSR 2005 – Konstanz, Germany 15
Interpolation
=E(P)
nk
n
Ek+ (nk x n)rEk+ D
tEk
E
EGSR 2005 – Konstanz, Germany 16
Interpolation
=E(P)
wk(P)
Σk S
wk(P)
Σk S
Ek+ (nk x n)rEk+ D
tEk
E
S = { k / wk(P) > 1/a }
n1
nn2n3 n4
EGSR 2005 – Konstanz, Germany 17
Radiance CachingExtension of irradiance caching to glossy interreflections
Cache directional distribution of light
EGSR 2005 – Konstanz, Germany 18
Radiance CachingExtension of irradiance caching to glossy interreflections
Cache directional distribution of light
Hemispherical Harmonics
EGSR 2005 – Konstanz, Germany 19
Radiance Caching
HSHIncident Radiance
HSHBRDF
L1
L2
Ln
f1
f2
fn
EGSR 2005 – Konstanz, Germany 20
Implementation
Ray tracing
Cache Record Computation
EGSR 2005 – Konstanz, Germany 21
Implementation
1
1
2 3
2
3
4 5 6 7
4
5
6
7
8 9 10 11 12 13
8
9
10
11
12
13
Cache storage
EGSR 2005 – Konstanz, Germany 22
Outline
Introduction
Irradiance & Radiance Caching
Our method: Radiance Cache Splatting
Results
Conclusion & Future Work
EGSR 2005 – Konstanz, Germany 23
(Ir)Radiance Caching vs GPU
(Ir)Radiance Caching
GPU
Ray tracing Rasterization
Cache stored in tree 1/2/3D textures
Spatial queries Texture lookups
?
EGSR 2005 – Konstanz, Germany 24
Reformulation
Octree
Ray tracing
(Ir)Radiance Caching
Native GPUfeatures
(Ir)Radiance CachingOur
method
EGSR 2005 – Konstanz, Germany 25
Outline
Introduction
Irradiance & Radiance Caching
Our method: Radiance Cache Splatting
Results
Conclusion & Future Work
From octree to splattingFrom ray tracing to rasterizationOverall algorithm
EGSR 2005 – Konstanz, Germany 26
Outline
Introduction
Irradiance & Radiance Caching
Our method: Radiance Cache Splatting
Results
Conclusion & Future Work
From octree to splattingFrom ray tracing to rasterizationOverall algorithm
EGSR 2005 – Konstanz, Germany 27
From Octree to Splatting
=E(P)
wk(P)
Σk S
wk(P)
Σk S
Ek+ (nk x n)rEk+ D
tEk
E
S = { k / wk(P) > 1/a }
Irradiance Interpolation
n1
nn2n3 n4
EGSR 2005 – Konstanz, Germany 28
From Octree to SplattingIrradiance Caching Weighting Function
nk
n
PPk
wk(P) = 1
||P-Pk||
Rk
+ 1-n.nk
Distance Normals divergence
EGSR 2005 – Konstanz, Germany 29
From Octree to SplattingSimplified Weighting Function
wk(P) = 1
||P-Pk||
Rk
+ 1-n.nk
Distance Normals divergence
nk n
PPk
EGSR 2005 – Konstanz, Germany 30
From Octree to SplattingSimplified Weighting Function
wk(P) = 1
||P-Pk||
Rk
+ 1-n.nk
Distance Normals divergence
nk n
PPk
wk(P) = 1
||P-Pk||
Rk
Distance
~
EGSR 2005 – Konstanz, Germany 31
From Octree to SplattingSimplified Weighting Function
nkn
PPk
aRk
wk(P) = ||P-Pk||
Rk > 1/a ~
EGSR 2005 – Konstanz, Germany 32
From Octree to SplattingPrinciple
wk(P) = ||P-Pk||
Rk > 1/a ~
EGSR 2005 – Konstanz, Germany 33
From Octree to SplattingPrinciple
EGSR 2005 – Konstanz, Germany 34
From Octree to SplattingPrinciple
wk(P)>1/a ?
EGSR 2005 – Konstanz, Germany 35
From Octree to SplattingPrinciple
wk(P)E(P)
wk(P)
EGSR 2005 – Konstanz, Germany 36
From Octree to SplattingPrinciple
EGSR 2005 – Konstanz, Germany 37
From Octree to SplattingPrinciple
wk(P)E(P)
wk(P)
Σk
Σk
EGSR 2005 – Konstanz, Germany 38
From Octree to SplattingFinal Image Generation
wk(P)E(P)Σk
wk(P)Σk
EGSR 2005 – Konstanz, Germany 39
From Octree to SplattingExample
EGSR 2005 – Konstanz, Germany 40
Outline
Introduction
Irradiance & Radiance Caching
Our method: Radiance Cache Splatting
Results
Conclusion & Future Work
From octree to splattingFrom ray tracing to rasterizationOverall algorithm
EGSR 2005 – Konstanz, Germany 41
From Ray Tracing to RasterizationCPU
EGSR 2005 – Konstanz, Germany 42
From Ray Tracing to Rasterization
GPU
VertexShader
FragmentShader
Simple plane sampling
EGSR 2005 – Konstanz, Germany 43
From Ray Tracing to Rasterization
GPU
VertexShader
FragmentShader
Simple plane sampling
EGSR 2005 – Konstanz, Germany 44
From Ray Tracing to RasterizationGPU
VertexShader
FragmentShader
Simple plane sampling
EGSR 2005 – Konstanz, Germany 45
From Ray Tracing to RasterizationGPU
VertexShader
FragmentShader
Simple plane sampling
Incoming radiance loss
EGSR 2005 – Konstanz, Germany 46
From Ray Tracing to Rasterization
GPU
VertexShader
FragmentShader
Our plane sampling
EGSR 2005 – Konstanz, Germany 47
From Ray Tracing to RasterizationGPU
VertexShader
FragmentShader
Our plane sampling
Compensation of incoming radiance loss
EGSR 2005 – Konstanz, Germany 48
Our plane samplingSummary
Easy implementation on GPU
3x more accurate than simple plane sampling
Plausible directional information
EGSR 2005 – Konstanz, Germany 49
Outline
Introduction
Irradiance & Radiance Caching
Our method: Radiance Cache Splatting
Results
Conclusion & Future Work
From octree to splattingFrom ray tracing to rasterizationOverall algorithm
EGSR 2005 – Konstanz, Germany 50
AlgorithmStep 1 : information generation GPU
VertexShader
FragmentShader
EGSR 2005 – Konstanz, Germany 51
AlgorithmStep 2 : detection CPU
?
EGSR 2005 – Konstanz, Germany 52
AlgorithmStep 2 : detection CPU
GPUHemisphere sampling
EGSR 2005 – Konstanz, Germany 53
AlgorithmStep 2 : detection CPU
?
GPUHemisphere sampling
EGSR 2005 – Konstanz, Germany 54
AlgorithmStep 2 : detection CPU
?
EGSR 2005 – Konstanz, Germany 55
AlgorithmStep 2 : detection CPU
EGSR 2005 – Konstanz, Germany 56
AlgorithmStep 3 : display GPU
VertexShader
FragmentShader
VertexShader
Matrices
Record information
EGSR 2005 – Konstanz, Germany 57
AlgorithmStep 3 : display GPU
VertexShader
FragmentShader
FragmentShader
Record information
EGSR 2005 – Konstanz, Germany 58
AlgorithmStep 3 : display GPU
VertexShader
FragmentShader
FragmentShader
EGSR 2005 – Konstanz, Germany 59
AlgorithmSummary
No spatial data structure
Spatial queries replaced by splatting
Interpolation by blending
No quality loss compared to (Ir)Radiance Caching
No order constraint for image traversal
Can be implemented using native GPU features
EGSR 2005 – Konstanz, Germany 60
Our renderer
Record computation
1-bounce GI: shadow maps & plane sampling
Indirect lighting
Radiance cache splatting
Direct lighting
GPU per-pixel lighting & shadow maps
CPU ray tracing
EGSR 2005 – Konstanz, Germany 61
Outline
Introduction
Irradiance & Radiance Caching
Our method: Radiance Cache Splatting
Results
Conclusion & Future Work
EGSR 2005 – Konstanz, Germany 62
ResultsSibenik Cathedral (80K triangles)
EGSR 2005 – Konstanz, Germany 63
ResultsSponza Atrium (66K triangles)
EGSR 2005 – Konstanz, Germany 64
ResultsComparison with Radiance
Sponza AtriumSibenik Cathedral
RadianceTime
OurRenderer
Time
Speedup
645 s425 s
13,7 s14,3 s
47,129,7
EGSR 2005 – Konstanz, Germany 65
ResultsFrom Irradiance to Radiance Caching: Venus (24K triangles)
EGSR 2005 – Konstanz, Germany 66
Conclusion
Reformulation of (Ir)Radiance Caching
Speedup: 29x – 47x
Interactive or fast, high quality rendering
EGSR 2005 – Konstanz, Germany 67
Future Work
All-Frequency BRDFs
More complex models
Better hemisphere sampling
Multiple bounces
Area light sources
EGSR 2005 – Konstanz, Germany 68
Any questions?
Radiance Cache Splatting on the web:
http://www.irisa.fr/siames/Pascal.Gautron/