Monte Carlo ray tracing flow chart algorithm pseudocode: A @goto-implementation and a recursion based implementation, any ideas for a more modern implementation?

This looks fairly similar to graphics ray tracing, my code in Julia and c++ for GPU implementation is here GitHub - Zentrik/Renderer at GPU-WaveFront. It uses a technique called wavefront rendering which is more suitable for the GPU, https://www.google.com/url?q=https://research.nvidia.com/sites/default/files/pubs/2013-07_Megakernels-Considered-Harmful/laine2013hpg_paper.pdf&sa=U&ved=2ahUKEwir-Ov_rK-DAxWhYEEAHTEiDVAQFnoECAEQAg&usg=AOvVaw0grbKUz0v_4BivlR7Y97po.

Though I would suggest finding a existing approach even if it’s in another language and using that.

EDIT: My Julia GPU code has a simpler version here, Renderer/src/simple.jl at GPU-WaveFront · Zentrik/Renderer · GitHub. This should have the same performance as the other file but is simpler to understand.

1 Like