-
Hi everyone, I'm somewhat stumped with this bit in the third book, "Using a Uniform PDF Instead of a Perfect Match". I've implemented the lambertian cosine-law PDF and so far everything works as expected, but according to the book, switching to a uniform PDF (constant Intuitively, this makes sense! The cosine-law PDF is higher closer to 0, since the lambertian diffuse is more likely to scatter rays towards the surface normal, and that means the values will be, on average, lower than the uniform distribution represented by the constant So why are the images expected to look the same? More fundamentally, I don't really understand why all PDFs will eventually converge on the same result when they have different expected values. Am I missing something? Is it just a matter of insufficient samples (images provided are 10x10 samples per pixel on 10 threads, so 1000spp total, same as the book is using)? I don't think it's a bug in my code as I've checked the implementation more than a few times, but here's the file just in case (implemented in Rust, but largely the same as the book other than multiple threads). |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think this was reported before: |
Beta Was this translation helpful? Give feedback.
I think this was reported before:
#1321
#933
#1272
#617
The current text in the book, together with the images seem to be a bit misleading and don't seem to make 100% sense currently.
The way I understand it, only if you change the sampling together with the pdf, you will still have the same image. If you change either one by itself, you are drawing samples from a different distribution than the pdf and therefore, the samples will be weighted wrong --> incorrect image.