Skip to content

Results vary vs sample count while they should not #82

@leroyvn

Description

@leroyvn

When rendering a simple scene with the path tracer, my results vary with the number of samples. The scene is composed of a square surface with the default diffuse BSDF illuminated by an environment emitter (constant or directional) (see below a render at 32 SPP with the constant emitter).

scene

The code I used is on this gist. I'm using a perspective camera with a single pixel and a very small field of view to make sure that I only see a small part of the square and no background. With both emitters, I vary the number of SPP by powers of 10 up to 1e8. The theoretical solution is rho (the surface's reflectance) for the constant emitter case and rho / pi for the directional emitter case. Results are as follows:

emitter      spp    li
------------ ------ -----------
constant     1e+00  0.256591797
constant     1e+01  0.50390625
constant     1e+02  0.484130859
constant     1e+03  0.492675781
constant     1e+04  0.499267578
constant     1e+05  0.5
constant     1e+06  0.500488281
constant     1e+07  0.505371094
constant     1e+08  1.0
------------ ------ -----------
directional  1e+00  0.159179688
directional  1e+01  0.159179688
directional  1e+02  0.159179688
directional  1e+03  0.159179688
directional  1e+04  0.159179688
directional  1e+05  0.159179688
directional  1e+06  0.157592773
directional  1e+07  0.153076172
directional  1e+08  0.25

Or, as a plot:
results_vs_spp

Depending on the number of samples taken, the incoming radiance at the sensor varies. I'm surprised to see something like that since the value returned by either emitter is constant. I'm actually also surprised to see that the results plateau with good accuracy until 100.000 samples for the directional case and do not for the constant case. Discrepancies become high when reaching 100 million SPP.

Any idea of what could be the cause of that?

System configuration

Platform: macOS 10.15.4
Compiler: Apple clang version 11.0.0 (clang-1100.0.33.17)
Python version: Python 3.7.5 :: Anaconda, Inc.
Mitsuba commit hash: bad308d
Variant used: scalar_rgb

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions