Specialized sampler implementation used to seed MLT-style algorithm. More...
#include <mitsuba/bidir/rsampler.h>
Public Member Functions | |
ReplayableSampler () | |
Construct a new sampler. More... | |
ReplayableSampler (Stream *stream, InstanceManager *manager) | |
Unserialize a sampler. More... | |
virtual ref< Sampler > | clone () |
virtual void | advance () |
Advance to the next sample. More... | |
virtual void | generate (const Point2i &pos) |
Generate new samples. More... | |
virtual void | setSampleIndex (size_t sampleIndex) |
Manually set the current sample index. More... | |
virtual Float | next1D () |
Retrieve the next component value from the current sample. More... | |
virtual Point2 | next2D () |
Retrieve the next two component values from the current sample. More... | |
virtual void | request2DArray (size_t size) |
Request that a 2D array will be made available for later consumption by next2DArray(). More... | |
virtual void | request1DArray (size_t size) |
Same as request2DArray(), but in 1D. More... | |
virtual void | serialize (Stream *stream, InstanceManager *manager) const |
Serialize this sampler to disk. More... | |
virtual std::string | toString () const |
Return a string description. More... | |
Random * | getRandom () |
Return the underlying random number generator. More... | |
void | updateSampleIndex (size_t index) |
virtual const Class * | getClass () const |
Retrieve this object's class. More... | |
![]() | |
virtual void | setFilmResolution (const Vector2i &res, bool blocked) |
Set the film size in pixels. More... | |
Point2 * | next2DArray (size_t size) |
Retrieve the next 2D array of values from the current sample. More... | |
Float * | next1DArray (size_t size) |
Same as above, but 1D. More... | |
size_t | getSampleCount () const |
Return total number of samples. More... | |
size_t | getSampleIndex () const |
Return the current sample index. More... | |
![]() | |
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 Properties & | getProperties () const |
Return the properties object that was originally used to create this instance. More... | |
![]() | |
SerializableObject (Stream *stream, InstanceManager *manager) | |
Unserialize a serializable object. More... | |
![]() | |
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 Class * | m_theClass |
![]() | |
static Class * | m_theClass |
![]() | |
static Class * | m_theClass |
![]() | |
static Class * | m_theClass |
![]() | |
static Class * | m_theClass |
Pointer to the object's class descriptor. More... | |
Protected Member Functions | |
virtual | ~ReplayableSampler () |
Virtual destructor. More... | |
![]() | |
Sampler (const Properties &props) | |
Construct a new sampler. More... | |
Sampler (Stream *stream, InstanceManager *manager) | |
Unserialize a sampler. More... | |
virtual | ~Sampler () |
Virtual destructor. More... | |
![]() | |
virtual | ~ConfigurableObject () |
Virtual destructor. More... | |
ConfigurableObject (const Properties &props) | |
Construct a configurable object. More... | |
ConfigurableObject (Stream *stream, InstanceManager *manager) | |
Unserialize a configurable object. More... | |
![]() | |
SerializableObject () | |
Construct a serializable object. More... | |
virtual | ~SerializableObject () |
Virtual deconstructor. More... | |
![]() | |
virtual | ~Object () |
Virtual private deconstructor. (Will only be called by ref) More... | |
Protected Attributes | |
ref< Random > | m_initial |
ref< Random > | m_random |
![]() | |
size_t | m_sampleCount |
size_t | m_sampleIndex |
std::vector< size_t > | m_req1D |
std::vector< size_t > | m_req2D |
std::vector< Float * > | m_sampleArrays1D |
std::vector< Point2 * > | m_sampleArrays2D |
size_t | m_dimension1DArray |
size_t | m_dimension2DArray |
![]() | |
Properties | m_properties |
Additional Inherited Members | |
![]() | |
static void | staticInitialization () |
Initializes the built-in reference count debugger (if enabled) More... | |
static void | staticShutdown () |
Free the memory taken by staticInitialization() More... | |
Specialized sampler implementation used to seed MLT-style algorithm.
Allows to query for the current sample index, which can later be used to rewind back to this state. In the case of MLT, this makes it possible to sample paths approximately proportional to their contribution without actually having to store millions of path. Note that `rewinding' is naive – it just resets & regenerates the whole random number sequence, which might be slow.
mitsuba::ReplayableSampler::ReplayableSampler | ( | ) |
Construct a new sampler.
mitsuba::ReplayableSampler::ReplayableSampler | ( | Stream * | stream, |
InstanceManager * | manager | ||
) |
Unserialize a sampler.
|
protectedvirtual |
Virtual destructor.
|
virtual |
Advance to the next sample.
Reimplemented from mitsuba::Sampler.
Create a clone of this sampler. The clone is allowed to be different to some extent, e.g. a pseudorandom generator should be based on a different random seed compared to the original. All other parameters, are copied exactly.
Reimplemented from mitsuba::Sampler.
|
virtual |
Generate new samples.
This function is called initially and every time the generated samples have been exhausted. When used in conjunction with a SamplingIntegrator, this will be called before starting to render each pixel, and the argument denotes the pixel position. Otherwise, some dummy value should be provided, e.g. Point2i(-1)
Reimplemented from mitsuba::Sampler.
|
virtual |
Retrieve this object's class.
Reimplemented from mitsuba::Sampler.
|
inline |
Return the underlying random number generator.
|
virtual |
Retrieve the next component value from the current sample.
Implements mitsuba::Sampler.
|
virtual |
Retrieve the next two component values from the current sample.
Implements mitsuba::Sampler.
|
virtual |
Same as request2DArray(), but in 1D.
Reimplemented from mitsuba::Sampler.
|
virtual |
Request that a 2D array will be made available for later consumption by next2DArray().
This function must be called before generate(). See next2DArray() for a more detailed description of this feature.
Reimplemented from mitsuba::Sampler.
|
virtual |
Serialize this sampler to disk.
Reimplemented from mitsuba::Sampler.
|
virtual |
Manually set the current sample index.
Reimplemented from mitsuba::Sampler.
|
virtual |
Return a string description.
Reimplemented from Object.
|
inline |
Update the current sample index, but without changing the RNG state. This is useful if the underlying random number generator has been used outside of this class
|
static |