Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mitsuba::PositionSamplingRecord Struct Reference

Generic sampling record for positions. More...

#include <mitsuba/render/common.h>

+ Inheritance diagram for mitsuba::PositionSamplingRecord:

Public Member Functions

 PositionSamplingRecord ()
 Create an invalid position sampling record. More...
 
 PositionSamplingRecord (Float time)
 Create a new position sampling record that can be passed e.g. to Shape::samplePosition. More...
 
 PositionSamplingRecord (const Intersection &its, EMeasure measure=EArea)
 Create a position sampling record from a surface intersection. More...
 
std::string toString () const
 Return a human-readable description of the record. More...
 

Public Attributes

Point p
 Sampled position. More...
 
Float time
 Associated time value. More...
 
Normal n
 Sampled surface normal (if applicable) More...
 
Float pdf
 Probability density at the sample. More...
 
EMeasure measure
 Denotes the measure associated with the sample. More...
 
Point2 uv
 Optional: 2D sample position associated with the record. More...
 
const ConfigurableObjectobject
 Optional: Pointer to an associated object. More...
 

Detailed Description

Generic sampling record for positions.

This sampling record is used to implement techniques that draw a position from a point, line, surface, or volume domain in 3D and furthermore provide auxilary information about the sample.

Apart from returning the position and (optionally) the surface normal, the responsible sampling method must annotate the record with the associated probability density and measure.

Constructor & Destructor Documentation

mitsuba::PositionSamplingRecord::PositionSamplingRecord ( )
inline

Create an invalid position sampling record.

mitsuba::PositionSamplingRecord::PositionSamplingRecord ( Float  time)
inline

Create a new position sampling record that can be passed e.g. to Shape::samplePosition.

Parameters
timeSpecifies the time that should be associated with the position sample. This only matters when things are in motion
mitsuba::PositionSamplingRecord::PositionSamplingRecord ( const Intersection its,
EMeasure  measure = EArea 
)
inline

Create a position sampling record from a surface intersection.

This is useful to determine the hypothetical sampling density on a surface after hitting it using standard ray tracing. This happens for instance in path tracing with multiple importance sampling.

Member Function Documentation

std::string mitsuba::PositionSamplingRecord::toString ( ) const

Return a human-readable description of the record.

Member Data Documentation

EMeasure mitsuba::PositionSamplingRecord::measure

Denotes the measure associated with the sample.

This is necessary to deal with quantities that are defined on unusual spaces, e.g. areas that have collapsed to a point or a line.

Normal mitsuba::PositionSamplingRecord::n

Sampled surface normal (if applicable)

const ConfigurableObject* mitsuba::PositionSamplingRecord::object

Optional: Pointer to an associated object.

In some uses of this record, sampling a position also involves choosing one of several objects (shapes, emitters, ..) on which the position lies. In that case, the object attribute stores a pointer to this object.

Point mitsuba::PositionSamplingRecord::p

Sampled position.

Float mitsuba::PositionSamplingRecord::pdf

Probability density at the sample.

Float mitsuba::PositionSamplingRecord::time

Associated time value.

Point2 mitsuba::PositionSamplingRecord::uv

Optional: 2D sample position associated with the record.

In some uses of this record, a sampled position may be associated with an important 2D quantity, such as the texture coordinates on a triangle mesh or a position on the aperture of a sensor. When applicable, such positions are stored in the uv attribute.


The documentation for this struct was generated from the following file: