dilevin / computer-graphics-ray-tracing

Computer Graphics Assignment about Ray Tracing
1 stars 5 forks source link

Very small difference in sphere-packing #79

Closed pranavrao145 closed 3 days ago

pranavrao145 commented 3 days ago

Hello,

When comparing the output sphere-packing.json with ImageMagick, I'm having a very very small difference between the expected output and mine. Below is the difference (red specks):

difference

I suspect the fudge factor but nothing I've tried has worked so far. To get the output above, I'm adding 1e-9 * n to the origins of both the mirror ray and the shadow ray, and passing in 1e-4 as min_t to first_hit in both of these scenarios. Every change I've tried so far has made it stay either the same or made it much worse.

Does anyone have any ideas on how I can fix this? Thanks in advance!

jennicao commented 3 days ago

I had something similar and I increased my maximum recursion depth by 1 to fix this

FalakR commented 3 days ago

So should we keep the max_depth as 10 or 11 in that case ?

jennicao commented 3 days ago

Whichever works for you, I think. I have it at 11

pranavrao145 commented 3 days ago

I can confirm that setting it at 11 does in fact fix my problem. Thanks a lot @jennicao!

jennicao commented 3 days ago

Awesome! Glad I could help :)