From 4a86baac4ece5509080ac19f4f8cbd991eaa3197 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Mon, 22 Oct 2012 22:02:35 -0400 Subject: [PATCH] fixed manifold exploration for point light sources and cylinders (cardioid test scene works again..) --- src/libbidir/manifold.cpp | 2 +- src/shapes/cylinder.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libbidir/manifold.cpp b/src/libbidir/manifold.cpp index c5690da0..8bb74319 100644 --- a/src/libbidir/manifold.cpp +++ b/src/libbidir/manifold.cpp @@ -915,7 +915,7 @@ Float SpecularManifold::G(const Path &path, int a, int b) { SimpleVertex &last = m_vertices[m_vertices.size()-1]; const PathVertex *vb = path.vertex(b); - if (vb->isMediumInteraction()) { + if (!vb->isOnSurface()) { last.n = Vector(path.edge(a < b ? (b-1) : b)->d); } else { last.n = vb->getShadingNormal(); diff --git a/src/shapes/cylinder.cpp b/src/shapes/cylinder.cpp index 577d96cb..065c6f17 100644 --- a/src/shapes/cylinder.cpp +++ b/src/shapes/cylinder.cpp @@ -495,7 +495,7 @@ public: void getNormalDerivative(const Intersection &its, Vector &dndu, Vector &dndv, bool shadingFrame) const { - dndu = its.dpdu / m_radius; + dndu = its.dpdu / (m_radius * m_flipNormals ? -1 : 1); dndv = Vector(0.0f); }