Abstract particle tracer implementation. More...
#include <mitsuba/render/particleproc.h>
Public Member Functions | |
virtual void | handleEmission (const PositionSamplingRecord &pRec, const Medium *medium, const Spectrum &weight) |
Handle a particle emission event. More... | |
virtual void | handleNewParticle () |
Handle a 'new particle generated' event. More... | |
virtual void | handleSurfaceInteraction (int depth, int nullInteractions, bool delta, const Intersection &its, const Medium *medium, const Spectrum &weight) |
Handle a surface interaction event. More... | |
virtual void | handleMediumInteraction (int depth, int nullInteractions, bool delta, const MediumSamplingRecord &mRec, const Medium *medium, const Vector &wi, const Spectrum &weight) |
Handle a medium interaction event. More... | |
virtual const Class * | getClass () const |
Retrieve this object's class. More... | |
Implementation of the WorkProcessor interface | |
virtual ref< WorkUnit > | createWorkUnit () const |
Create a work unit of the proper type and size. More... | |
virtual void | prepare () |
Called once before processing starts. More... | |
virtual void | process (const WorkUnit *workUnit, WorkResult *workResult, const bool &stop) |
Process a work unit and store the computed results. More... | |
void | serialize (Stream *stream, InstanceManager *manager) const |
Serialize this object to a stream. More... | |
Public Member Functions inherited from mitsuba::WorkProcessor | |
virtual ref< WorkResult > | createWorkResult () const =0 |
Create a work result of the proper type and size. More... | |
virtual ref< WorkProcessor > | clone () const =0 |
Create a copy of this work processor 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... | |
Static Public Attributes | |
static Class * | m_theClass |
Static Public Attributes inherited from mitsuba::WorkProcessor | |
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 | |
ParticleTracer (int maxDepth, int rrDepth, bool emissionEvents) | |
Protected constructor. More... | |
ParticleTracer (Stream *stream, InstanceManager *manager) | |
Protected constructor. More... | |
virtual | ~ParticleTracer () |
Virtual destructor. More... | |
Protected Member Functions inherited from mitsuba::WorkProcessor | |
virtual | ~WorkProcessor () |
Virtual destructor. More... | |
WorkProcessor () | |
Protected constructors. More... | |
WorkProcessor (Stream *stream, InstanceManager *manager) | |
SerializableObject * | getResource (const std::string &name) |
Look up a named resource, which has been bound to the associated parallel process. 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< Scene > | m_scene |
ref< Sampler > | m_sampler |
int | m_maxDepth |
int | m_rrDepth |
bool | m_emissionEvents |
Protected Attributes inherited from mitsuba::WorkProcessor | |
std::map< std::string, SerializableObject * > | m_resources |
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 particle tracer implementation.
Traces particles and performs a customizable action every time a surface or volume interaction occurs.
|
protected |
Protected constructor.
|
protected |
Protected constructor.
|
inlineprotectedvirtual |
Virtual destructor.
Create a work unit of the proper type and size.
Implements mitsuba::WorkProcessor.
|
virtual |
Retrieve this object's class.
Reimplemented from mitsuba::WorkProcessor.
|
virtual |
Handle a particle emission event.
To be overridden in a subclass. The default implementation does nothing
pRec | Position sampling record associated with the emission event |
medium | Pointer to the current medium |
weight | Initial weight/power of the particle |
|
virtual |
Handle a medium interaction event.
To be overridden in a subclass. The default implementation does nothing
depth | Depth of the interaction in path space (with 1 corresponding to the first bounce) |
nullInteractions | Specifies how many of these interactions were of type BSDF::ENull (i.e. index-matched medium transitions) |
delta | Denotes if the previous scattering event was a degenerate specular reflection or refraction. |
mRec | Associated medium sampling record |
medium | Pointer to the current medium |
weight | Weight/power of the particle after having gone through all preceding interactions except for the current medium interaction. |
|
virtual |
Handle a 'new particle generated' event.
To be overridden in a subclass. The default implementation does nothing.
Note that this event will only be delivered if emissionEvents=false
. In that case, it is a substitute to let the subclass know that a new particle was created, but without providing detailed information about the emission.
|
virtual |
Handle a surface interaction event.
To be overridden in a subclass. The default implementation does nothing
depth | Depth of the interaction in path space (with 1 corresponding to the first bounce) |
nullInteractions | Specifies how many of these interactions were of type BSDF::ENull (i.e. index-matched medium transitions) |
delta | Denotes if the previous scattering event was a degenerate specular reflection or refraction. |
its | Associated intersection record |
medium | Pointer to the current medium before the surface interaction |
weight | Weight/power of the particle after having gone through all preceding interactions except for the current surface interaction. |
|
virtual |
Called once before processing starts.
This is useful for allocating scratch space or resolving references to resource objects. Lengthy computations should be performed in process() instead of here, since this this method will be called while the central scheduler lock is held. A thrown exception will lead to the termination of the parallel process.
Implements mitsuba::WorkProcessor.
|
virtual |
Process a work unit and store the computed results.
The active
parameter can be used to signal a premature stop of the execution flow. In this case, the work result is allowed to be undefined (it will simply be ignored). A thrown exception will lead to the termination of the parallel process.
Implements mitsuba::WorkProcessor.
|
virtual |
Serialize this object to a stream.
Implements mitsuba::SerializableObject.
|
protected |
|
protected |
|
protected |
|
static |