runtime implementation of modular radiance transfer€¦ · runtime implementation of modular...

1
Runtime Implementation of Modular Radiance Transfer Brad Loos 1 Lakulish Antani 2 Kenny Mitchell 3 Derek Nowrouzezahrai 4 Wojciech Jarosz 4 Peter-Pike Sloan 3 1 University of Utah 2 UNC Chapel Hill 3 Disney Interactive Studios 4 Disney Research Z¨ urich Direct Lighting Indirect Lighting (with Multi-Bounce) Direct & Indirect Lighting (with Multi-Bounce) Our Method (1.7ms) Ground Truth Our Method Ground Truth 16.3 ms Figure 1: Indirect light computed for a 19 block maze-like cave scene constructed completely at run-time. Our algorithm can model color bleeding and indirect light from surfaces with detailed normal variation and real-time performance. Timings are on an NVidia 480 GTX. 1 Introduction Real-time rendering of indirect lighting significantly enhances the sense of realism in video games. Unfortunately, previously includ- ing such effects often required time consuming scene dependent precomputation and heavy runtime computations unsuitable for low- end devices, such as mobile phones or game consoles. Modular Radiance Transfer (MRT) [Loos et al. 2011], is a recent technique that computes approximate direct-to-indirect transfer [Haˇ san et al. 2006; Kontkanen et al. 2006; Lehtinen et al. 2008] by warping and combining light transport from a small library of simple shapes. This talk complements a technical paper and focuses on implementation issues, including how our run time is designed to scale across many different platforms, from iPhones to modern GPUs. 2 Modular Radiance Transfer Overview MRT is a novel technique for approximate direct-to-indirect transfer. The key contributions are the use of a lighting prior to reduce the dimension/entropy of the one-bounce light transport operator, ap- proximating a scene with simpler shapes, and efficiently computing indirect lighting on these simpler shapes by expressing both self transfer and propagation between shapes using carefully constructed reduced-dimensional spaces. We achieve high performance on a wide range of platforms (see [Loos et al. 2011] for more details). Mathematically indirect lighting is computed as l ind = U b b + Ur r , where b = T db l d are the spectral indirect lighting coefficients, r = Tprop b are reduced lightfield response coefficients. The T db operator maps direct light (l d ) to reduced indirect light coefficients and Tprop maps indirect light at all the blocks scene shapes to reduced dimensional lightfields between these blocks. U b is a compact basis for indirect light inside a shape, and Ur is a compact basis for mapping light flowing through a lightfield to response from a shape to its neighbors. 3 Implementation Details The core run time steps for MRT are as follows: 1. Compute direct light at a reduced resolution in each block, 2. Compute per-block direct lighting spectral coefficients, 3. Compute indirect light within a block (into a dynamic lightmap) 4. Compute response coefficients at all the blocks’ interfaces, 5. Blend response from “external” blocks into a dynamic lightmap, 6. Pad the lightmap texture to avoid texture mapping artifacts, 7. Render static elements using dynamic lightmap of indirect lighting, 8. [optional] Compute indirect light volume (from b’s and r’s), 9. [optional] Render dynamic objects the volume lighting. Optional steps are currently only computed in the GPU version, but could also be computed on low-end platforms. We attempted to use GPUs on low-end devices for as many components of our algorithm as possible, however current texture format and performance limi- tations made this infeasible (e.g., evaluating a single unshadowed point-light takes 25ms on the iPad). We instead focused on CPU optimizations: using memory layouts for the coefficients that favor code vectorization, exploiting the vector architecture itself, and balancing the CPU and GPU register counts. We transformed the GPU data layout used on higher-end platforms to a more CPU friendly one, optimizing for better cache usage, as well as investigating a few alternative CPU implementations before settling on what turned out to be most effective. 4 Conclusion MRT is a compelling, real-time approximate global illumination technique. This talk discusses implementation details that allow the algorithm to scale across different hardware platforms with wildly varying capabilities. We believe some of the techniques employed by MRT may be useful to developers facing similar scaling challenges. References HA ˇ SAN, M., PELLACINI , F., AND BALA, K. 2006. Direct-to-indirect transfer for cinematic relighting. ACM Trans. Graph.. KONTKANEN, J., TURQUIN, E., HOLZSCHUCH, N., AND SILLION, F. 2006. Wavelet radiance transport for interactive indirect lighting. In EGSR. LEHTINEN, J., ZWICKER, M., TURQUIN, E., KONTKANEN, J., DU- RAND, F., SILLION, F. X., AND AILA, T. 2008. A meshless hierar- chical representation for light transport. TOG. LOOS, B., ANTANI , L., MITCHELL, K., NOWROUZEZAHRAI , D., JAROSZ, W., AND SLOAN, P.-P. 2011. Modular radiance transfer (under review). In EGSR.

Upload: others

Post on 29-Jul-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Runtime Implementation of Modular Radiance Transfer€¦ · Runtime Implementation of Modular Radiance Transfer Brad Loos1 Lakulish Antani2 Kenny Mitchell3 Derek Nowrouzezahrai 4Wojciech

Runtime Implementation of Modular Radiance Transfer

Brad Loos1 Lakulish Antani2 Kenny Mitchell3 Derek Nowrouzezahrai4 Wojciech Jarosz4 Peter-Pike Sloan3

1University of Utah 2UNC Chapel Hill 3Disney Interactive Studios 4Disney Research Zurich

Direct Lighting Indirect Lighting (with Multi-Bounce) Direct & Indirect Lighting (with Multi-Bounce)

Our Method (1.7ms) Ground Truth Our Method Ground Truth16.3 ms

Figure 1: Indirect light computed for a 19 block maze-like cave scene constructed completely at run-time. Our algorithm can model colorbleeding and indirect light from surfaces with detailed normal variation and real-time performance. Timings are on an NVidia 480 GTX.

1 IntroductionReal-time rendering of indirect lighting significantly enhances thesense of realism in video games. Unfortunately, previously includ-ing such effects often required time consuming scene dependentprecomputation and heavy runtime computations unsuitable for low-end devices, such as mobile phones or game consoles. ModularRadiance Transfer (MRT) [Loos et al. 2011], is a recent techniquethat computes approximate direct-to-indirect transfer [Hasan et al.2006; Kontkanen et al. 2006; Lehtinen et al. 2008] by warping andcombining light transport from a small library of simple shapes. Thistalk complements a technical paper and focuses on implementationissues, including how our run time is designed to scale across manydifferent platforms, from iPhones to modern GPUs.

2 Modular Radiance Transfer OverviewMRT is a novel technique for approximate direct-to-indirect transfer.The key contributions are the use of a lighting prior to reduce thedimension/entropy of the one-bounce light transport operator, ap-proximating a scene with simpler shapes, and efficiently computingindirect lighting on these simpler shapes by expressing both selftransfer and propagation between shapes using carefully constructedreduced-dimensional spaces. We achieve high performance on awide range of platforms (see [Loos et al. 2011] for more details).

Mathematically indirect lighting is computed as

lind = Ub b+Ur r ,

where b = Td→b ld are the spectral indirect lighting coefficients,r = Tprop b are reduced lightfield response coefficients.

The Td→b operator maps direct light (ld) to reduced indirect lightcoefficients and Tprop maps indirect light at all the blocks sceneshapes to reduced dimensional lightfields between these blocks. Ub

is a compact basis for indirect light inside a shape, and Ur is acompact basis for mapping light flowing through a lightfield toresponse from a shape to its neighbors.

3 Implementation DetailsThe core run time steps for MRT are as follows:

1. Compute direct light at a reduced resolution in each block,

2. Compute per-block direct lighting spectral coefficients,

3. Compute indirect light within a block (into a dynamic lightmap)

4. Compute response coefficients at all the blocks’ interfaces,

5. Blend response from “external” blocks into a dynamic lightmap,

6. Pad the lightmap texture to avoid texture mapping artifacts,

7. Render static elements using dynamic lightmap of indirectlighting,

8. [optional] Compute indirect light volume (from b’s and r’s),

9. [optional] Render dynamic objects the volume lighting.

Optional steps are currently only computed in the GPU version, butcould also be computed on low-end platforms. We attempted to useGPUs on low-end devices for as many components of our algorithmas possible, however current texture format and performance limi-tations made this infeasible (e.g., evaluating a single unshadowedpoint-light takes 25ms on the iPad).

We instead focused on CPU optimizations: using memory layouts forthe coefficients that favor code vectorization, exploiting the vectorarchitecture itself, and balancing the CPU and GPU register counts.We transformed the GPU data layout used on higher-end platformsto a more CPU friendly one, optimizing for better cache usage, aswell as investigating a few alternative CPU implementations beforesettling on what turned out to be most effective.

4 ConclusionMRT is a compelling, real-time approximate global illuminationtechnique. This talk discusses implementation details that allow thealgorithm to scale across different hardware platforms with wildlyvarying capabilities. We believe some of the techniques employed byMRT may be useful to developers facing similar scaling challenges.

ReferencesHASAN, M., PELLACINI, F., AND BALA, K. 2006. Direct-to-indirect

transfer for cinematic relighting. ACM Trans. Graph..

KONTKANEN, J., TURQUIN, E., HOLZSCHUCH, N., AND SILLION, F.2006. Wavelet radiance transport for interactive indirect lighting. InEGSR.

LEHTINEN, J., ZWICKER, M., TURQUIN, E., KONTKANEN, J., DU-RAND, F., SILLION, F. X., AND AILA, T. 2008. A meshless hierar-chical representation for light transport. TOG.

LOOS, B., ANTANI, L., MITCHELL, K., NOWROUZEZAHRAI, D.,JAROSZ, W., AND SLOAN, P.-P. 2011. Modular radiance transfer(under review). In EGSR.