edge.cpp: Don't allow creating edges with length=0
parent
a961b49ca7
commit
c8d22d3a9d
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue