Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mitsuba::PhaseFunction Class Referenceabstract

Abstract phase function. More...

#include <mitsuba/render/phase.h>

+ Inheritance diagram for mitsuba::PhaseFunction:

Public Types

enum  EPhaseFunctionType { EIsotropic = 0x01, EAngleDependence = 0x04, EAnisotropic = 0x02, ENonSymmetric = 0x08 }
 

Public Member Functions

unsigned int getType () const
 Return information flags of this phase function, combined binary OR. More...
 
virtual void configure ()
 Configure the material (called after construction by the XML parser) More...
 
virtual Float eval (const PhaseFunctionSamplingRecord &pRec) const =0
 Evaluate the phase function for an outward-pointing pair of directions (wi, wo) More...
 
virtual Float sample (PhaseFunctionSamplingRecord &pRec, Sampler *sampler) const =0
 Sample the phase function and return the importance weight (i.e. the value of the phase function divided by the probability density of the sample). More...
 
virtual Float sample (PhaseFunctionSamplingRecord &pRec, Float &pdf, Sampler *sampler) const =0
 Sample the phase function and return the probability density and the importance weight of the sample (i.e. the value of the phase function divided by the probability density) More...
 
virtual Float pdf (const PhaseFunctionSamplingRecord &pRec) const
 Calculate the probability of sampling wo (given wi). More...
 
virtual bool needsDirectionallyVaryingCoefficients () const
 Does this phase function require directionally varying scattering and extinction coefficients? More...
 
virtual Float sigmaDir (Float cosTheta) const
 For anisotropic media: evaluate the directionally varying component of the scattering and absorption coefficients. More...
 
virtual Float sigmaDirMax () const
 Returns the maximum value take on on by sigmaDirMax(). This is useful when implementing Woodcock tracking. More...
 
virtual Float getMeanCosine () const
 Returns the mean cosine (often referred to by the constant "g") of this phase function. More...
 
virtual std::string toString () const =0
 Return a string representation. More...
 
virtual const ClassgetClass () const
 Retrieve this object's class. More...
 
- Public Member Functions inherited from mitsuba::ConfigurableObject
virtual void setParent (ConfigurableObject *parent)
 Notify the ConfigurableObject instance about its parent object. More...
 
virtual void addChild (const std::string &name, ConfigurableObject *child)
 Add a child (default implementation throws an error) More...
 
void addChild (ConfigurableObject *child)
 Add an unnamed child. More...
 
virtual void serialize (Stream *stream, InstanceManager *manager) const
 Serialize this object to a binary data stream. More...
 
const std::string & getID () const
 Return the identifier associated with this instance (or "unnamed") More...
 
void setID (const std::string &name)
 Set the identifier associated with this instance. More...
 
const PropertiesgetProperties () const
 Return the properties object that was originally used to create this instance. More...
 
- Public Member Functions inherited from mitsuba::SerializableObject
 SerializableObject (Stream *stream, InstanceManager *manager)
 Unserialize a serializable object. More...
 
- Public Member Functions inherited from Object
 Object ()
 Construct a new object. More...
 
int getRefCount () const
 Return the current reference count. More...
 
void incRef () const
 Increase the reference count of the object by one. More...
 
void decRef (bool autoDeallocate=true) const
 Decrease the reference count of the object and possibly deallocate it. More...
 

Static Public Attributes

static Classm_theClass
 
- Static Public Attributes inherited from mitsuba::ConfigurableObject
static Classm_theClass
 
- Static Public Attributes inherited from mitsuba::SerializableObject
static Classm_theClass
 
- Static Public Attributes inherited from Object
static Classm_theClass
 Pointer to the object's class descriptor. More...
 

Protected Member Functions

 PhaseFunction (const Properties &props)
 Create a new phase function instance. More...
 
 PhaseFunction (Stream *stream, InstanceManager *manager)
 Unserialize a phase function. More...
 
virtual ~PhaseFunction ()
 Virtual destructor. More...
 
- Protected Member Functions inherited from mitsuba::ConfigurableObject
virtual ~ConfigurableObject ()
 Virtual destructor. More...
 
 ConfigurableObject (const Properties &props)
 Construct a configurable object. More...
 
 ConfigurableObject (Stream *stream, InstanceManager *manager)
 Unserialize a configurable object. More...
 
- Protected Member Functions inherited from mitsuba::SerializableObject
 SerializableObject ()
 Construct a serializable object. More...
 
virtual ~SerializableObject ()
 Virtual deconstructor. More...
 
- Protected Member Functions inherited from Object
virtual ~Object ()
 Virtual private deconstructor. (Will only be called by ref) More...
 

Protected Attributes

unsigned int m_type
 
- Protected Attributes inherited from mitsuba::ConfigurableObject
Properties m_properties
 

Additional Inherited Members

- Static Public Member Functions inherited from Object
static void staticInitialization ()
 Initializes the built-in reference count debugger (if enabled) More...
 
static void staticShutdown ()
 Free the memory taken by staticInitialization() More...
 

Detailed Description

Abstract phase function.

Member Enumeration Documentation

Enumerator
EIsotropic 

Completely isotropic 1/(4 pi) phase function.

EAngleDependence 

The phase function only depends on dot(wi,wo)

EAnisotropic 

The opposite of EAngleDependence (there is an arbitrary dependence)

ENonSymmetric 

The phase function is non symmetric, i.e. eval(wi,wo) != eval(wo, wi)

Constructor & Destructor Documentation

mitsuba::PhaseFunction::PhaseFunction ( const Properties props)
inlineprotected

Create a new phase function instance.

mitsuba::PhaseFunction::PhaseFunction ( Stream stream,
InstanceManager manager 
)
inlineprotected

Unserialize a phase function.

virtual mitsuba::PhaseFunction::~PhaseFunction ( )
inlineprotectedvirtual

Virtual destructor.

Member Function Documentation

virtual void mitsuba::PhaseFunction::configure ( )
virtual

Configure the material (called after construction by the XML parser)

Reimplemented from mitsuba::ConfigurableObject.

virtual Float mitsuba::PhaseFunction::eval ( const PhaseFunctionSamplingRecord pRec) const
pure virtual

Evaluate the phase function for an outward-pointing pair of directions (wi, wo)

virtual const Class* mitsuba::PhaseFunction::getClass ( ) const
virtual

Retrieve this object's class.

Reimplemented from mitsuba::ConfigurableObject.

virtual Float mitsuba::PhaseFunction::getMeanCosine ( ) const
virtual

Returns the mean cosine (often referred to by the constant "g") of this phase function.

The default implementation throws an exception

unsigned int mitsuba::PhaseFunction::getType ( ) const
inline

Return information flags of this phase function, combined binary OR.

See Also
EPhaseFunctionType
virtual bool mitsuba::PhaseFunction::needsDirectionallyVaryingCoefficients ( ) const
virtual

Does this phase function require directionally varying scattering and extinction coefficients?

This is used to implement rendering of media that have an anisotropic structure (cf. "A radiative transfer framework for rendering materials with anisotropic structure" by Wenzel Jakob, Adam Arbree, Jonathan T. Moon, Kavita Bala, and Steve Marschner, SIGGRAPH 2010)

virtual Float mitsuba::PhaseFunction::pdf ( const PhaseFunctionSamplingRecord pRec) const
virtual

Calculate the probability of sampling wo (given wi).

Assuming that the phase function can be sampled exactly, the default implementation just evaluates eval()

virtual Float mitsuba::PhaseFunction::sample ( PhaseFunctionSamplingRecord pRec,
Sampler sampler 
) const
pure virtual

Sample the phase function and return the importance weight (i.e. the value of the phase function divided by the probability density of the sample).

When the probability density is not explicitly required, this function should be preferred, since it is potentially faster by making use of cancellations during the division.

Parameters
pRecA phase function query record
samplerA sample generator
Returns
The phase function value divided by the probability density of the sample
virtual Float mitsuba::PhaseFunction::sample ( PhaseFunctionSamplingRecord pRec,
Float pdf,
Sampler sampler 
) const
pure virtual

Sample the phase function and return the probability density and the importance weight of the sample (i.e. the value of the phase function divided by the probability density)

Parameters
pRecA phase function query record
samplerA sample generator
pdfWill record the probability with respect to solid angles
Returns
The phase function value divided by the probability density of the sample
virtual Float mitsuba::PhaseFunction::sigmaDir ( Float  cosTheta) const
virtual

For anisotropic media: evaluate the directionally varying component of the scattering and absorption coefficients.

Parameters
cosThetaAngle between the axis of rotational symmetry and the direction of propagation
virtual Float mitsuba::PhaseFunction::sigmaDirMax ( ) const
virtual

Returns the maximum value take on on by sigmaDirMax(). This is useful when implementing Woodcock tracking.

virtual std::string mitsuba::PhaseFunction::toString ( ) const
pure virtual

Return a string representation.

Reimplemented from Object.

Member Data Documentation

Class* mitsuba::PhaseFunction::m_theClass
static
unsigned int mitsuba::PhaseFunction::m_type
protected

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