edge.cpp: Don't allow creating edges with length=0

metadata
Wenzel Jakob 2013-08-28 17:07:09 +02:00
parent a961b49ca7
commit c8d22d3a9d
1 changed files with 6 additions and 0 deletions

View File

@ -48,6 +48,9 @@ bool PathEdge::sampleNext(const Scene *scene, Sampler *sampler,
return false;
}
if (length == 0)
return false;
if (!medium) {
weight[ERadiance] = weight[EImportance] = Spectrum(1.0f);
pdf[ERadiance] = pdf[EImportance] = 1.0f;
@ -103,6 +106,9 @@ bool PathEdge::perturbDirection(const Scene *scene,
}
d = ray.d;
if (length == 0)
return false;
if (!medium) {
weight[ERadiance] = weight[EImportance] = Spectrum(1.0f);
pdf[ERadiance] = pdf[EImportance] = 1.0f;