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

Abstract base class, which describes integrators capable of computing samples of the scene's radiance function. More...

#include <mitsuba/render/integrator.h>

+ Inheritance diagram for mitsuba::SamplingIntegrator:

Public Member Functions

virtual Spectrum Li (const RayDifferential &ray, RadianceQueryRecord &rRec) const =0
 Sample the incident radiance along a ray. Also requires a radiance query record, which makes this request more precise. More...
 
virtual Spectrum E (const Scene *scene, const Intersection &its, const Medium *medium, Sampler *sampler, int nSamples, bool includeIndirect) const
 Estimate the irradiance at a given surface point. More...
 
bool render (Scene *scene, RenderQueue *queue, const RenderJob *job, int sceneResID, int sensorResID, int samplerResID)
 Perform the main rendering task. More...
 
void cancel ()
 
virtual void renderBlock (const Scene *scene, const Sensor *sensor, Sampler *sampler, ImageBlock *block, const bool &stop, const std::vector< TPoint2< uint8_t > > &points) const
 
virtual void bindUsedResources (ParallelProcess *proc) const
 
virtual void wakeup (ConfigurableObject *parent, std::map< std::string, SerializableObject * > &params)
 
void serialize (Stream *stream, InstanceManager *manager) const
 Serialize this integrator to a binary data stream. More...
 
virtual const ClassgetClass () const
 Retrieve this object's class. More...
 
- Public Member Functions inherited from mitsuba::Integrator
virtual bool preprocess (const Scene *scene, RenderQueue *queue, const RenderJob *job, int sceneResID, int sensorResID, int samplerResID)
 Possibly perform a pre-process task. More...
 
virtual void postprocess (const Scene *scene, RenderQueue *queue, const RenderJob *job, int sceneResID, int sensorResID, int samplerResID)
 Possibly perform a post-process task. More...
 
virtual void configureSampler (const Scene *scene, Sampler *sampler)
 Configure the sample generator for use with this integrator. More...
 
virtual const IntegratorgetSubIntegrator (int index) const
 Return the nested integrator (if any) 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 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...
 

Static Public Attributes

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

 SamplingIntegrator (const Properties &props)
 Create a integrator. More...
 
 SamplingIntegrator (Stream *stream, InstanceManager *manager)
 Unserialize an integrator. More...
 
virtual ~SamplingIntegrator ()
 Virtual destructor. More...
 
- Protected Member Functions inherited from mitsuba::Integrator
 Integrator (const Properties &props)
 Create a integrator. More...
 
 Integrator (Stream *stream, InstanceManager *manager)
 Unserialize an integrator. More...
 
virtual ~Integrator ()
 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< ParallelProcessm_process
 Used to temporarily cache a parallel process while it is in operation. More...
 
- 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 base class, which describes integrators capable of computing samples of the scene's radiance function.

Constructor & Destructor Documentation

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

Create a integrator.

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

Unserialize an integrator.

virtual mitsuba::SamplingIntegrator::~SamplingIntegrator ( )
inlineprotectedvirtual

Virtual destructor.

Member Function Documentation

virtual void mitsuba::SamplingIntegrator::bindUsedResources ( ParallelProcess proc) const
virtual

NetworkedObject implementation: When a parallel rendering process starts, the integrator is given the opportunity to attach globally shared resources to the process. This is useful for distributing heavy data structures (e.g. photon maps) without having to re-transmit them every time an image is rendered.

Reimplemented from mitsuba::NetworkedObject.

void mitsuba::SamplingIntegrator::cancel ( )
virtual

This can be called asynchronously to cancel a running render job. In this case, render() will quit with a return value of false.

Implements mitsuba::Integrator.

virtual Spectrum mitsuba::SamplingIntegrator::E ( const Scene scene,
const Intersection its,
const Medium medium,
Sampler sampler,
int  nSamples,
bool  includeIndirect 
) const
virtual

Estimate the irradiance at a given surface point.

The default implementation simply samples the hemisphere using cosine-weighted sampling and a configurable number of rays. An integrator such as irradiance caching will provide something smarter.

Parameters
sceneConst pointer to the underlying scene
itsDescribes the surface location where the irradiance is to be computed
mediumConst pointer to the medium that encloses the ray (its.p, its.shFrame.n). A value of NULL corresponds to vacuum.
samplerA pointer to a sample generator
nSamplesHow many samples should be taken
includeIndirectInclude indirect illumination in the estimate?
virtual const Class* mitsuba::SamplingIntegrator::getClass ( ) const
virtual

Retrieve this object's class.

Reimplemented from mitsuba::Integrator.

Reimplemented in mitsuba::MonteCarloIntegrator.

virtual Spectrum mitsuba::SamplingIntegrator::Li ( const RayDifferential ray,
RadianceQueryRecord rRec 
) const
pure virtual

Sample the incident radiance along a ray. Also requires a radiance query record, which makes this request more precise.

bool mitsuba::SamplingIntegrator::render ( Scene scene,
RenderQueue queue,
const RenderJob job,
int  sceneResID,
int  sensorResID,
int  samplerResID 
)
virtual

Perform the main rendering task.

The work is automatically parallelized to multiple cores and remote machines. The default implementation uniformly generates samples on the sensor aperture and image plane as specified by the used sampler. The average of the estimated radiance along the associated rays in a pixel region is then taken as an approximation of that pixel's radiance value. For adaptive strategies, have a look at the adaptive plugin, which is an extension of this class.

Implements mitsuba::Integrator.

virtual void mitsuba::SamplingIntegrator::renderBlock ( const Scene scene,
const Sensor sensor,
Sampler sampler,
ImageBlock block,
const bool stop,
const std::vector< TPoint2< uint8_t > > &  points 
) const
virtual

This method does the main work of render() and runs in parallel for a series of image blocks, which are being processed at a time.

Parameters
scenePointer to the underlying scene
sensorPointer to the sensor used to render the image
samplerPointer to the sampler used to render the image
blockPointer to the image block to be filled
pointsSpecifies the traversal order, i.e. using a space-filling curve. To limit the size of the array, it is currently assumed that the block size is smaller than 256x256
stopReference to a boolean, which will be set to true when the user has requested that the program be stopped
void mitsuba::SamplingIntegrator::serialize ( Stream stream,
InstanceManager manager 
) const
virtual

Serialize this integrator to a binary data stream.

Reimplemented from mitsuba::Integrator.

Reimplemented in mitsuba::MonteCarloIntegrator.

virtual void mitsuba::SamplingIntegrator::wakeup ( ConfigurableObject parent,
std::map< std::string, SerializableObject * > &  params 
)
virtual

NetworkedObject implementation: Called once just before this integrator instance is asked to process an image block. In comparison to preprocess() this will be executed on every instance of this class, which is useful for connecting to globally shared resources (photon maps, irradiance caches, ..) after having been unserialized on a remote machine. A list of resources bound to the associated parallel process is given as a parameter.

Reimplemented from mitsuba::NetworkedObject.

Member Data Documentation

ref<ParallelProcess> mitsuba::SamplingIntegrator::m_process
protected

Used to temporarily cache a parallel process while it is in operation.

Class* mitsuba::SamplingIntegrator::m_theClass
static

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