dilevin / computer-graphics-ray-tracing

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

Are we allowed to define maximum recursion for raycolor? #50

Open Leuxll opened 1 year ago

Leuxll commented 1 year ago

In the original main.cpp, we have num_recursive_calls set to 0, the output of my images doesn't have any reflection at all. But when I changed the num_recursive_calls to 5 the reflections are showing. Does that mean we can just set a constant num_recursive_calls?

num_recursive_calls = 0

Screenshot 2023-09-27 at 12 12 37 PM

num_recursive_calls = 5

Screenshot 2023-09-27 at 12 13 56 PM
panuelosj commented 1 year ago

num_recursive_calls is the current depth of the recursion. Use a separate hardcoded variable for max_num_recursive_calls. You can hardcode it to 10.