CUDA Raytracer update, now comes with OpenGL flavour
Well I’ve been busy with my raytracer again and this time I added OpenGL support and a camera. What I do is:
- make an OpenGL pixel buffer
- bind it to CUDA
- run the raytracer kernel which fills the buffer
- give it back to OpenGL
- generate a texture from the buffer
- set up orthogonal view
- render a quad with the texture on it
The results:
and to show that the camera works (somewhat):
For those who want to combine CUDA and OpenGL is highly recommend watching this video.