Question

So, I think I understand the basic functionality of cuda, and also how the graphics pipeline works. But what I don't understand is how CUDA raytracing engines combine those two. Since the vertices of a scene are stored in the graphics pipeline via directx or opengl, I can't see how this information can be accessed via the cuda pipeline.

Was it helpful?

Solution

I can't see how this information can be accessed via the cuda pipeline.

First of all, you can write a ray-tracer that doesn't use the graphics pipeline at all, except for final display of the pixels (e.g. glDrawPixels). An example is here.

But in general, the sharing of data between OGL/DX and CUDA is facilitated by the interop APIs. These APIs allow for various kinds of data to be shared between CUDA and OpenGL, including final rendered pixels, geometry data, and textures. There are plenty of CUDA sample codes which demonstrate all of these types of data sharing, in both directions, including display of results.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top