From eedf35f4eba8958947e31f37f90a433655ea42e1 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Fri, 3 Sep 2010 00:18:43 +0200 Subject: [PATCH] bugfix to the composite material --- src/bsdfs/composite.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bsdfs/composite.cpp b/src/bsdfs/composite.cpp index ea61c7de..47155577 100644 --- a/src/bsdfs/composite.cpp +++ b/src/bsdfs/composite.cpp @@ -221,7 +221,7 @@ public: Spectrum result = m_bsdfs[entry]->sample(bRec, pdf); bRec.sampledComponent += m_bsdfOffset[entry]; pdf *= componentPDF; - return result; + return result * m_bsdfWeight[entry]; } else { /* Pick out an individual component */ for (int i=0; isample(bRec, pdf); bRec.component = bRec.sampledComponent = tempComponent; - return result; + return result * m_bsdfWeight[i]; } } Log(EError, "Internal error!"); @@ -248,7 +248,7 @@ public: Spectrum result = m_bsdfs[entry]->sample(bRec); result /= componentPDF; bRec.sampledComponent += m_bsdfOffset[entry]; - return result; + return result * m_bsdfWeight[entry]; } else { /* Pick out an individual component */ for (int i=0; isample(bRec); bRec.component = bRec.sampledComponent = tempComponent; - return result; + return result * m_bsdfWeight[i]; } } Log(EError, "Internal error!");