mitsuba-renderer / mitsuba3

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

grey and white furnace test with roughplastic BSDF #1155

Closed GMBethsoft closed 5 months ago

GMBethsoft commented 6 months ago

Hi, I tried white and grey furnace test with the roughplastic BSDF and I have mixed result (I was expecting less energy lost in those scenario).

Here is how it is setup, am I missing something ?

<scene version="3.0.0">
    <default name="width" value="1310"/>
    <default name="height" value="951"/>
    <integrator id="integrator" type="path"/>

    <bsdf type="roughplastic" id="dielectric-white">
        <rgb name="diffuse_reflectance" value="1.0, 1.0, 1.0"/>
        <float name="alpha" value="1.0"/>
    </bsdf>

    <emitter type="envmap" id="emitter-envmap">
        <string name="filename" value="Cubemaps/White.exr"/>
    </emitter>

    <shape type="obj">
        <string name="filename" value="Meshes/MatPreview.obj"/>
        <ref name="bsdf" id="dielectric-white"/>
        <transform name="to_world">
            <translate x="0" y="0" z="0"/>
        </transform>
    </shape>

    <sensor type="perspective">
        <float name="far_clip" value="1000.0"/>
        <float name="near_clip" value="0.01"/>
        <float name="fov" value="30.000000"/>
        <string name="fov_axis" value="x"/>
        <transform name="to_world">
            <rotate value="0.543846, -0.826436, 0.145723" angle="35.927731"/>
            <translate value="3.200000, 3.200000, -6.000000"/>
        </transform>
        <film type="hdrfilm">
            <integer name="height" value="$height"/>
            <integer name="width" value="$width"/>
        </film>
    </sensor>
</scene>

Here is the results with various roughness levels (0, 0.5 and 1.0) mitsubaG mitsubaW

merlinND commented 6 months ago

Hello @GMBethsoft,

I believe that some energy loss is to be expected from roughplastic, since it does not implement one of the more advanced energy-conserving microfacet models. However I don't know how much energy loss to expect at which roughness level.

As a sanity check, have you tried reproducing your experiment in PBRT and / or Blender? (Making sure to double check that the roughness parameter is defined in the same way, some systems take a sqrt mapping I believe).

GMBethsoft commented 6 months ago

Thanks for the answer, I was also under the impression that there is no energy-conservation by looking at the code, but I wasn't sure.

I did some test in Blender (cycles) with both GGX and Multiscatter GGX for dielectrics. The multiscatter GGX is perfectly energy preservative, the GGX version is losing a bit of energy for high roughness but not that bad. So this is different from what I see for rough plastic. cyclesGGX_D_G cyclesMultiscatterGGX_D_G

I also did the metallic version, and for this one the Multiscattering version helps a lot cyclesGGX_M_G cyclesMultiscatterGGX_M_G

Not setup with PBRT yet to try this out, but this would interesting as well.

njroussel commented 5 months ago

As mentioned above, some energy loss is expected.

I'll close this, I would need to see a comparison against Mitsuba 0.6 or PBRT before digging into this further. It is definitely possible that there is a bug in the current version.