mitsuba-renderer / mitsuba3

Mitsuba 3: A Retargetable Forward and Inverse Renderer
https://www.mitsuba-renderer.org/
Other
2.01k stars 230 forks source link

Rendering Dielectric Materials with Non-Independent Sampling #1288

Open Disgruntoad opened 2 weeks ago

Disgruntoad commented 2 weeks ago

I'm fairly new to rendering so maybe this is a mistake on my part.

Summary

All these renders are using the cuda_spectral variant.

I was attempting to render the banner 2 scene from https://mitsuba.readthedocs.io/en/stable/src/gallery.html

I replaced the material types for the background wall and the central object. The wall is a measured bsdf from EPFL's RGL lab (https://rgl.epfl.ch/materials) and the object is a simulated rough dielectric of glass interior & air exterior (ggx distribution).

  <!-- Materials -->                                                                                  
  <bsdf type="roughdielectric" id="mat-Material.005">                                                 
    <string name="int_ior" value="bk7"/>                                                              
    <string name="ext_ior" value="air"/>                                                              
    <string name="distribution" value="ggx"/>                                                         
  </bsdf>                                                                                             

  <bsdf type="measured" id="mat-Floor">                                                               
    <string name="filename" value="/data/raw/epfl_rgl_bsdf/colodur_azure_4e_spec.bsdf"/>              
  </bsdf>

I was running into high convergence samples per pixel for the independent sampler -- convergence occurs only after spp=32768 which is a bit higher than I'd ideally set the value to. Other sampling methods should converge faster, so I attempted to render with them, but I'm getting some really odd artifacts. The distribution of artifacts varies slightly between samplers, but they all have the same odd characteristics.

I include an example of the independent and stratified samplers, both generated with spp=1024, max_depth=256.

Independent, spp=1024: glass_air_independent_256depth_1024spp_1024spi

Stratified, spp=1024 glass_air_stratified_256depth_1024spp_1024spi

Independent, spp=16384: glass_air_256depth_16384spp_128spi

Stratified, spp=16384: glass_air_stratified_256depth_16384spp_256spi

For reference, here is the stratified render with the object as a rough conductor of Cu (ggx distribution).

  <!-- Materials -->                                                                                  
  <bsdf type="roughconductor" id="mat-Material.005">                                                  
    <string name="material" value="Cu"/>                                                              
    <string name="distribution" value="ggx"/>                                                         
  </bsdf>                                                                                             

  <bsdf type="measured" id="mat-Floor">                                                               
    <string name="filename" value="/data/raw/epfl_rgl_bsdf/colodur_azure_4e_spec.bsdf"/>              
  </bsdf>  

Stratified, spp=1024: Cu_stratified_256depth_1024spp_1024spi

Stratified, spp=16384: Cu_stratified_256depth_16384spp_256spi

And just to be clear, I use the stratified sampler as a demonstration, but this behavior is exhibited by all non-independent samplers.

Am I doing something wrong? Are these samplers not well-suited for dielectric materials?

System configuration

System information:

OS: Ubuntu 24.04 CPU: 14900k GPU: 4090 Python version: 3.12.4 LLVM version: 18.1.3 CUDA version: 12.6 NVidia driver: 560.28.03

Dr.Jit version: 0.4.2 Mitsuba version: master (d394bc405511b95dcb8306d8c12f71860800336e) Compiled with: CC=clang-18, CCX=clang++-18 Variants compiled: ['scalar_mono', 'scalar_rgb', 'scalar_spectral', 'llvm_mono', 'llvm_rgb', 'llvm_spectral', 'llvm_ad_spectral_polarized', 'cuda_mono', 'cuda_mono_polarized', 'cuda_rgb', 'cuda_spectral', 'cuda_spectral_double', 'cuda_spectral_polarized', 'cuda_spectral_polarized_double', 'cuda_ad_spectral']

Disgruntoad commented 2 weeks ago

I realized I should reproduce this error on a stable release, so I recompiled for v3.5.2 and current master. Here are the results.

Stratified, spp=1024, Mitsuba v3.5.2 glass_air_stratified_1024depth_1024spp_256spi_v352

Stratified, spp=1024, Mitsuba current master (0e36435230d7ef3ce454f27358e0be0a6d7f6e0f) glass_air_stratified_1024depth_1024spp_256spi_master

So it does appear that this error is present in the current master branch, though not the stable versions of Mitsuba. I'll move back to v3.5.2. I would recommend modifying the instructions (https://mitsuba.readthedocs.io/en/stable/src/developer_guide/compiling.html) to checkout the most recent stable version unless you're doing dev work.

Your dev team may already be aware of this issue, but in case they're not, fyi.

njroussel commented 2 weeks ago

Hi @Disgruntoad

Thanks for the bug report! Our test suite doesn't cover non-independent samplers that well. So, I'm not surprised this slipped through the cracks so far.

We'll have a look.