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:

  1. make an OpenGL pixel buffer
  2. bind it to CUDA
  3. run the raytracer kernel which fills the buffer
  4. give it back to OpenGL
  5. generate a texture from the buffer
  6. set up orthogonal view
  7. render a quad with the texture on it

The results:

Suzanne raytracedand to show that the camera works (somewhat):

Suzanne from a different angleFor those who want to combine CUDA and OpenGL is highly recommend watching this video.

Comment are closed.