RayTracing / raytracing.github.io

Main Web Site (Online Books)
https://raytracing.github.io/
Creative Commons Zero v1.0 Universal
8.64k stars 845 forks source link

Book 3.6.2: Need for clarification about the resulting render when using an imperfect PDF #1321

Open Shridhar2602 opened 10 months ago

Shridhar2602 commented 10 months ago

In section 6.2, "Using a Uniform PDF Instead of a Perfect Match", there's a need for clarification to avoid confusion. The section currently states -

This will still converge on the correct answer, as all we've done is change the PDF, but since the PDF is now less of a perfect match for the real distribution, it will take longer to converge. Which, for the same number of samples means a noisier image: .... You should get a very similar result to before, only with slightly more noise, it may be hard to see.

In my implementation, I am getting a much brighter image after changing the PDF to uniform, which as per my knowledge is the expected behavior. While the section does mention increased noise, it doesn't adequately address the potential issue of a brighter or dimmer rendered image. This omission can be frustrating for beginners, who would expect to see a slightly noisy image but would instead get a drastically different render after changing the pdf.

Or am I mistaken and going wrong somewhere?

gau-nernst commented 9 months ago

I observed the same problem. From my understanding, the problem is related to #933. Not sure why it was fixed in v3 but v4 has the wrong implementation. Basically, the sampling PDF and scattered ray should be linked. We cannot change the sampling PDF (pdf in the code) without changing how the scattered ray is sampled.

dimitry-ishenko commented 4 months ago

Related to #1302