yuphin / Lumen

A Vulkan Raytracing framework for various bidirectional path tracing techniques
MIT License
449 stars 29 forks source link

How do I add lights to an XML scene? #12

Open ohmaya opened 1 year ago

ohmaya commented 1 year ago

Yeah, it might be a Mitsuba question.

I took scenes/classroom/scene.xml and added the following:

    <emitter type="point">
        <point name="position" value="-3.7, 5.0, 1.0"/>
        <rgb name="intensity" value="123456789.0"/>
    </emitter>
    <shape type="rectangle">
        <transform name="toWorld">
            <matrix value="0.53241 0 0 -1.47544 0 0.907794 1.78252e-008 1.18968 0 1.78252e-008 0.5 -1.26735 0 0 0 1"/>
        </transform>
        <bsdf type="twosided">
            <bsdf type="diffuse">
                <rgb name="reflectance" value="0, 0, 0"/>
            </bsdf>
        </bsdf>
        <emitter type="area">
            <rgb name="radiance" value="123456789.0, 123456789.0, 123456789.0"/>
        </emitter>
    </shape>

There didn't seem to be new lights in the rendering.

scenes\bedroom\scene.xml contains 2 area emitters, which do not seem to appear in renderings.

Also didn't see sphere:

    <shape type="sphere">
        <float name="radius" value="10"/>
        <transform name="toWorld">
            <translate x="-3.6" y="5.0" z="1.4"/>
        </transform>
        <ref id="Walls" />
    </shape>

Thanks.

ohmaya commented 1 year ago

Also added emitter to the FlagRed, didn't see any illumination.

    <shape type="obj" >
        <string name="filename" value="models/Mesh013.obj" />
        <transform name="toWorld" >
            <matrix value="1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1"/>
        </transform>
        <ref id="FlagRed" />
        <emitter type="area">
            <rgb name="radiance" value="123456789.0, 123456789.0, 123456789.0"/>
        </emitter>
    </shape>
yuphin commented 1 year ago

Currently most Mitsuba light types are not supported (actually only the directional one is supported). They'll be extended in time.