bugfix attempt #2 for a corner-case in heterogeneous media
parent
828d3d3af9
commit
407879c389
|
@ -395,7 +395,9 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
Float integrateDensities(Ray ray, Float length) const {
|
Float integrateDensities(Ray ray, Float length) const {
|
||||||
int nParts = std::max(1, (int) std::ceil(length/m_stepSize));
|
if (length == 0)
|
||||||
|
return 0.0f;
|
||||||
|
int nParts = (int) std::ceil(length/m_stepSize);
|
||||||
nParts += nParts % 2;
|
nParts += nParts % 2;
|
||||||
const Float stepSize = length/nParts;
|
const Float stepSize = length/nParts;
|
||||||
const Vector increment = ray.d * stepSize;
|
const Vector increment = ray.d * stepSize;
|
||||||
|
@ -421,8 +423,10 @@ public:
|
||||||
Float ¤tSigmaT,
|
Float ¤tSigmaT,
|
||||||
Spectrum ¤tAlbedo,
|
Spectrum ¤tAlbedo,
|
||||||
Float desiredTau) const {
|
Float desiredTau) const {
|
||||||
|
if (maxDist == 0)
|
||||||
|
return std::numeric_limits<Float>::infinity();
|
||||||
|
|
||||||
int nParts = std::max(1, (int) std::ceil(maxDist/m_stepSize));
|
int nParts = (int) std::ceil(maxDist/m_stepSize);
|
||||||
Float stepSize = maxDist/nParts;
|
Float stepSize = maxDist/nParts;
|
||||||
Vector fullIncrement = ray.d * stepSize,
|
Vector fullIncrement = ray.d * stepSize,
|
||||||
halfIncrement = fullIncrement * .5f;
|
halfIncrement = fullIncrement * .5f;
|
||||||
|
|
|
@ -199,7 +199,9 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
Float integrateDensities(Ray ray, Float length) const {
|
Float integrateDensities(Ray ray, Float length) const {
|
||||||
int nParts = std::max(1, (int) std::ceil(length/m_stepSize));
|
if (length == 0)
|
||||||
|
return 0.0f;
|
||||||
|
int nParts = (int) std::ceil(length/m_stepSize);
|
||||||
nParts += nParts % 2;
|
nParts += nParts % 2;
|
||||||
const Float stepSize = length/nParts;
|
const Float stepSize = length/nParts;
|
||||||
const Vector increment = ray.d * stepSize;
|
const Vector increment = ray.d * stepSize;
|
||||||
|
@ -225,7 +227,10 @@ public:
|
||||||
Float ¤tSigmaT,
|
Float ¤tSigmaT,
|
||||||
Spectrum ¤tAlbedo,
|
Spectrum ¤tAlbedo,
|
||||||
Float desiredTau) const {
|
Float desiredTau) const {
|
||||||
int nParts = std::max(1, (int) std::ceil(maxDist/m_stepSize));
|
if (maxDist == 0)
|
||||||
|
return std::numeric_limits<Float>::infinity();
|
||||||
|
|
||||||
|
int nParts = (int) std::ceil(maxDist/m_stepSize);
|
||||||
Float stepSize = maxDist/nParts;
|
Float stepSize = maxDist/nParts;
|
||||||
Vector fullIncrement = ray.d * stepSize,
|
Vector fullIncrement = ray.d * stepSize,
|
||||||
halfIncrement = fullIncrement * .5f;
|
halfIncrement = fullIncrement * .5f;
|
||||||
|
|
Loading…
Reference in New Issue