I started a raytracing project using the python numba library which provides a just-in-time compiler for CUDA kernels. When the scene is rendered my result is a 1920 x 1080 x 3 RGB array in GPU memory. If I only want to display a single image I can grab the result and save it to a .PNG file. My results are great so far, however, my long-term goal is to make a real-time engine with ray-tracing computations.
I am aware that python numba does not support CUDA - OPENGL interoperability, so currently I grab the image from CUDA, and then render it as a texture on the screen. This results in the raytracing being only 3% of computational time. (I can do 30 fps using python arcade and rendering one frame is about 1 ms.)
- Is there a way to interface CUDA with DirectX/Vulkan/OpenGL to show what the GPU already has in memory?
If not, then I am ready to port the project to a different language and use a different API.
- What library/API/language should I port this raytracing project to display my algorithm real-time on the screen?
PS: I am quite new to computer graphics, so I don't get the full picture yet.