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

Abstract radiance emitter interface. More...

#include <mitsuba/render/emitter.h>

+ Inheritance diagram for mitsuba::Emitter:

Public Types

enum  EEmitterFlags { EEnvironmentEmitter = 0x010 }
 This list of flags is used to additionally characterize and classify the response functions of different types of sensors. More...
 
- Public Types inherited from mitsuba::AbstractEmitter
enum  EEmitterType { EDeltaDirection = 0x01, EDeltaPosition = 0x02, EOnSurface = 0x04 }
 Flags used to classify the emission profile of different types of emitters. More...
 

Public Member Functions

virtual const ClassgetClass () const
 Retrieve this object's class. More...
 
Additional emitter-related sampling and query functions
virtual Spectrum eval (const Intersection &its, const Vector &d) const
 Return the radiant emittance for the given surface intersection. More...
 
virtual Spectrum sampleRay (Ray &ray, const Point2 &spatialSample, const Point2 &directionalSample, Float time) const
 Importance sample a ray according to the emission profile. More...
 
Miscellaneous
Float getSamplingWeight () const
 Return the luminaire's sampling weight. More...
 
virtual ref< BitmapgetBitmap (const Vector2i &sizeHint=Vector2i(-1,-1)) const
 Return a bitmap representation of the emitter. More...
 
virtual void serialize (Stream *stream, InstanceManager *manager) const
 Serialize this emitter to a binary data stream. More...
 
virtual bool isCompound () const
 Is this a compound emitter consisting of several sub-objects? More...
 
virtual EmittergetElement (size_t index)
 Return a sub-element of a compound emitter. More...
 
Functionality related to environment emitters
bool isEnvironmentEmitter () const
 Is this an environment emitter? (e.g. an HDRI environment map?) More...
 
virtual Spectrum evalEnvironment (const RayDifferential &ray) const
 Return the radiant emittance from an environment emitter. More...
 
virtual bool fillDirectSamplingRecord (DirectSamplingRecord &dRec, const Ray &ray) const
 Fill out a data record that can be used to query the direct illumination sampling density of an environment emitter. More...
 
- Public Member Functions inherited from mitsuba::AbstractEmitter
virtual Spectrum samplePosition (PositionSamplingRecord &pRec, const Point2 &sample, const Point2 *extra=NULL) const
 Importance sample the spatial component of the emission profile. More...
 
virtual Spectrum sampleDirection (DirectionSamplingRecord &dRec, PositionSamplingRecord &pRec, const Point2 &sample, const Point2 *extra=NULL) const
 Conditioned on the spatial component, importance sample the directional part of the emission profile. More...
 
virtual Spectrum sampleDirect (DirectSamplingRecord &dRec, const Point2 &sample) const
 Direct sampling: given a reference point in the scene, sample an emitter position that contributes towards it. More...
 
virtual Spectrum evalPosition (const PositionSamplingRecord &pRec) const
 Evaluate the spatial component of the emission profile. More...
 
virtual Spectrum evalDirection (const DirectionSamplingRecord &dRec, const PositionSamplingRecord &pRec) const
 Evaluate the directional component of the emission profile. More...
 
virtual Float pdfPosition (const PositionSamplingRecord &pRec) const
 Evaluate the spatial component of the sampling density implemented by the samplePosition() method. More...
 
virtual Float pdfDirection (const DirectionSamplingRecord &dRec, const PositionSamplingRecord &pRec) const
 Evaluate the directional component of the sampling density implemented by the sampleDirection() method. More...
 
virtual Float pdfDirect (const DirectSamplingRecord &dRec) const
 Evaluate the probability density of the direct sampling method implemented by the sampleDirect() method. More...
 
uint32_t getType () const
 Return a listing of classification flags combined using binary OR. More...
 
const AnimatedTransformgetWorldTransform () const
 Return the local space to world space transformation. More...
 
void setWorldTransform (AnimatedTransform *trafo)
 Set the local space to world space transformation. More...
 
bool needsPositionSample () const
 Does the method samplePosition() require a uniformly distributed sample for the spatial component? More...
 
bool needsDirectionSample () const
 Does the method sampleDirection() require a uniformly distributed sample for the direction component? More...
 
bool isOnSurface () const
 Does the emitter lie on some kind of surface? More...
 
bool isDegenerate () const
 Does the sensor have a degenerate directional or spatial distribution? More...
 
bool needsDirectSample () const
 Does the method sampleDirect() require a uniformly distributed sample? More...
 
EMeasure getDirectMeasure () const
 Return the measure associated with the sampleDirect() operation. More...
 
MediumgetMedium ()
 Return a pointer to the medium that surrounds the emitter. More...
 
const MediumgetMedium () const
 Return a pointer to the medium that surrounds the emitter (const version) More...
 
ShapegetShape ()
 Return the shape, to which the emitter is currently attached. More...
 
const ShapegetShape () const
 Return the shape, to which the emitter is currently attached (const version) More...
 
virtual ref< ShapecreateShape (const Scene *scene)
 Create a special shape that represents the emitter. More...
 
virtual AABB getAABB () const =0
 Return an axis-aligned box bounding the spatial extents of the emitter. More...
 
void setMedium (Medium *medium)
 Set the medium that surrounds the emitter. More...
 
virtual void addChild (const std::string &name, ConfigurableObject *child)
 Add a child ConfigurableObject. More...
 
void addChild (ConfigurableObject *child)
 Add an unnamed child. 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...
 
virtual void configure ()
 Configure the object (called once after construction and addition of all child ConfigurableObject instances)) 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...
 
virtual std::string toString () const
 Return a human-readable string representation of the object's contents. More...
 
- Public Member Functions inherited from mitsuba::HWResource
virtual ShadercreateShader (Renderer *renderer) const
 
virtual ~HWResource ()
 

Static Public Attributes

static Classm_theClass
 
- Static Public Attributes inherited from mitsuba::AbstractEmitter
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

 Emitter (const Properties &props)
 Construct a new emitter instance. More...
 
 Emitter (Stream *stream, InstanceManager *manager)
 Unserialize a emitter instance from a binary data stream. More...
 
virtual ~Emitter ()
 Virtual destructor. More...
 
- Protected Member Functions inherited from mitsuba::AbstractEmitter
 AbstractEmitter (const Properties &props)
 Construct a new emitter instance. More...
 
 AbstractEmitter (Stream *stream, InstanceManager *manager)
 Unserialize a emitter instance from a binary data stream. More...
 
virtual ~AbstractEmitter ()
 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

Float m_samplingWeight
 
- Protected Attributes inherited from mitsuba::AbstractEmitter
ref< const AnimatedTransformm_worldTransform
 
ref< Mediumm_medium
 
Shapem_shape
 
uint32_t 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 radiance emitter interface.

This class provides an abstract interface to all emitter plugins in Mitsuba. It exposes functions for evaluating and sampling the emission profile, and it allows querying the probability density of the sampling method.

Member Enumeration Documentation

This list of flags is used to additionally characterize and classify the response functions of different types of sensors.

See Also
AbstractEmitter::EEmitterType
Enumerator
EEnvironmentEmitter 

Is this an environment emitter, such as a HDRI map?

Constructor & Destructor Documentation

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

Construct a new emitter instance.

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

Unserialize a emitter instance from a binary data stream.

virtual mitsuba::Emitter::~Emitter ( )
protectedvirtual

Virtual destructor.

Member Function Documentation

virtual Spectrum mitsuba::Emitter::eval ( const Intersection its,
const Vector d 
) const
virtual

Return the radiant emittance for the given surface intersection.

This is function is used when an area light source has been hit by a ray in a path tracing-style integrator, and it subsequently needs to be queried for the emitted radiance along the negative ray direction.

It efficiently computes the product of evalPosition() and evalDirection() divided by the absolute cosine of the angle between d and its.shFrame.n.

This function is provided here as a fast convenience function for unidirectional rendering techniques. The default implementation throws an exception, which states that the method is not implemented.

Parameters
itsAn intersect record that specfies the query position
dA unit vector, which specifies the query direction
Returns
The radiant emittance
virtual Spectrum mitsuba::Emitter::evalEnvironment ( const RayDifferential ray) const
virtual

Return the radiant emittance from an environment emitter.

This is function is called by unidirectional rendering techniques (e.g. a path tracer) when no scene object has been intersected, and the scene has been determined to contain an environment emitter.

The default implementation throws an exception.

Parameters
raySpecifies the ray direction that should be queried
virtual bool mitsuba::Emitter::fillDirectSamplingRecord ( DirectSamplingRecord dRec,
const Ray ray 
) const
virtual

Fill out a data record that can be used to query the direct illumination sampling density of an environment emitter.

This is function is mainly called by unidirectional rendering techniques (e.g. a path tracer) when no scene object has been intersected, and the (hypothetical) sampling density of the environment emitter needs to be known by a multiple importance sampling technique.

The default implementation throws an exception.

Parameters
dRecThe direct illumination sampling record to be filled
raySpecifies the ray direction that should be queried
Returns
true upon success
virtual ref<Bitmap> mitsuba::Emitter::getBitmap ( const Vector2i sizeHint = Vector2i(-1,-1)) const
virtual

Return a bitmap representation of the emitter.

Some types of light sources (projection lights, environment maps) are closely tied to an underlying bitmap data structure. This function can be used to return this information for various purposes.

When the class implementing this interface is a bitmap-backed texture, this function directly returns the underlying bitmap. When it is procedural, a bitmap version must first be generated. In this case, the parameter sizeHint is used to control the target size. The default value -1, -1 allows the implementation to choose a suitable size by itself.

Remarks
The default implementation throws an exception
virtual const Class* mitsuba::Emitter::getClass ( ) const
virtual

Retrieve this object's class.

Reimplemented from mitsuba::AbstractEmitter.

virtual Emitter* mitsuba::Emitter::getElement ( size_t  index)
virtual

Return a sub-element of a compound emitter.

When expanding emitters, the scene will repeatedly call this function with increasing indices. Returning NULL indicates that no more are available.

Float mitsuba::Emitter::getSamplingWeight ( ) const
inline

Return the luminaire's sampling weight.

This is used by the luminaire importance sampling routines in Scene.

virtual bool mitsuba::Emitter::isCompound ( ) const
virtual

Is this a compound emitter consisting of several sub-objects?

bool mitsuba::Emitter::isEnvironmentEmitter ( ) const
inline

Is this an environment emitter? (e.g. an HDRI environment map?)

virtual Spectrum mitsuba::Emitter::sampleRay ( Ray ray,
const Point2 spatialSample,
const Point2 directionalSample,
Float  time 
) const
virtual

Importance sample a ray according to the emission profile.

This function combines both steps of choosing a ray origin and direction value. It does not return any auxiliary sampling information and is mainly meant to be used by unidirectional rendering techniques.

Note that this function potentially uses a different sampling strategy compared to the sequence of running sampleArea() and sampleDirection(). The reason for this is that it may be possible to switch to a better technique when sampling both position and direction at the same time.

Parameters
rayA ray data structure to be populated with a position and direction value
spatialSampleDenotes the sample that is used to choose the spatial component
directionalSampleDenotes the sample that is used to choose the directional component
timeScene time value to be associated with the sample
Returns
An importance weight associated with the sampled ray. This accounts for the difference between the emission profile and the sampling density function.
virtual void mitsuba::Emitter::serialize ( Stream stream,
InstanceManager manager 
) const
virtual

Serialize this emitter to a binary data stream.

Reimplemented from mitsuba::AbstractEmitter.

Member Data Documentation

Float mitsuba::Emitter::m_samplingWeight
protected
Class* mitsuba::Emitter::m_theClass
static

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