bugfix to the composite material
parent
0f1158c678
commit
eedf35f4eb
|
@ -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!");
|
||||||
|
|
Loading…
Reference in New Issue