Abstract radiance emitter interface. More...
#include <mitsuba/render/emitter.h>
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 Class * | getClass () 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< Bitmap > | getBitmap (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 Emitter * | getElement (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 AnimatedTransform * | getWorldTransform () 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... | |
Medium * | getMedium () |
Return a pointer to the medium that surrounds the emitter. More... | |
const Medium * | getMedium () const |
Return a pointer to the medium that surrounds the emitter (const version) More... | |
Shape * | getShape () |
Return the shape, to which the emitter is currently attached. More... | |
const Shape * | getShape () const |
Return the shape, to which the emitter is currently attached (const version) More... | |
virtual ref< Shape > | createShape (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 Properties & | getProperties () 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 Shader * | createShader (Renderer *renderer) const |
virtual | ~HWResource () |
Static Public Attributes | |
static Class * | m_theClass |
Static Public Attributes inherited from mitsuba::AbstractEmitter | |
static Class * | m_theClass |
Static Public Attributes inherited from mitsuba::ConfigurableObject | |
static Class * | m_theClass |
Static Public Attributes inherited from mitsuba::SerializableObject | |
static Class * | m_theClass |
Static Public Attributes inherited from Object | |
static Class * | m_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 AnimatedTransform > | m_worldTransform |
ref< Medium > | m_medium |
Shape * | m_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... | |
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.
This list of flags is used to additionally characterize and classify the response functions of different types of sensors.
Enumerator | |
---|---|
EEnvironmentEmitter |
Is this an environment emitter, such as a HDRI map? |
|
protected |
Construct a new emitter instance.
|
protected |
Unserialize a emitter instance from a binary data stream.
|
protectedvirtual |
Virtual destructor.
|
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.
its | An intersect record that specfies the query position |
d | A unit vector, which specifies the query direction |
|
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.
ray | Specifies the ray direction that should be queried |
|
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.
dRec | The direct illumination sampling record to be filled |
ray | Specifies the ray direction that should be queried |
true
upon success
|
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.
|
virtual |
Retrieve this object's class.
Reimplemented from mitsuba::AbstractEmitter.
|
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.
|
inline |
Return the luminaire's sampling weight.
This is used by the luminaire importance sampling routines in Scene.
|
virtual |
Is this a compound emitter consisting of several sub-objects?
|
inline |
Is this an environment emitter? (e.g. an HDRI environment map?)
|
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.
ray | A ray data structure to be populated with a position and direction value |
spatialSample | Denotes the sample that is used to choose the spatial component |
directionalSample | Denotes the sample that is used to choose the directional component |
time | Scene time value to be associated with the sample |
|
virtual |
Serialize this emitter to a binary data stream.
Reimplemented from mitsuba::AbstractEmitter.
|
protected |
|
static |