Download presentation
Presentation is loading. Please wait.
Published bySusanna Booth Modified over 9 years ago
1
Precomputation aided GI on the GPU László Szirmay-Kalos
2
GI: light path generation image Virtual world
3
Path precomputation Entry point Exit point
4
Transfer factors: T(y, i x, o ) Entry point y Exit Point x Entry dir i Exit dir o
5
Having the transfer factors
6
Having the Transfer factors L(x, o ) = S L in (y, i ) T(y, i x, o ) d i dy Directional lights or Image Based Lighting: Directional lights or Image Based Lighting: –L in is independent of y Diffuse surfaces: Diffuse surfaces: L(x) = S L in (y) T(y, i x) d i dy L(x, o ) = L in ( i ) S T(y, i x, o ) dy d i L in ( i ) T env ( i x, o ) d i
7
Problems Exit points: Exit points: –Vertices of a highly tessellated mesh –Points corresponding to texel centers Entry points: Entry points: –Vertices of a highly tessellated mesh –Sampled randomly –No problem if directional lights or environment lighting Exit directions: Exit directions: –no problem if the scene is diffuse T is a 4-variate (8-dimensional) function: T is a 4-variate (8-dimensional) function: –how to store? –Simplification: diffuse surfaces + environment lighting requires just 2 variate functions
8
Storing the Transfer factors Finite element representation Finite element representation –Pros: compact, good for low frequency illumination –Cons: costly to update Sampling + interpolation Sampling + interpolation –Pros: easier to update, good for high frequency illumination –Cons: not as compact
9
Finite-element representation T env ( i x) T x ( i ) = N T n b n ( )
10
How to computeT m Find an adjoint basis function set: Find an adjoint basis function set: b n ( ) b* m ( ) d = 1 if m=n, and 0 otherwise T x ( i ) = N T n b n ( ) // multiply by b* m ( ) T x ( ) b* m ( )d = N T n b n ( ) b* m ( )d = T m Monte Carlo integration
11
Monte Carlo preprocess ii y x T n += L b* n ( i ) p( i, y,path) 1K1K Number of samples
12
Precomputed Radiance Transfer (Sloan02) Transfer factors for directional illumination Transfer factors for directional illumination Express directional illumination with adjoint basis functions Express directional illumination with adjoint basis functions Thanks to orthogonality, the exit radiance is: Thanks to orthogonality, the exit radiance is: It requires N rgb transfer factors at each exit points It requires N rgb transfer factors at each exit points L in ( ) N L n b* n ( ) L(x) = L in ( i ) T env ( i x) d i = N L n b* n ( i ) N T m b m ( i ) d i = N L n T n
13
Principal Component Analysis M is the mean of the dataset Bs are the eigenvectors corresponding to the largest eigenvalues of the covariance matrix: (T m -M) T (T m -M)
14
PRT results 1 bounce preproc: 12 sec5 bounce preproc: 172 sec Run time: 466 FPS
15
Sampling approach to precomputation aided GI No finite-element representation No finite-element representation Entry-exit point samples are stored directly Entry-exit point samples are stored directly Comparison to PRT: Comparison to PRT: –It is easy to update –It does not assume low frequency environment map –Particularly good for point lights that can be close
16
Preprocessing: Entry points Random sampling
17
Preprocessing: Transfer from entry to exit points entry point with unit irradiance
18
Preprocessing: Reference point illumination Virtual lights unit irrad
19
Precomputed Radiance Map Item: (entry, exit, irrad) unit irrad transfer irrad
20
PRM: 4D array r, g, b Exit point Texcoord: (u,v) Entry point: PRM item
21
Real-time Rendering: Entry point visibility
22
Rendering: PRM weighting
23
Implementation Entry point sampling and Photon tracing Exit point illumination computation PRMs in textures Shadow mapping: Direct illum + Entry point visibility Camera rendering: Direct illum + PRM weighting Image CPUGPU Preprocessing Real-time rendering
24
Tile in a single or few textures PRMs in textures: Tiling r, g, b Exit point u v Pane of Entry point 1 r, g, b Exit point u v Pane of Entry point 2 Etc.
25
Entry point clustering r, g, b Exit point v Pane of Entry point 1 r, g, b Exit point Pane of Entry point 2 u u v Close and have similar normals
26
Resulting cluster r, g, b Exit point v Pane of Entry point Cluster 1 u
27
Results 4096 entry points 256 – 32 clusters: 128 – 4Mb texture memory Preproc: 5 minutes Rendering: 40 FPS
28
Results: Room with stairs 16K entries 32 clusters 4Mb per obj 50 FPS
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.