20 #if !defined(__MITSUBA_RENDER_IRRCACHE_H_)
21 #define __MITSUBA_RENDER_IRRCACHE_H_
68 return m_entries[j*m_N + k];
73 return m_entries[j*m_N + k];
104 return m_hMinRestricted;
119 Vector *m_uk, *m_vk, *m_vkMinus;
123 Float m_hMean, m_hMin, m_hMinRestricted;
206 const HemisphereSampler &hs);
216 void insert(Record *rec);
255 : p(rec->p), n(rec->n), R0(rec->R0), originalR0(rec->originalR0),
256 R0_min(rec->R0_min), R0_max(rec->R0_max), E(rec->E) {
257 for (
int i=0; i<3; ++i) {
258 tGrad[i] = rec->
tGrad[i];
259 rGrad[i] = rec->
rGrad[i];
272 for (
int i=0; i<3; ++i)
274 for (
int i=0; i<3; ++i)
287 for (
int i=0; i<3; ++i)
288 rGrad[i].serialize(stream);
289 for (
int i=0; i<3; ++i)
290 tGrad[i].serialize(stream);
307 if (
dot(p2 - p, n + n2) < -0.05f)
311 Float ePI = (p-p2).length() / (.5f * R0);
312 Float eNI = std::sqrt(1.0f - std::abs(dp))
314 Float weight = 1 - kappa*std::max(ePI, eNI);
337 bool m_clampScreen, m_clampNeighbor, m_useGradients;
Float getMinimumDistance() const
Return the minimum distance over all cells.
Definition: irrcache.h:98
Generic multiple-reference octree with support for parallel dynamic updates.
Definition: octree.h:253
Spectrum TranslationalGradient[3]
Definition: irrcache.h:30
Three-dimensional normal data structure.
Definition: normal.h:39
Random number generator based on SIMD-oriented Fast Mersenne Twister
Definition: random.h:88
Vector d
Definition: irrcache.h:47
const Spectrum & getIrradiance() const
Return the computed irradiance.
Definition: irrcache.h:108
Record(const Record *rec)
Copy constructor.
Definition: irrcache.h:254
Spectrum L
Definition: irrcache.h:48
const RotationalGradient & getTranslationalGradient() const
Return the irradiance gradient with respect to translation.
Definition: irrcache.h:88
Float getWeight(const Point &p2, const Normal &n2, Float kappa) const
Definition: irrcache.h:297
Float sinTheta
Definition: irrcache.h:51
Base class of all reference-counted objects with serialization support.
Definition: serialization.h:35
TranslationalGradient tGrad
Definition: irrcache.h:248
Point p
Definition: irrcache.h:232
Float dist
Definition: irrcache.h:49
Record()
Dummy constructor.
Definition: irrcache.h:251
uint32_t getM() const
Return the elevational resolution.
Definition: irrcache.h:61
Float readFloat()
Write a floating point number (configured precision) to the stream.
Definition: stream.h:424
Float R0_min
Definition: irrcache.h:242
void setQuality(Float quality)
Definition: irrcache.h:171
Ray differential – enhances the basic ray class with information about the rays of adjacent pixels on...
Definition: ray.h:140
TPoint3< Float > Point
Definition: fwd.h:136
Axis-aligned bounding box data structure in three dimensions.
Definition: aabb.h:437
Spectrum E
Definition: irrcache.h:244
uint32_t getN() const
Return the azimuthal resolution.
Definition: irrcache.h:64
void serialize(Stream *stream) const
Serialize to a binary data stream.
Definition: irrcache.h:279
void clampNeighbor(bool active)
Definition: irrcache.h:187
void useGradients(bool active)
Definition: irrcache.h:192
Float getMinimumDistanceRestricted() const
Return the minimum distance over all cells (>10 deg in elevation)
Definition: irrcache.h:103
Definition: irrcache.h:230
RotationalGradient rGrad
Definition: irrcache.h:246
void writeFloat(Float value)
Write a floating point number (configured precision) to the stream.
Definition: stream.h:271
Record(Stream *stream)
Unserialize from a binary data stream.
Definition: irrcache.h:264
void clampScreen(bool active)
Definition: irrcache.h:182
Abstract seekable stream class.
Definition: stream.h:58
#define MTS_DECLARE_CLASS()
This macro must be used in the initial definition in classes that derive from Object.
Definition: class.h:158
Definition: irrcache.h:46
Normal n
Definition: irrcache.h:234
Reference counting helper.
Definition: ref.h:40
Float originalR0
Definition: irrcache.h:239
Spectrum RotationalGradient[3]
Definition: irrcache.h:29
Float cosTheta
Definition: irrcache.h:50
Utility data structure for hemispherical sampling and translational/rotational gradient computation...
Definition: irrcache.h:44
const RotationalGradient & getRotationalGradient() const
Return the irradiance gradient with respect to rotation.
Definition: irrcache.h:83
Container for all information related to a surface intersection.
Definition: shape.h:36
Parent of all Mitsuba classes.
Definition: object.h:38
Coordinates the serialization and unserialization of object graphs.
Definition: serialization.h:65
Discrete spectral power distribution based on a number of wavelength bins over the 360-830 nm range...
Definition: spectrum.h:663
T dot(const TQuaternion< T > &q1, const TQuaternion< T > &q2)
Definition: quat.h:348
virtual std::string toString() const
Return a human-readable string representation of the object's contents.
Thin wrapper around the recursive boost thread lock.
Definition: lock.h:34
Float getHarmonicMeanDistance() const
Return the average distance over all cells (harmonic mean)
Definition: irrcache.h:93
Irradiance cache data structure based on "A Ray Tracing Solution for Diffuse Interreflection" by Greg...
Definition: irrcache.h:148
Float R0
Definition: irrcache.h:236