Mitsuba Renderer  0.5.0
mitsuba::DirectSamplingRecord Struct Reference

Record for solid-angle based area sampling techniques. More...

#include <mitsuba/render/common.h>

Inheritance diagram for mitsuba::DirectSamplingRecord:

## Public Member Functions

DirectSamplingRecord ()
Create an invalid direct sampling record. More...

DirectSamplingRecord (const Point &ref, Float time)
Create an new direct sampling record for a reference point ref located somewhere in space (i.e. not on a surface) More...

DirectSamplingRecord (const Intersection &refIts)
Create an new direct sampling record for a reference point ref located on a surface. More...

DirectSamplingRecord (const MediumSamplingRecord &mRec)
Create an new direct sampling record for a reference point ref located in a medium. More...

void setQuery (const Ray &ray, const Intersection &its, EMeasure measure=ESolidAngle)
Create a direct sampling record, which can be used to query the density of a surface position (where there reference point lies on a surface) More...

std::string toString () const
Return a human-readable description of the record. More...

Public Member Functions inherited from mitsuba::PositionSamplingRecord
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 ref
Reference point for direct sampling. More...

Normal refN
Optional: normal vector associated with the reference point. More...

Vector d
Unit direction from the reference point to the target direction. More...

Float dist
Distance from the reference point to the target direction. More...

Public Attributes inherited from mitsuba::PositionSamplingRecord
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

Record for solid-angle based area sampling techniques.

This sampling record is used to implement techniques that randomly pick a position on the surface of an object with the goal of importance sampling a quantity that is defined over the sphere seen from a given reference point.

This general approach for sampling positions is named "direct" sampling throughout Mitsuba motivated by direct illumination rendering techniques, which represent the most important application.

This record inherits all fields from PositionSamplingRecord and extends it with two useful quantities that are cached so that they don't need to be recomputed many times: the unit direction and length from the reference position to the sampled point.

## Constructor & Destructor Documentation

 mitsuba::DirectSamplingRecord::DirectSamplingRecord ( )
inline

Create an invalid direct sampling record.

 mitsuba::DirectSamplingRecord::DirectSamplingRecord ( const Point & ref, Float time )
inline

Create an new direct sampling record for a reference point ref located somewhere in space (i.e. not on a surface)

Parameters
 ref The reference point time An associated time value
 DirectSamplingRecord::DirectSamplingRecord ( const Intersection & refIts )
inline

Create an new direct sampling record for a reference point ref located on a surface.

Parameters
 its The reference point specified using an intersection record
 mitsuba::DirectSamplingRecord::DirectSamplingRecord ( const MediumSamplingRecord & mRec )
inline

Create an new direct sampling record for a reference point ref located in a medium.

Parameters
 mRec The reference point specified using an medium sampling record

## Member Function Documentation

 void DirectSamplingRecord::setQuery ( const Ray & ray, const Intersection & its, EMeasure measure = ESolidAngle )
inline

Create a direct sampling record, which can be used to query the density of a surface position (where there reference point lies on a surface)

Parameters
 ray Reference to the ray that generated the intersection its. The ray origin must be located at refIts.p its A surface intersection record (usually on an emitter)
 std::string mitsuba::DirectSamplingRecord::toString ( ) const

Return a human-readable description of the record.

## Member Data Documentation

 Vector mitsuba::DirectSamplingRecord::d

Unit direction from the reference point to the target direction.

 Float mitsuba::DirectSamplingRecord::dist

Distance from the reference point to the target direction.

 Point mitsuba::DirectSamplingRecord::ref

Reference point for direct sampling.

 Normal mitsuba::DirectSamplingRecord::refN

Optional: normal vector associated with the reference point.

When nonzero, the direct sampling method can use the normal vector to sample according to the projected solid angle at ref.

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