minor robustness improvements
parent
6aa7534d67
commit
e1ff84e0a9
|
@ -669,6 +669,8 @@ Float ManifoldPerturbation::Q(const Path &source, const Path &proposal,
|
||||||
source.vertex(a)->pdf[mode] * m_probFactor * m_probFactor);
|
source.vertex(a)->pdf[mode] * m_probFactor * m_probFactor);
|
||||||
|
|
||||||
Float pdf = source.vertex(a+step)->perturbPositionPdf(proposal.vertex(a+step), stddev);
|
Float pdf = source.vertex(a+step)->perturbPositionPdf(proposal.vertex(a+step), stddev);
|
||||||
|
if (pdf == 0)
|
||||||
|
return 0.0f;
|
||||||
|
|
||||||
weight /= pdf;
|
weight /= pdf;
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,6 +128,11 @@ bool ShapeKDTree::rayIntersect(const Ray &ray, Intersection &its) const {
|
||||||
if (EXPECT_TAKEN(maxt > mint)) {
|
if (EXPECT_TAKEN(maxt > mint)) {
|
||||||
if (rayIntersectHavran<false>(ray, mint, maxt, its.t, temp)) {
|
if (rayIntersectHavran<false>(ray, mint, maxt, its.t, temp)) {
|
||||||
fillIntersectionRecord<true>(ray, temp, its);
|
fillIntersectionRecord<true>(ray, temp, its);
|
||||||
|
if (std::isnan(its.t)) {
|
||||||
|
cout << ray.toString() << endl;
|
||||||
|
cout << its.toString() << endl;
|
||||||
|
Log(EError, "Whaat?!");
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -141,9 +141,7 @@ public:
|
||||||
|
|
||||||
Point local = ray(hit);
|
Point local = ray(hit);
|
||||||
|
|
||||||
if (local.x * local.x + local.y * local.y > 1)
|
if (local.x * local.x + local.y * local.y <= 1) {
|
||||||
return false;
|
|
||||||
|
|
||||||
t = hit;
|
t = hit;
|
||||||
|
|
||||||
if (temp) {
|
if (temp) {
|
||||||
|
@ -153,6 +151,9 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool rayIntersect(const Ray &ray, Float mint, Float maxt) const {
|
bool rayIntersect(const Ray &ray, Float mint, Float maxt) const {
|
||||||
|
|
|
@ -132,9 +132,7 @@ public:
|
||||||
|
|
||||||
Point local = ray(hit);
|
Point local = ray(hit);
|
||||||
|
|
||||||
if (std::abs(local.x) > 1 || std::abs(local.y) > 1)
|
if (std::abs(local.x) <= 1 && std::abs(local.y) <= 1) {
|
||||||
return false;
|
|
||||||
|
|
||||||
t = hit;
|
t = hit;
|
||||||
|
|
||||||
if (temp) {
|
if (temp) {
|
||||||
|
@ -146,6 +144,9 @@ public:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool rayIntersect(const Ray &ray, Float mint, Float maxt) const {
|
bool rayIntersect(const Ray &ray, Float mint, Float maxt) const {
|
||||||
Float t;
|
Float t;
|
||||||
return Rectangle::rayIntersect(ray, mint, maxt, t, NULL);
|
return Rectangle::rayIntersect(ray, mint, maxt, t, NULL);
|
||||||
|
|
Loading…
Reference in New Issue