From 1c8f3f0745690733fd6cce399f4324110577a880 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Wed, 8 Sep 2010 02:17:46 +0200 Subject: [PATCH] fixed coherent ray tracer intensities for point sources --- src/librender/preview.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/librender/preview.cpp b/src/librender/preview.cpp index 5a20a046..2abf9d71 100644 --- a/src/librender/preview.cpp +++ b/src/librender/preview.cpp @@ -299,7 +299,7 @@ void PreviewWorker::processCoherent(const WorkUnit *workUnit, WorkResult *workRe its.shFrame.n = normalize(v0.n * alpha + v1.n * beta + v2.n * gamma); its.uv = v0.uv * alpha + v1.uv * beta + v2.uv * gamma; - if (EXPECT_NOT_TAKEN(bsdf->getType() != BSDF::EDiffuseReflection) || !diffuseVPL) { + if (EXPECT_NOT_TAKEN(bsdf->getType() != BSDF::EDiffuseReflection || !diffuseVPL)) { its.dpdu = v0.dpdu * alpha + v1.dpdu * beta + v2.dpdu * gamma; its.dpdv = v0.dpdv * alpha + v1.dpdv * beta + v2.dpdv * gamma; } @@ -321,11 +321,11 @@ void PreviewWorker::processCoherent(const WorkUnit *workUnit, WorkResult *workRe emitted[idx] = shape->getLuminaire()->Le(lRec); } - if (EXPECT_TAKEN(bsdf->getType() == BSDF::EDiffuseReflection) && diffuseVPL) { + if (EXPECT_TAKEN(bsdf->getType() == BSDF::EDiffuseReflection && diffuseVPL)) { /* Fast path */ direct[idx] = (bsdf->getDiffuseReflectance(its) * vplWeight) * (std::max((Float) 0.0f, dot(wo, its.shFrame.n)) - * (vplOnSurface ? std::max(cosThetaLight.f[idx], (Float) 0.0f) * INV_PI : 1.0f) + * (vplOnSurface ? (std::max(cosThetaLight.f[idx], (Float) 0.0f) * INV_PI) : INV_PI) * invLengthSquared.f[idx]); } else { wi.x = -primRay4.d[0].f[idx];