@@ -53,11 +53,11 @@ class MI_EXPORT_LIB Shape : public Object {
5353 * \return
5454 * A \ref PositionSample instance describing the generated sample
5555 */
56- virtual PositionSample3f sample_position (Float time, const Point2f &sample,
56+ virtual PositionSample3f sample_position_surface (Float time, const Point2f &sample,
5757 Mask active = true ) const ;
5858
5959 /* *
60- * \brief Query the probability density of \ref sample_position () for
60+ * \brief Query the probability density of \ref sample_position_surface () for
6161 * a particular point on the surface.
6262 *
6363 * \param ps
@@ -66,7 +66,7 @@ class MI_EXPORT_LIB Shape : public Object {
6666 * \return
6767 * The probability density per unit area
6868 */
69- virtual Float pdf_position (const PositionSample3f &ps, Mask active = true ) const ;
69+ virtual Float pdf_position_surface (const PositionSample3f &ps, Mask active = true ) const ;
7070
7171 /* *
7272 * \brief Sample a point in the volume of this shape
@@ -85,11 +85,11 @@ class MI_EXPORT_LIB Shape : public Object {
8585 * \return
8686 * A \ref PositionSample instance describing the generated sample
8787 */
88- virtual PositionSample3f sample_position_3d (Float time, const Point3f &sample,
88+ virtual PositionSample3f sample_position_volume (Float time, const Point3f &sample,
8989 Mask active = true ) const ;
9090
9191 /* *
92- * \brief Query the probability density of \ref sample_position () for
92+ * \brief Query the probability density of \ref sample_position_volume () for
9393 * a particular point in the volume.
9494 *
9595 * \param ps
@@ -98,7 +98,7 @@ class MI_EXPORT_LIB Shape : public Object {
9898 * \return
9999 * The probability density per unit volume
100100 */
101- virtual Float pdf_position_3d (const PositionSample3f &ps, Mask active = true ) const ;
101+ virtual Float pdf_position_volume (const PositionSample3f &ps, Mask active = true ) const ;
102102
103103 /* *
104104 * \brief Sample a direction towards this shape with respect to solid
@@ -114,7 +114,7 @@ class MI_EXPORT_LIB Shape : public Object {
114114 *
115115 * When the Shape subclass does not supply a custom implementation of this
116116 * function, the \ref Shape class reverts to a fallback approach that
117- * piggybacks on \ref sample_position (). This will generally lead to a
117+ * piggybacks on \ref sample_position_surface (). This will generally lead to a
118118 * suboptimal sample placement and higher variance in Monte Carlo
119119 * estimators using the samples.
120120 *
@@ -127,11 +127,59 @@ class MI_EXPORT_LIB Shape : public Object {
127127 * \return
128128 * A \ref DirectionSample instance describing the generated sample
129129 */
130- virtual DirectionSample3f sample_direction (const Interaction3f &it, const Point2f &sample,
131- Mask active = true ) const ;
130+ virtual DirectionSample3f
131+ sample_direction_surface (const Interaction3f &it, const Point2f &sample,
132+ Mask active = true ) const ;
133+
134+ /* *
135+ * \brief Query the probability density of \ref sample_direction_surface()
136+ *
137+ * \param it
138+ * A reference position somewhere within the scene.
139+ *
140+ * \param ps
141+ * A position record describing the sample in question
142+ *
143+ * \return
144+ * The probability density per unit solid angle
145+ */
146+ virtual Float pdf_direction_surface (const Interaction3f &it, const DirectionSample3f &ds,
147+ Mask active = true ) const ;
148+
149+ /* *
150+ * \brief Sample a direction towards a point contained within this shape
151+ * with respect to solid angles measured at a reference position
152+ * within the scene
153+ *
154+ * An ideal implementation of this interface would achieve a uniform solid
155+ * angle density within the volume that is visible from the
156+ * reference position <tt>it.p</tt> (though such an ideal implementation
157+ * is usually neither feasible nor advisable due to poor efficiency).
158+ *
159+ * The function returns the sampled position and the inverse probability
160+ * per unit solid angle associated with the sample.
161+ *
162+ * When the Shape subclass does not supply a custom implementation of this
163+ * function, the \ref Shape class reverts to a fallback approach that
164+ * piggybacks on \ref sample_position_volume(). This will generally lead to a
165+ * suboptimal sample placement and higher variance in Monte Carlo
166+ * estimators using the samples.
167+ *
168+ * \param it
169+ * A reference position somewhere within the scene.
170+ *
171+ * \param sample
172+ * A uniformly distributed 3D point on the domain <tt>[0,1]^3</tt>
173+ *
174+ * \return
175+ * A \ref DirectionSample instance describing the generated sample
176+ */
177+ virtual DirectionSample3f
178+ sample_direction_volume (const Interaction3f &it, const Point3f &sample,
179+ Mask active = true ) const ;
132180
133181 /* *
134- * \brief Query the probability density of \ref sample_direction ()
182+ * \brief Query the probability density of \ref sample_direction_volume ()
135183 *
136184 * \param it
137185 * A reference position somewhere within the scene.
@@ -142,8 +190,8 @@ class MI_EXPORT_LIB Shape : public Object {
142190 * \return
143191 * The probability density per unit solid angle
144192 */
145- virtual Float pdf_direction (const Interaction3f &it, const DirectionSample3f &ds,
146- Mask active = true ) const ;
193+ virtual Float pdf_direction_volume (const Interaction3f &it, const DirectionSample3f &ds,
194+ Mask active = true ) const ;
147195
148196 // ! @}
149197 // =============================================================
@@ -699,12 +747,14 @@ DRJIT_VCALL_TEMPLATE_BEGIN(mitsuba::Shape)
699747 DRJIT_VCALL_METHOD(ray_intersect_preliminary)
700748 DRJIT_VCALL_METHOD(ray_intersect)
701749 DRJIT_VCALL_METHOD(ray_test)
702- DRJIT_VCALL_METHOD(sample_position)
703- DRJIT_VCALL_METHOD(pdf_position)
704- DRJIT_VCALL_METHOD(sample_position_3d)
705- DRJIT_VCALL_METHOD(pdf_position_3d)
706- DRJIT_VCALL_METHOD(sample_direction)
707- DRJIT_VCALL_METHOD(pdf_direction)
750+ DRJIT_VCALL_METHOD(sample_position_surface)
751+ DRJIT_VCALL_METHOD(pdf_position_surface)
752+ DRJIT_VCALL_METHOD(sample_position_volume)
753+ DRJIT_VCALL_METHOD(pdf_position_volume)
754+ DRJIT_VCALL_METHOD(sample_direction_surface)
755+ DRJIT_VCALL_METHOD(pdf_direction_surface)
756+ DRJIT_VCALL_METHOD(sample_direction_volume)
757+ DRJIT_VCALL_METHOD(pdf_direction_volume)
708758 DRJIT_VCALL_METHOD(surface_area)
709759 DRJIT_VCALL_METHOD(volume)
710760 DRJIT_VCALL_GETTER(emitter, const typename Class::Emitter *)
0 commit comments