mitsuba-renderer / mitsuba3

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

noise in rendering #1082

Closed Ine-123 closed 7 months ago

Ine-123 commented 9 months ago

System configuration

System information:

OS: Ubuntu 20.04.6 LTS CPU: Intel(R) Core(TM) i9-7920X CPU @ 2.90GHz GPU: python -m mitsuba.sys_info Python version: 3.8.8 LLVM version: 12.0.0 CUDA version: / NVidia driver: 470.223.02

Dr.Jit version: 0.4.4 Mitsuba version: 3.5.0 Compiled with: GNU 10. Variants compiled: scalar_rgb scalar_spectral cuda_ad_rgb llvm_ad_rgb

Description

I trying to create a simulation of apple tissue based on its measured bulk optical properties (absorption coefficient, scattering coefficient (so extinction coefficient) and anisotropy factor). I used this code for the scene, but get always white noise (fireflies?). The goal is to create a smooth simulation without any noise. I already tried changing some parameters (different integrators (volpath, volpathmis), higher sample count, brighter light source, different BSDF's (only a diffuse BSDF created a smooth object, but I want the light get inside the object)) but it doesn't seem to help. Anyone suggestions? I'm very new to rendering and Mitsuba...

image

the code for the scene:

<?xml version='1.0' encoding='utf-8'?>

<scene version="3.0.0">
    <integrator type="volpathmis"> 
        <integer name="max_depth" value="-1"/>
    </integrator>

    <shape type="obj">                                
        <string name="filename" value="appleFilled.obj"/>
        <transform name="to_world">
            <translate x="0" y="0" z="0"/>
            <scale value="1.0" />
        </transform>

        <medium id="interior" type="homogeneous"> 
            <spectrum name="sigma_t" value="500:25618, 550:23651, 700:23565"/>
            <phase type="hg">
                <float name="g" value="0.8313"/>
            </phase>
    </medium>

        <bsdf type="roughdielectric">
            <string name="distribution" value="beckmann"/>
            <float name="alpha" value="0.304"/>
            <float name="int_ior" value="1.33"/>
            <float name="ext_ior" value="1.0"/>
        </bsdf>
    </shape>   

    <sensor type="perspective">     
        <float name="focus_distance" value="6"/>
        <float name="fov" value="40"/>
        <string name="fov_axis" value="x"/>
        <transform name="to_world">
            <lookat target="0, 0, 0" origin="0, 0, 0.2" up="0, 1, 0"/>
        </transform>

        <sampler type="independent">
            <integer name="sample_count" value="10000"/> 
        </sampler>

        <film type="hdrfilm">
            <integer name="height" value="768"/>
            <integer name="width" value="768"/>
            <string name="pixel_format" value="rgb"/>
            <rfilter type="gaussian"/>
        </film>
    </sensor>

    <emitter type="directional">
        <transform name="to_world">
            <lookat origin="0,0,0.3" target="0.1, 0, 0" up= "0,1,0"/>   
        </transform>
        <!--float name="cutoffAngle" value="60"/-->
        <!--rgb name="intensity" value="0.9,0.9,0.9"/-->

    </emitter> 

</scene>
DanielPSchenk commented 8 months ago

I have a similar issue. With increased sample count, fireflies start to appear on rough conductor and principled surfaces. Those surfaces seem to not play well with point lights, directional lights, and very distant area lights. Area lights close to the object do not cause the artifacts. I have tested path, volpath and volpathmis integrators, all produce the artifacts. Direct illumination does not produce the artifacts (but is useless for my purposes). I tested all python, llvm and cuda, rgb and spectral, single and double precision backends, the issue appears with all backends. Both self-compiled and the pypi version have this problem. All provided Samplers produce these artifacts. I used both ply models and primitive shapes, both produce the artifacts. The issue can be mitigated (for my use case at least) by rendering multiple lower sample count images with different seeds, that make the artifacts appear at different spots. Then I apply a mean filter and get an artifact-free image, but at increased cost.

All images rendered with cuda rgb backend. With multijitter sampler 2048 samples artifact_report_series2048 256 samples artifact_report_series256 32 samples artifact_report_series32

With independent sampler 2048 samples artifact_report_series_independent_sampler2048 256 samples artifact_report_series_independent_sampler256 32 samples artifact_report_series_independent_sampler32

Scene description used: <?xml version="1.0"?>

njroussel commented 8 months ago

Hi! I'm not too sure what to make of this. I'm not saying that there isn't a bug, but this could just be Monte Carlo noise. If some samples have an extremely high weight (imagine we're close to infinity), doubling or quadrupling your number of samples effectively just increased the probability of getting a firefly. You would need an extremely large number of samples to average out the fireflies.

If you can't reproduce this behavior in Mitsuba 0.6 or PBRT, I'd be more concerned. That would also give us a starting point to debug this problem if it exists.

DanielPSchenk commented 8 months ago

I recreated the scene in pbrt and got very similar artifacts, seems to be a Monte Carlo sampling and not a mitsuba3 issue. PBRT 2048 samples: artifact_report_lighting_fix2048 Still the pbrt artifacts are much more concentrated near the cylinder, and not spread over the whole disk like in the mitsuba3 renders.

njroussel commented 7 months ago

Closing, seems to just be Monte Carlo noise.