more serialization fixes
parent
eabc3f17bc
commit
b8d4aeb524
|
@ -231,7 +231,7 @@ protected:
|
|||
return result;
|
||||
}
|
||||
|
||||
inline StaticOctree() { }
|
||||
inline StaticOctree() : m_root(NULL) { }
|
||||
protected:
|
||||
AABB m_aabb;
|
||||
std::vector<Item> m_items;
|
||||
|
|
|
@ -437,7 +437,7 @@ public:
|
|||
|
||||
std::vector<IrradianceSample> &samples = proc->getIrradianceSampleVector()->get();
|
||||
sa /= samples.size();
|
||||
|
||||
|
||||
for (size_t i=0; i<samples.size(); ++i)
|
||||
samples[i].area = sa;
|
||||
|
||||
|
|
|
@ -114,6 +114,7 @@ public:
|
|||
inline IrradianceSample(Stream *stream) {
|
||||
p = Point(stream);
|
||||
E = Spectrum(stream);
|
||||
area = stream->readFloat();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -127,6 +128,7 @@ public:
|
|||
inline void serialize(Stream *stream) const {
|
||||
p.serialize(stream);
|
||||
E.serialize(stream);
|
||||
stream->writeFloat(area);
|
||||
}
|
||||
|
||||
/// Return the position (used by the octree code)
|
||||
|
|
|
@ -35,6 +35,8 @@ IrradianceOctree::IrradianceOctree(const AABB &bounds, Float solidAngleThreshold
|
|||
|
||||
IrradianceOctree::IrradianceOctree(Stream *stream, InstanceManager *manager) {
|
||||
m_aabb = AABB(stream);
|
||||
m_maxDepth = stream->readUInt();
|
||||
m_maxItems = stream->readUInt();
|
||||
m_solidAngleThreshold = stream->readFloat();
|
||||
|
||||
size_t items = stream->readSize();
|
||||
|
@ -49,6 +51,8 @@ IrradianceOctree::IrradianceOctree(Stream *stream, InstanceManager *manager) {
|
|||
|
||||
void IrradianceOctree::serialize(Stream *stream, InstanceManager *manager) const {
|
||||
m_aabb.serialize(stream);
|
||||
stream->writeUInt(m_maxDepth);
|
||||
stream->writeUInt(m_maxItems);
|
||||
stream->writeFloat(m_solidAngleThreshold);
|
||||
|
||||
stream->writeSize(m_items.size());
|
||||
|
@ -98,5 +102,5 @@ void IrradianceOctree::propagate(OctreeNode *node) {
|
|||
++statsNumNodes;
|
||||
}
|
||||
|
||||
|
||||
MTS_IMPLEMENT_CLASS_S(IrradianceOctree, false, SerializableObject)
|
||||
MTS_NAMESPACE_END
|
||||
|
|
|
@ -42,6 +42,7 @@ public:
|
|||
performQuery(m_aabb, m_root, query);
|
||||
}
|
||||
|
||||
MTS_DECLARE_CLASS()
|
||||
protected:
|
||||
/// Propagate irradiance approximations througout the tree
|
||||
void propagate(OctreeNode *node);
|
||||
|
|
Loading…
Reference in New Issue