DiffusionShadow: Diffusion-based Shadow Caching for Neural Volume Rendering
Authors: Kai-Chen Tung, Qi Wu, David Bauer, Mengjiao Han, Silvio Rizzi, Kwan-Liu Ma
Organizations: University of California, Davis, Davis, CA, United States · NVIDIA Spatial Intelligence Lab, Santa Clara, CA, United States · Argonne National Laboratory, Lemont, IL, United States
Implicit neural representations (INRs) have gained momentum in scientific visualization due to their compactness and scalability to large datasets, making them well suited for integration with direct volume rendering (DVR). However, real-time volume rendering of INR with advanced illumination effects, such as shadows, remains computationally expensive, as evaluating shadow terms via ray marching is costly. Alternatively, precomputing and storing shadows for many lighting directions is prohibitive in both memory and storage. To address this, we introduce a diffusion-based shadow caching framework that compresses a vast set of pre-calculated shadow INRs into a single diffusion model. Rather than focusing on generalizing to unseen directions, our method effectively memorizes and reconstructs a dense set of pre-trained lighting conditions on the fly. We first encode a collection of shadow coefficient volumes as shadow INRs, and then train a diffusion model conditioned on lighting direction to predict the corresponding shadow INR weights at inference time. This design integrates directly with standard INR renderers without additional runtime sampling. Experiments show that our approach achieves faster rendering than traditional methods while bypassing the massive storage bloat of independent INRs, producing shadows that closely match most of the reference results.
Figures & tables
Figure 1: Overview of our two-stage training pipeline. (1) SIREN Network Overfitting: encode each shadow coefficient volume as a SIREN network. (2) Diffusion Training: synthesize SIREN network weights conditioned on lighting directions to generate shadows under pre-trained lighting directions.
Figure 2: The architecture of our diffusion backbone. A GPT-2-style Transformer conditioned on lighting directions encoded via Fourier positional embedding [ 26 ] . The embedded lighting features are injected into the network as additional input tokens of the transformer (in-context conditioning).
Figure 3: Visualization of volume renderings for five different datasets (rows) with shadow reconstructed from the SIREN networks across training stages, DVR with Blinn-Phong shading, and baseline method - BlockFusion (columns).
Dataset
Resolution
Dataset
Resolution
Chameleon
1024 × 1024 × 1080
Zebrafish
592 × 413 × 956
Mechhand
640 × 220 × 229
Vortex
128 × 128 × 128
Argon Bubble
128 × 128 × 256
Table 1: Dataset used.
FPS ↑
Memory (GiB) ↓
Dataset
Ours
Naïve
Ours
Naïve
Chameleon
2.864
0.021
8.788
18.664
Zebrafish
11.125
0.139
5.342
15.282
Mechhand
11.510
0.284
3.476
9.972
Argonne Bubble
12.155
0.511
3.748
11.188
Vortex
21.815
0.616
3.108
8.656
Table 2: Rendering performance (FPS) and GPU memory usage comparison between our method and the naive baseline. Higher FPS indicates faster rendering; lower memory indicates a smaller footprint. Our approach demonstrates significant speedups and reduced memory usage across all datasets.
Figure 4: Failure Case of VAE-Reconstructed Triplanes. Visualization of Vortex triplanes from the triplane overfitting stage (left) and the VAE reconstruction stage (right). The overfitted triplanes are used as training targets for the VAE. However, the VAE fails to preserve high-frequency structural details.
Figure 5: Diffusion-reconstructed shadows for Mechhand trained with different auxiliary loss configurations: no geometry/rendering loss (left), geometry loss only (center-left), geometry + rendering loss (center-right), and ground truth (right). From the first three sub-figures, we observe progressive visual improvement as auxiliary losses are added, with spotty artifacts gradually reduced. This result suggests the importance of incorporating volume-domain-supervision and rendering supervision in diffusion training.
Number of Lights in Train Set
Train Set Lights
Test Set
2000
29.57
20.37
6300
29.32
20.70
Table 3: Average reconstruction quality (PSNR) of shadow coefficient volumes for the training and test sets using 2,000 and 6,300 lighting instances. Both training sets are sampled from the same spatial lighting region. An additional 500 lighting directions sampled from the same region are used for the test set.
Figure 6: Limitations on high-frequency shadow reconstruction. While the overall illumination of Spider dataset remains plausible, fine shadow structures are over-smoothed, illustrating the difficulty of representing high-frequency shadow discontinuities with deep neural networks.
Time-varying implicit neural representations (INRs) provide a compact representation of scientific volumes and, for modalities such as dynamic X-ray computed tomography (CT), are often the only practical way to represent the data. However, interactive volume rendering of INRs is challenging, as cheap memory lookups are replaced by expensive neural inferences, hindering the performance. Therefore, conventional volume rendering methods such as ray marching with dense sampling are often impractical. While resampling, caching, and retraining can mitigate this cost, they compromise convenience and accuracy and become impractical for time-varying data. We tackle these challenges using a query-efficient stochastic volume rendering framework based on delta tracking. Our system employs a four-stage pipeline that exploits heterogeneous parallelism, using ray tracing cores for traversal and tensor cores for batched neural evaluation. Furthermore, we present strategies to reduce INR queries via ray budgeting and query pruning, thereby increasing per-frame performance. Using our renderer, many time-varying INRs can be rendered directly from their original representation. The system achieves ~30-40 FPS at 1024x1024 resolution on an RTX 4090 GPU and converges to high-fidelity images. Moreover, the system enables interactive temporal exploration of the continuous domain, with timestep updates taking approximately 1-2 ms.
Implicit neural representation (INR) methods provide continuous coordinate-to-value mappings and integrate naturally with direct volume rendering, making them attractive for representing volumetric data. However, existing INR-based approaches for volumetric data are inherently lossy, and even small reconstruction errors can propagate through rendering and downstream analysis. In this work, we explore Lossless-INR, a lossless INR framework for 3D scientific volumetric data based on bit-plane decomposition. By decomposing each voxel value into binary bit-planes, we reformulate reconstruction as per-bit binary classification, so that exact recovery reduces to predicting every bit correctly. To make this optimization tractable while keeping the representation compact, we combine an octree block-partitioning strategy that adaptively subdivides complex regions with a ternary feature-grid network whose grid entries are parameterized by a ternary set of values. Experiments on diverse volumetric datasets show that this design can achieve zero bit-error rate and bit-exact reconstruction, enabling faithful rendering and downstream analysis with a compact representation. The code is available at https://github.com/TouKaienn/Lossless-INR.
Generating realistic cast shadows for inserted foreground objects is a crucial yet challenging problem in image composition, where maintaining geometric consistency of shadow and object in complex scenes remains difficult due to the ill-posed nature of shadow formation. To address this issue, we propose VSDiffusion, a visibility-constrained two-stage framework designed to narrow the solution space by incorporating visibility priors. In Stage I, we predict a coarse shadow mask to localize plausible shadow generated regions. And in Stage II, conditional diffusion is performed guided by lighting and depth cues estimated from the composite to generate accurate shadows. In VSDiffusion, we inject visibility priors through two complementary pathways. First, a visibility control branch with shadow-gated cross attention that provides multi-scale structural guidance. Then, a learned soft prior map that reweights training loss in error-prone regions to enhance geometric correction. Additionally, we also introduce high-frequency guided enhancement module to sharpen boundaries and improve texture interaction with the background. Experiments on widely used public DESOBAv2 dataset demonstrated that our proposed VSDiffusion can generate accurate shadow, and establishes new SOTA results across most evaluation metrics.
Jing Li, Jing Zhang
East China University of Science and Technology, Shanghai, China