mitsuba-renderer / mitsuba3

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

how to render in spectral mode correctly? #1180

Closed free7187 closed 5 months ago

free7187 commented 6 months ago

Summary

I'm attempting volumetric rendering with spectral rendering, but the results are somewhat unusual compared to what I expected. Due to my lack of experience with spectral rendering, I'm unsure whether the issues are due to my settings or if there are inherent errors in my parameter choices.

Description

I'm rendering in scalar_spectral mode, and my XML configuration is as follows:

<scene version="3.0.0">
    <default name="integrator" value="volpathmis" />
    <default name="spp" value="50000" />
    <default name="res" value="512" />
    <default name="max_depth" value="65" />
    <integrator type="$integrator">
        <integer name="max_depth" value="$max_depth" />
    </integrator>
    <sensor type="perspective" id="sensor">
        <string name="fov_axis" value="smaller"/>
        <float name="near_clip" value="0.001"/>
        <float name="far_clip" value="100.0"/>
        <float name="focus_distance" value="1000"/>
        <float name="fov" value="39.3077"/>
        <transform name="to_world">
            <lookat origin="0,  0.25,  -2.5"
                    target="0,  0.25,  0"
                    up    ="0,  1,  0"/>
        </transform>
        <sampler type="independent">
            <integer name="sample_count" value="$spp"/>
        </sampler>
        <film type="hdrfilm">
            <integer name="width"  value="$res"/>
            <integer name="height" value="$res"/>
            <rfilter type="tent"/>
            <string name="pixel_format" value="rgb"/>
            <string name="component_format" value="float32"/>
        </film>
    </sensor>

    <!-- Light -->   
    <emitter type="point">
        <point name="position" value="0,  0.25,  -2"/>
        <rgb name="intensity" value="15.0,15.0,15.0"/>
    </emitter>

    <!-- Shapes -->
    <shape type="obj">
        <string name="filename" value="head.obj" />
        <transform name="to_world">
            <scale value="1"/>
            <translate x="0" y="0" z="0"/>
        </transform>
        <medium type="homogeneous" name="interior">
            <spectrum name="sigma_t" value="400:0.8163, 410:0.7474, 420:0.6861, 430:0.6315, 440:0.5827, 450:0.5389, 460:0.4995, 470:0.4641, 480:0.4320, 490:0.4030, 500:0.3766, 510:0.3527, 520:0.3309, 530:0.3109, 540:0.2927, 550:0.2760, 560:0.2606, 570:0.2465, 580:0.2335, 590:0.2215, 600:0.2104, 610:0.2002, 620:0.1907, 630:0.1819, 640:0.1737, 650:0.1661, 660:0.1590, 670:0.1524, 680:0.1462, 690:0.1404, 700:0.1350"/>
            <spectrum name="albedo" value="400:0.1536, 410:0.1567, 420:0.1599, 430:0.1634, 440:0.1670, 450:0.1709, 460:0.1749, 470:0.1792, 480:0.1837, 490:0.1883, 500:0.1932, 510:0.1982, 520:0.2035, 530:0.2089, 540:0.2146, 550:0.2204, 560:0.2264, 570:0.2326, 580:0.2389, 590:0.2454, 600:0.2521, 610:0.2590, 620:0.2659, 630:0.2731, 640:0.2803, 650:0.2877, 660:0.2952, 670:0.3028, 680:0.3105, 690:0.3183, 700:0.3262"/>
            <float name="scale" value="25257"/>
        </medium>
    </shape>
</scene>

Is there anything wrong with how my XML is written? Additionally, to achieve accurate spectral results, do I need to make any further adjustments to the sensor or emitter settings?

njroussel commented 5 months ago

Hi @free7187

I can't spot anything wrong in your XML, but I'm also not sure what I'm looking for. If you have doubts, you can always check our test or out resources folder for examples of spectral scene descriptions. For example, we have a spectral Cornell box in resources/data/scenes/cbox/cbox-spectral.xml.

One thing to be aware of is how we handle/integrate the standard D65 illuminant. A while ago we changed how this is handled: https://github.com/mitsuba-renderer/mitsuba3/commit/f883834a50e3dab694b4fe4ceafdfa1ae3712782