bugfix to the composite material

metadata
Wenzel Jakob 2010-09-03 00:18:43 +02:00
parent 0f1158c678
commit eedf35f4eb
1 changed files with 4 additions and 4 deletions

View File

@ -221,7 +221,7 @@ public:
Spectrum result = m_bsdfs[entry]->sample(bRec, pdf); Spectrum result = m_bsdfs[entry]->sample(bRec, pdf);
bRec.sampledComponent += m_bsdfOffset[entry]; bRec.sampledComponent += m_bsdfOffset[entry];
pdf *= componentPDF; pdf *= componentPDF;
return result; return result * m_bsdfWeight[entry];
} else { } else {
/* Pick out an individual component */ /* Pick out an individual component */
for (int i=0; i<m_bsdfCount; ++i) { for (int i=0; i<m_bsdfCount; ++i) {
@ -234,7 +234,7 @@ public:
Spectrum result = m_bsdfs[i]->sample(bRec, pdf); Spectrum result = m_bsdfs[i]->sample(bRec, pdf);
bRec.component = bRec.sampledComponent = tempComponent; bRec.component = bRec.sampledComponent = tempComponent;
return result; return result * m_bsdfWeight[i];
} }
} }
Log(EError, "Internal error!"); Log(EError, "Internal error!");
@ -248,7 +248,7 @@ public:
Spectrum result = m_bsdfs[entry]->sample(bRec); Spectrum result = m_bsdfs[entry]->sample(bRec);
result /= componentPDF; result /= componentPDF;
bRec.sampledComponent += m_bsdfOffset[entry]; bRec.sampledComponent += m_bsdfOffset[entry];
return result; return result * m_bsdfWeight[entry];
} else { } else {
/* Pick out an individual component */ /* Pick out an individual component */
for (int i=0; i<m_bsdfCount; ++i) { for (int i=0; i<m_bsdfCount; ++i) {
@ -261,7 +261,7 @@ public:
Spectrum result = m_bsdfs[i]->sample(bRec); Spectrum result = m_bsdfs[i]->sample(bRec);
bRec.component = bRec.sampledComponent = tempComponent; bRec.component = bRec.sampledComponent = tempComponent;
return result; return result * m_bsdfWeight[i];
} }
} }
Log(EError, "Internal error!"); Log(EError, "Internal error!");