Book 3 - bug in final code? black image when using lambert material for nearest object to camera in mixed density pdf approach #1240
1vx-437312114
started this conversation in
Debugging
Replies: 2 comments
-
I got a similar result (all black, except for the light) as soon as I updated my code to include the "Sampling Directions towards a Hittable" section. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Spawned issue #1265. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is the result of the final code of book 3 (src/TheRestOfYourLife/main.cc ):
When i change the material of the glass sphere in the
cornell_box()
- function into a lambert diffuse material i get a nearly black image with basically only the light source visible when i render the image:This is what it should look like (rendered for comparison in the brute force path tracer without the mixed density pdf approach):
I tried a few things e.g. replacing the sphere with a box or changing materials of the box inside the scene to lambert diffuse. My results so far are that whenever the object which is nearest to the camera is lambert diffuse the rendering breaks and i get the nearly black image from above as the result.
I came to this after i tried implementing the mixed density pdf approach from book 3 in my own path tracer where i tried to render the original cornell box (in which everything has a diffuse material) and i got the same bad results which got me trying to test the original code.
Here are the "changes" (just one line) in the
cornell_box()
- function of the main.cc file inside the folder src/TheRestOfYourLife/ for changing the glas sphere in the front to a blue colored diffuse sphere:Has anyone any idea what is going wrong here or what i did wrong and how to fix this? Thanks in advance.
Here is the "modified" main.cc if anyone wants to test it:
main_cc.txt
Beta Was this translation helpful? Give feedback.
All reactions