Sensors

Distant fluxmeter sensor (distantflux)

Parameter

Type

Description

Flags

to_world

transform

Sensor-to-world transformation matrix.

target

point or nested shape plugin

Optional. Define the ray target sampling strategy. If this parameter is unset, ray target points are sampled uniformly on the cross section of the scene’s bounding sphere. If a point is passed, rays will target it. If a shape plugin is passed, ray target points will be sampled from its surface.

ray_offset

float

Optional. Define the ray origin offsetting policy. If this parameter is unset, ray origins are positioned at a far distance from the target. If a value is set, rays are offset by the corresponding distance.

This sensor plugin implements a distant sensor which records the radiative flux density leaving the scene (in W/m², scaled by scene unit length). It covers a hemisphere defined by its to_world parameter and mapped to film coordinates.

The to_world transform is best set using a look_at(). The default orientation covers a hemisphere defined by the [0, 0, 1] direction, and the up film direction is set to [0, 1, 0].

Using a 1x1 film with a stratified sampler is recommended. A different film size can also be used. In that case, the exitant flux is given by the sum of all pixel values.

By default, ray target points are sampled from the cross section of the scene’s bounding sphere. The target parameter can be set to restrict ray target sampling to a specific subregion of the scene. The recorded radiance is averaged over the targeted geometry.

Ray origins are positioned outside of the scene’s geometry.

Warning

  • While setting target using any shape plugin is possible, only specific configurations will produce meaningful results. This is due to ray sampling method: when target is a shape, a point is sampled at its surface, then shifted along the -direction vector by the diameter of the scene’s bounding sphere, effectively positioning the ray origin outside of the geometry. The ray’s weight is set to \(\frac{1}{A \, p}\), where \(A\) is the shape’s surface area and \(p\) is the shape’s position sampling PDF value. This weight definition is irrelevant when the sampled origin may corresponds to multiple points on the shape, i.e. when the sampled ray can intersect the target shape multiple times. From this follows that only flat surfaces should be used to set the target parameter. Typically, one will use a rectangle or disk shape.

  • If this sensor is used with a targeting strategy leading to rays not hitting the scene’s geometry (e.g. default targeting strategy), it will pick up ambient emitter radiance samples (or zero values if no ambient emitter is defined). Therefore, it is almost always preferable to use a nondefault targeting strategy.

Hemispherical distant radiancemeter sensor (hdistant)

Parameter

Type

Description

Flags

to_world

transform

Sensor-to-world transformation matrix.

target

point or nested shape plugin

Optional. Define the ray target sampling strategy. If this parameter is unset, ray target points are sampled uniformly on the cross section of the scene’s bounding sphere. If a point is passed, rays will target it. If a shape plugin is passed, ray target points will be sampled from its surface.

ray_offset

float

Optional. Define the ray origin offsetting policy. If this parameter is unset, ray origins are positioned at a far distance from the target. If a value is set, rays are offset by the corresponding distance.

This sensor plugin implements a distant directional sensor which records radiation leaving the scene. It records the spectral radiance leaving the scene in directions covering a hemisphere defined by its to_world parameter and mapped to film coordinates. To some extent, it can be seen as the adjoint to the envmap emitter.

The to_world transform is best set using a look_at(). The default orientation covers a hemisphere defined by the [0, 0, 1] direction, and the up film direction is set to [0, 1, 0].

The following XML snippet creates a scene with a roughconductor surface illuminated by three directional emitter, each emitting in a single RGB channel. A hdistant plugin with default orientation is defined.

../../_images/sensor_hdistant_illumination_optimized.svg

Example scene illumination setup.

<scene version="2.1.0">
    <sensor type="hdistant" id="hdistant">
        <transform name="to_world">
            <lookat origin="0, 0, 0" target="0, 0, 1" up="0, 1, 0"/>
        </transform>
        <sampler type="independent">
            <integer name="sample_count" value="3200"/>
        </sampler>
        <film type="hdrfilm">
            <integer name="width" value="32"/>
            <integer name="height" value="32"/>
            <string name="pixel_format" value="rgb"/>
            <string name="component_format" value="float32"/>
            <rfilter type="box"/>
        </film>
    </sensor>
    <integrator type="path"/>

    <emitter type="directional">
        <vector name="direction" x="1" y="0" z="-1"/>
        <rgb name="irradiance" value="1, 0, 0"/>
    </emitter>
    <emitter type="directional">
        <vector name="direction" x="1" y="1" z="-1"/>
        <rgb name="irradiance" value="0, 1, 0"/>
    </emitter>
    <emitter type="directional">
        <vector name="direction" x="0" y="1" z="-1"/>
        <rgb name="irradiance" value="0, 0, 1   "/>
    </emitter>

    <shape type="rectangle">
        <bsdf type="roughconductor"/>
    </shape>
</scene>

The following figures show the recorded exitant radiance with the default film orientation (left, up = [0,1,0]) and with a rotated film (right, up = [1,1,0]). Colored dots on the plots materialize emitter directions. The orange arrow represents the up direction on the film. Note that on the plots, the origin of pixel coordinates is taken at the bottom left.

../../_images/sensor_hdistant_film_default_optimized.svg

Default film orientation.

../../_images/sensor_hdistant_default.svg

Exitant radiance with default film orientation.

../../_images/sensor_hdistant_film_rotated_optimized.svg

Rotated film.

../../_images/sensor_hdistant_rotated.svg

Exitant radiance with a rotated film.

By default, ray target points are sampled from the cross section of the scene’s bounding sphere. The target parameter can be set to restrict ray target sampling to a specific subregion of the scene. The recorded radiance is averaged over the targeted geometry.

Ray origins are positioned outside of the scene’s geometry, such that it is as if the sensor would be located at an infinite distance from the scene.

By default, ray target points are sampled from the cross section of the scene’s bounding sphere. The target parameter should be set to restrict ray target sampling to a specific subregion of the scene using a flat surface. The recorded radiance is averaged over the targeted geometry.

Warning

  • While setting target using any shape plugin is possible, only specific configurations will produce meaningful results. This is due to ray sampling method: when target is a shape, a point is sampled at its surface, then shifted along the -direction vector by the diameter of the scene’s bounding sphere, effectively positioning the ray origin outside of the geometry. The ray’s weight is set to \(\frac{1}{A \, p}\), where \(A\) is the shape’s surface area and \(p\) is the shape’s position sampling PDF value. This weight definition is irrelevant when the sampled origin may corresponds to multiple points on the shape, i.e. when the sampled ray can intersect the target shape multiple times. From this follows that only flat surfaces should be used to set the target parameter. Typically, one will use a rectangle or disk shape.

  • If this sensor is used with a targeting strategy leading to rays not hitting the scene’s geometry (e.g. default targeting strategy), it will pick up ambient emitter radiance samples (or zero values if no ambient emitter is defined). Therefore, it is almost always preferable to use a nondefault targeting strategy.

Multi distant radiance meter (mdistant)

Parameter

Type

Description

Flags

directions

string

Comma-separated list of directions in which the sensors are pointing in world coordinates.

target

point or nested shape plugin

Optional. Define the ray target sampling strategy. If this parameter is unset, ray target points are sampled uniformly on the cross section of the scene’s bounding sphere. If a point is passed, rays will target it. If a shape plugin is passed, ray target points will be sampled from its surface.

ray_offset

float

Optional. Define the ray origin offsetting policy. If this parameter is unset, ray origins are positioned at a far distance from the target. If a value is set, rays are offset by the corresponding distance.

This sensor plugin aggregates an arbitrary number of distant directional sensors which records the spectral radiance leaving the scene in specified directions. It is the aggregation of multiple distant sensors.

By default, ray target points are sampled from the cross section of the scene’s bounding sphere. The target parameter can be set to restrict ray target sampling to a specific subregion of the scene. The recorded radiance is averaged over the targeted geometry.

Ray origins are positioned outside of the scene’s geometry.

Warning

  • While setting target using any shape plugin is possible, only specific configurations will produce meaningful results. This is due to ray sampling method: when target is a shape, a point is sampled at its surface, then shifted along the -direction vector by the diameter of the scene’s bounding sphere, effectively positioning the ray origin outside of the geometry. The ray’s weight is set to \(\frac{1}{A \, p}\), where \(A\) is the shape’s surface area and \(p\) is the shape’s position sampling PDF value. This weight definition is irrelevant when the sampled origin may corresponds to multiple points on the shape, i.e. when the sampled ray can intersect the target shape multiple times. From this follows that only flat surfaces should be used to set the target parameter. Typically, one will use a rectangle or disk shape.

  • If this sensor is used with a targeting strategy leading to rays not hitting the scene’s geometry (e.g. default targeting strategy), it will pick up ambient emitter radiance samples (or zero values if no ambient emitter is defined). Therefore, it is almost always preferable to use a nondefault targeting strategy.

Important

This sensor must be used with a film with size (N, 1), where N is the number of aggregated sensors, and is best used with a default box reconstruction filter.

Multi-radiance meter (mradiancemeter)

Parameter

Type

Description

Flags

origins

string

Comma separated list of locations from which the sensors will be recording in world coordinates.

directions

string

Comma separated list of directions in which the sensors are pointing in world coordinates.

This sensor plugin implements multiple radiance meters, as implemented in the radiancemeter plugin.

This sensor allows using the inherent parallelization of Mitsuba2, which is not possible with the radiancemeter due to its film size of 1x1.

The origin points and direction vectors for this sensor are specified as a list of floating point values, where three subsequent values will be grouped into a point or vector respectively.

The following snippet shows how to specify a mradiancemeter with two sensors, one located at (1, 0, 0) and pointing in the direction (-1, 0, 0), the other located at (0, 1, 0) and pointing in the direction (0, -1, 0).

<sensor version="2.0.0" type="mradiancemeter">
    <string name="origins" value="1, 0, 0, 0, 1, 0"/>
    <string name="directions" value="-1, 0, 0, 0, -1, 0"/>
    <film type="hdrfilm">
        <integer name="width" value="2"/>
        <integer name="height" value="1"/>
        <rfilter type="box"/>
    </film>
</sensor>
<shape type="sphere">
    <sensor type="irradiancemeter">
        <!-- film -->
    </sensor>
</shape>

Multi-pixel distant radiancemeter sensor (mpdistant)

Parameter

Type

Description

Flags

to_world

transform

Sensor-to-world transformation matrix.

direction

vector

Alternative (and exclusive) to to_world. Direction orienting the sensor’s reference hemisphere.

target

point or nested shape plugin

Optional. Define the ray target sampling strategy. If this parameter is unset, ray target points are sampled uniformly on the cross section of the scene’s bounding sphere. If a point is passed, rays will target it. If a shape plugin is passed, ray target points will be sampled from its surface.

target_radius

float

Optional. If a point target is used, setting this parameter to a positive value will turn the sensor into a distant radiometer with a fixed field of view defined as the cross section of a sphere of radius target_radius and centered at target. Otherwise, the single point target is targeted.

srf

spectrum

Sensor Response Function that defines the spectral sensitivity of the sensor (Default: none)

This sensor plugin implements a distant directional sensor which records radiation leaving the scene in a given direction. It records the spectral radiance leaving the scene in the specified direction. In its default version, it is the adjoint to the directional emitter.

By default, ray target points are sampled from the cross section of the scene’s bounding sphere. The target parameter can be set to restrict ray target sampling to a specific subregion of the scene.

Ray origins are positioned outside of the scene’s geometry.

If the film size is larger than 1×1, film coordinates are mapped to the (u,v) coordinates of the target shape.

Warning

  • While setting target using any shape plugin is possible, only specific configurations will produce meaningful results. This is due to ray sampling method: when target is a shape, a point is sampled at its surface, then shifted along the -direction vector by the diameter of the scene’s bounding sphere, effectively positioning the ray origin outside of the geometry. The ray’s weight is set to \(\frac{1}{A \, p}\), where \(A\) is the shape’s surface area and \(p\) is the shape’s position sampling PDF value. This weight definition is irrelevant when the sampled origin may corresponds to multiple points on the shape, i.e. when the sampled ray can intersect the target shape multiple times. From this follows that only flat surfaces should be used to set the target parameter. Typically, one will use a rectangle or disk shape.

  • If this sensor is used with a targeting strategy leading to rays not hitting the scene’s geometry (e.g. default targeting strategy), it will pick up ambient emitter radiance samples (or zero values if no ambient emitter is defined). Therefore, it is almost always preferable to use a non-default targeting strategy.