Skip to content

Commit 2e7ef08

Browse files
committed
Distant plugin fix and docs update
1 parent b4e6a8a commit 2e7ef08

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

src/sensors/distant.cpp

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,14 @@ Distant directional sensor (:monosp:`distant`)
3232
uniformly over the entire scene.
3333
3434
This sensor plugin implements a distant directional sensor which records
35-
radiation leaving the scene in a given direction. If the ``target`` parameter
36-
is not set, rays cast by the sensor will be distributed uniformly on the cross
37-
section of the scene's bounding sphere.
35+
radiation leaving the scene in a given direction. By default, it records the
36+
(spectral) radiant flux per unit solid angle leaving the scene in the specified
37+
direction (in unit power per unit solid angle). Rays cast by the sensor are
38+
distributed uniformly on the cross section of the scene's bounding sphere.
39+
40+
If the ``target`` parameter is not set, the sensor looks at a single point and
41+
records a (spectral) radiant flux per unit surface area per unit solid angle
42+
(in unit power per unit surface area per unit solid angle).
3843
3944
*/
4045

@@ -116,7 +121,10 @@ MTS_VARIANT class DistantSensor final : public Sensor<Float, Spectrum> {
116121
}
117122

118123
ray.update();
119-
return std::make_pair(ray, wav_weight);
124+
return std::make_pair(
125+
ray, m_has_target
126+
? wav_weight
127+
: wav_weight * (math::Pi<Float> * sqr(m_bsphere.radius)));
120128
}
121129

122130
std::pair<RayDifferential3f, Spectrum> sample_ray_differential(
@@ -153,7 +161,10 @@ MTS_VARIANT class DistantSensor final : public Sensor<Float, Spectrum> {
153161
ray.has_differentials = false;
154162

155163
ray.update();
156-
return std::make_pair(ray, wav_weight);
164+
return std::make_pair(
165+
ray, m_has_target
166+
? wav_weight
167+
: wav_weight * (math::Pi<Float> * sqr(m_bsphere.radius)));
157168
}
158169

159170
/// This sensor does not occupy any particular region of space, return an

0 commit comments

Comments
 (0)