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

Abstract participating medium. More...

#include <mitsuba/render/medium.h>

+ Inheritance diagram for mitsuba::Medium:

Public Member Functions

virtual const ClassgetClass () const
 Retrieve this object's class. More...
 
Medium sampling strategy
virtual bool sampleDistance (const Ray &ray, MediumSamplingRecord &mRec, Sampler *sampler) const =0
 Sample a distance along the ray segment [mint, maxt]. More...
 
virtual void eval (const Ray &ray, MediumSamplingRecord &mRec) const =0
 Compute the 1D density of sampling distance ray.maxt along the ray using the sampling strategy implemented by sampleDistance. More...
 
Functions for querying the medium
virtual Spectrum evalTransmittance (const Ray &ray, Sampler *sampler=NULL) const =0
 Compute the transmittance along a ray segment. More...
 
const PhaseFunctiongetPhaseFunction () const
 Return the phase function of this medium. More...
 
virtual bool isHomogeneous () const =0
 Determine whether the medium is homogeneous. More...
 
const SpectrumgetSigmaA () const
 For homogeneous media: return the absorption coefficient. More...
 
const SpectrumgetSigmaS () const
 For homogeneous media: return the scattering coefficient. More...
 
const SpectrumgetSigmaT () const
 For homogeneous media: return the extinction coefficient. More...
 
Miscellaneous
virtual void configure ()
 Configure the object (called once after construction and addition of all child ConfigurableObject instances). More...
 
virtual void serialize (Stream *stream, InstanceManager *manager) const
 Serialize this medium to a stream. More...
 
virtual void addChild (const std::string &name, ConfigurableObject *child)
 Add a child ConfigurableObject. More...
 
void addChild (ConfigurableObject *child)
 Add an unnamed child. More...
 
virtual std::string toString () const =0
 Return a string representation. More...
 
- Public Member Functions inherited from mitsuba::NetworkedObject
virtual void bindUsedResources (ParallelProcess *proc) const
 Bind any used resources to the process proc. More...
 
virtual void wakeup (ConfigurableObject *parent, std::map< std::string, SerializableObject * > &params)
 Retrieve any required resources. More...
 
- Public Member Functions inherited from mitsuba::ConfigurableObject
virtual void setParent (ConfigurableObject *parent)
 Notify the ConfigurableObject instance about its parent object. More...
 
void addChild (ConfigurableObject *child)
 Add an unnamed child. 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::NetworkedObject
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

 Medium (const Properties &props)
 Create a new participating medium instance. More...
 
 Medium (Stream *stream, InstanceManager *manager)
 Unserialize a participating medium. More...
 
virtual ~Medium ()
 Virtual destructor. More...
 
- Protected Member Functions inherited from mitsuba::NetworkedObject
virtual ~NetworkedObject ()
 Virtual destructor. More...
 
 NetworkedObject (const Properties &props)
 Constructor. More...
 
 NetworkedObject (Stream *stream, InstanceManager *manager)
 Unserialize a configurable object. 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

ref< PhaseFunctionm_phaseFunction
 
Spectrum m_sigmaA
 
Spectrum m_sigmaS
 
Spectrum m_sigmaT
 
- 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 participating medium.

Constructor & Destructor Documentation

mitsuba::Medium::Medium ( const Properties props)
protected

Create a new participating medium instance.

mitsuba::Medium::Medium ( Stream stream,
InstanceManager manager 
)
protected

Unserialize a participating medium.

virtual mitsuba::Medium::~Medium ( )
inlineprotectedvirtual

Virtual destructor.

Member Function Documentation

virtual void mitsuba::Medium::addChild ( const std::string &  name,
ConfigurableObject child 
)
virtual

Add a child ConfigurableObject.

Reimplemented from mitsuba::ConfigurableObject.

void mitsuba::Medium::addChild ( ConfigurableObject child)
inline

Add an unnamed child.

virtual void mitsuba::Medium::configure ( )
virtual

Configure the object (called once after construction and addition of all child ConfigurableObject instances).

Reimplemented from mitsuba::ConfigurableObject.

virtual void mitsuba::Medium::eval ( const Ray ray,
MediumSamplingRecord mRec 
) const
pure virtual

Compute the 1D density of sampling distance ray.maxt along the ray using the sampling strategy implemented by sampleDistance.

The function computes the continuous densities in the case of a successful sampleDistance() invocation (in both directions), as well as the Dirac delta density associated with a failure. For convenience, it also stores the transmittance along the supplied ray segment within mRec.

virtual Spectrum mitsuba::Medium::evalTransmittance ( const Ray ray,
Sampler sampler = NULL 
) const
pure virtual

Compute the transmittance along a ray segment.

Computes the transmittance along a ray segment [mint, maxt] associated with the ray. It is assumed that the ray has a normalized direction value.

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

Retrieve this object's class.

Reimplemented from mitsuba::NetworkedObject.

const PhaseFunction* mitsuba::Medium::getPhaseFunction ( ) const
inline

Return the phase function of this medium.

const Spectrum& mitsuba::Medium::getSigmaA ( ) const
inline

For homogeneous media: return the absorption coefficient.

const Spectrum& mitsuba::Medium::getSigmaS ( ) const
inline

For homogeneous media: return the scattering coefficient.

const Spectrum& mitsuba::Medium::getSigmaT ( ) const
inline

For homogeneous media: return the extinction coefficient.

virtual bool mitsuba::Medium::isHomogeneous ( ) const
pure virtual

Determine whether the medium is homogeneous.

virtual bool mitsuba::Medium::sampleDistance ( const Ray ray,
MediumSamplingRecord mRec,
Sampler sampler 
) const
pure virtual

Sample a distance along the ray segment [mint, maxt].

Should ideally importance sample with respect to the transmittance. It is assumed that the ray has a normalized direction value.

Parameters
rayRay, along which a distance should be sampled
mRecMedium sampling record to be filled with the result
Returns
false if the maximum distance was exceeded, or if no interaction inside the medium could be sampled.
virtual void mitsuba::Medium::serialize ( Stream stream,
InstanceManager manager 
) const
virtual

Serialize this medium to a stream.

Reimplemented from mitsuba::NetworkedObject.

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

Return a string representation.

Reimplemented from Object.

Member Data Documentation

ref<PhaseFunction> mitsuba::Medium::m_phaseFunction
protected
Spectrum mitsuba::Medium::m_sigmaA
protected
Spectrum mitsuba::Medium::m_sigmaS
protected
Spectrum mitsuba::Medium::m_sigmaT
protected
Class* mitsuba::Medium::m_theClass
static

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