photon mapping bugfix
parent
5ab1f51959
commit
bbde81ab99
|
@ -271,7 +271,7 @@ public:
|
|||
}
|
||||
|
||||
Spectrum Li(const RayDifferential &ray, RadianceQueryRecord &rRec) const {
|
||||
Spectrum Li(0.0f), LiVol(0.0f);
|
||||
Spectrum Li(0.0f);
|
||||
Intersection &its = rRec.its;
|
||||
LuminaireSamplingRecord lRec;
|
||||
|
||||
|
@ -341,7 +341,7 @@ public:
|
|||
|
||||
if (bsdfType == BSDF::EDiffuseReflection) {
|
||||
/* Hit a diffuse material - do a direct photon map visualization. */
|
||||
if (rRec.type & RadianceQueryRecord::EIndirectSurfaceRadiance)
|
||||
if (rRec.type & RadianceQueryRecord::EIndirectSurfaceRadiance)
|
||||
Li += m_globalPhotonMap->estimateIrradianceFiltered(its.p,
|
||||
its.shFrame.n, m_globalLookupRadius, m_globalLookupSize)
|
||||
* bsdf->getDiffuseReflectance(its) * INV_PI;
|
||||
|
@ -393,7 +393,7 @@ public:
|
|||
m_globalLookupRadius, m_globalLookupSize);
|
||||
}
|
||||
|
||||
return Li * LiVol;
|
||||
return Li;
|
||||
}
|
||||
|
||||
std::string toString() const {
|
||||
|
|
|
@ -195,16 +195,15 @@ void GatherPhotonProcess::processResult(const WorkResult *wr, bool cancelled) {
|
|||
size_t start = vec.getParticleIndex(i),
|
||||
end = vec.getParticleIndex(i+1);
|
||||
++nParticles;
|
||||
bool stop = false;
|
||||
bool full = false;
|
||||
for (size_t j=start; j<end; ++j) {
|
||||
if (!m_photonMap->storePhoton(vec[j])) {
|
||||
cout << "Photon map is full, skipping " << vec.getPhotonCount() -j << " photons" << endl;
|
||||
m_excess += vec.getPhotonCount() - j;
|
||||
stop = true;
|
||||
full = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (stop)
|
||||
if (full)
|
||||
break;
|
||||
}
|
||||
m_numShot += nParticles;
|
||||
|
|
Loading…
Reference in New Issue