mmp / pbrt-v4

Source code to pbrt, the ray tracer described in the forthcoming 4th edition of the "Physically Based Rendering: From Theory to Implementation" book.
https://pbrt.org
Apache License 2.0
2.87k stars 448 forks source link

MLTIntegrator regression (?) in pbrt-v4 #139

Open Vutshi opened 3 years ago

Vutshi commented 3 years ago

It seems MLT produces results different from other integrators. Usually the output is just a bit darker than normal and I thought that maybe some settings are off a bit. However, with Dambreak scene MLT generates something quite green...

BDPT, regularization true dambreak0_bdpt_reg-11

MLT, regularization false dambreak0_mlt_no_reg

MLT, regularization true dambreak0_mlt

Cheers

mmp commented 3 years ago

Thanks for reporting this! I can reproduce this issue locally and something is clearly very broken.. From debugging so far, the issue seems to be related to volumetric scattering (i.e., it appears in other scenes with volumetric scattering, but MLT seems fine in scenes that do not.) I will continue to try to chase this down...

shadeops commented 2 years ago

I bumped into this with a similar scene but without mediums.

What I noticed is that the MLTIntegrator has trouble when the Film uses "maxcomponentvalue" along with transmission of non constant spectrum. In the dambreak scene, the Film has a "float maxcomponentvalue" [ 10 ] as well as an eta that has varying wavelengths ie- Material "dielectric" "spectrum eta" "glass-BAF10".

Simple Scene

In the following scene there is a diffuse disk and a sphere with a dielectric material. When setting "spectrum eta" so something that isn't "constant" you start to see some significant wavelength noise. Then when combined with the Film's "maxcomponentvalue" option example

Dambreak Scene

Applying the same breakdown to the Dambreak we see -

MLT, no maxcomponentvalue, constant eta spectrum

dambreak

MLT, no maxcomponentvalue, varying eta spectrum

dambreak_etaSpectrum

MLT, maxcomponentvalue 10, constant eta spectrum

dambreak_maxComponent

MLT, maxcomponentvalue 10, varying eta spectrum

dambreak_etaSpectrum_maxComponent

Simple Scene Source

LookAt 0 40 100
    0 30 0
    0 1 0

Camera "perspective"
    "float fov" [ 50 ]

Film "rgb"
    "string filename" [ "dambreak0.exr" ]
    "float maxcomponentvalue" [ 10 ]
    "integer yresolution" [ 256 ]
    "integer xresolution" [ 256 ]

Sampler "halton"
    "integer pixelsamples" [ 8192 ]

#Integrator "volpath"

Integrator "mlt"
   "integer bootstrapsamples" [ 100000 ]
   "integer chains" [ 1000 ]
   "integer mutationsperpixel" [ 5000 ]
   "float largestepprobability" [ 0.08 ]

WorldBegin

AttributeBegin
    LightSource "infinite"
        "float scale" [ 0.5 ]
AttributeEnd

AttributeBegin
    Material "dielectric"
        "spectrum eta" [ 350 1.5 750 1.5 ]

    Translate 0 40 0
    Shape "sphere"
        "float radius" [ 15 ]
AttributeEnd

AttributeBegin
    Material "diffuse"
    Rotate -90 1 0 0
        Shape "disk"
            "float radius" [ 1000 ]
AttributeEnd