A Real-Time Method for Inserting Virtual Objects Into Neural Radiance Fields

Keyang Ye, Hongzhi Wu, Xin Tong, Kun Zhou

TL;DR

This paper introduces the first real-time framework for seamlessly inserting rigid virtual objects into Neural Radiance Fields (NeRFs). It achieves realistic lighting and shadowing by intelligently combining NeRF-derived near-field lighting with estimated environment lighting and a novel spherical signed distance field (SSDF) for efficient shadow computation.

What Problem Does This Paper Address?

Augmented Reality (AR) applications often involve placing virtual objects into real-world scenes. While Neural Radiance Fields (NeRFs) have revolutionized novel view synthesis by capturing scene geometry and appearance implicitly, their integration with virtual object insertion has been limited. Existing methods struggle with accurately rendering how virtual objects interact with the complex lighting and occlusions present in NeRF-generated scenes. Specifically, NeRFs may not capture all lighting sources, and accurately modeling near-field lighting, shadows, and occlusions between virtual objects and the NeRF scene in real-time is a significant challenge. This paper aims to bridge this gap by enabling high-fidelity, real-time insertion of virtual objects into NeRFs.

Methods

The proposed method tackles the problem in several key stages:

  • Environment Lighting Estimation: To compensate for lighting sources not captured by the NeRF, the authors estimate a distant environment lighting. This is done by formulating an inverse rendering problem where the incident lighting is represented as a sum of Spherical Gaussians (SGs). The process involves sampling views from the NeRF, estimating surface points, and then optimizing SG parameters to match the rendered appearance.
  • Near-Field Lighting Integration: The final incident lighting for the virtual object is a combination of the estimated environment lighting and the near-field lighting derived from the NeRF. This combined lighting is also expressed in SGs for efficient rendering.
  • Visibility Field Precomputation (SSDF): To enable fast and accurate shadow computation, the authors precompute a Spherical Signed Distance Field (SSDF) around the virtual object. This field stores visibility information, allowing for efficient querying of shadow casting. The SSDFs are then compressed using PCA for storage efficiency.
  • Real-time Rendering and Compositing: At runtime, the virtual object is rendered using the combined incident lighting and the precomputed SSDF field. The rendered virtual object is then composited with the NeRF scene. The method handles occlusions by adjusting the rendering range of the NeRF and integrates shadows by computing an attenuation factor based on the SSDF and incident lighting.

Datasets

The authors used both synthetic and real-world datasets:

  • Synthetic HDR NeRFs: Four synthetic HDR NeRFs were created using Blender Cycles. These include a "PLANTS" scene where all light sources are visible in the rendered images, and "BOOKS," "DOG," and "CUPS" scenes where some light sources are not explicitly captured by the NeRF, serving as the environment lighting.
  • Captured HDR NeRFs: Two real scenes, "HORSE" and "SHEEP," were captured using bracketing to obtain HDR images.
  • Ground Truth: For real-scene experiments, 3D-printed models were used. Material parameters were measured, and the models were placed in the scene to capture ground-truth images for comparison.

Key Insights and Ideas

  • Bridging NeRFs and AR: The paper demonstrates that NeRFs, with their rich scene information, can be effectively leveraged for advanced AR tasks like virtual object insertion, going beyond simple view synthesis.
  • Hybrid Lighting Model: Combining estimated environment lighting with NeRF-derived near-field lighting is crucial for realistic rendering, as NeRFs alone might not capture all scene illumination.
  • SSDF for Efficient Shadows: The use of a precomputed SSDF field is a novel and efficient way to handle complex, high-frequency shadows cast by virtual objects onto NeRF scenes in real-time.
  • SG Representation for Speed: Representing lighting and BRDFs with Spherical Gaussians (SGs) is key to achieving real-time performance for rendering and compositing.

Key Results

  • Real-time Performance: The method achieves an average performance of 18 frames per second on a workstation with an RTX 4090 GPU at a resolution of 1280x720.
  • High-Fidelity Rendering: The results show realistic reflections and shadows that closely resemble ground-truth, outperforming existing methods like Li et al. [23] and Zhan et al. [42] in terms of visual quality and robustness.
  • Handling Complex Scenes: The method demonstrates good performance even in scenes with complex lighting, multiple light sources, and translucent objects.
  • Precomputation Costs: Environment lighting estimation takes about 25 minutes, and SSDF field precomputation takes about 8 minutes and results in a 9MB file.

Limitations and Future Work

  • Local Lighting Effects: The assumption that all surface points of a virtual object share the same incident lighting can lead to limitations in modeling certain local lighting effects.
  • Shadow Noise: Inaccurate depth estimation within the NeRF can introduce a small amount of noise in the computed shadows.
  • Direct Illumination Only: The current framework only considers direct illumination, neglecting interreflections, which can lead to artifacts like incorrect shading in some cases.
  • Future Work: The authors suggest that these assumptions can be loosened at the expense of increased computation, potentially enabling more complex scenarios and handling interreflections.

Summary updated

BibTeX
@article{ye2023real,
  author = {Keyang Ye and Hongzhi Wu and Xin Tong and Kun Zhou},
  title = {{A Real-Time Method for Inserting Virtual Objects Into Neural Radiance Fields}},
  journal = {IEEE Trans. Vis. Comput. Graph.},
  year = {2023},
}
Figure