I'm trying some improvement in luxrender and i see something strange :
- Code: Select all
void SampleContinuous(float u0, float u1, float uv[2],
float *pdf) const {
float pdfs[2];
unsigned int v;
uv[1] = pMarginal->SampleContinuous(u1, &pdfs[1], &v);
uv[0] = pConditionalV[v]->SampleContinuous(u0, &pdfs[0]);
*pdf = pdfs[0] * pdfs[1];
}
void SampleDiscrete(float u0, float u1, unsigned int uv[2], float *pdf) const {
float pdfs[2];
uv[1] = pMarginal->SampleDiscrete(u1, &pdf[1]);
uv[0] = pConditionalV[uv[1]]->SampleDiscrete(u0, &pdf[0]);
*pdf = pdfs[0] * pdfs[1];
}
on the second method : should we correct
uv[1] = pMarginal->SampleDiscrete(u1, &pdf[1]);
by
uv[1] = pMarginal->SampleDiscrete(u1, &pdfs[1]);
and the same for
uv[0] = pConditionalV[uv[1]]->SampleDiscrete(u0, &pdfs[0]);
I think the returned pdf is bad ...
and the same in mcdistribution.h
