OpenGL razterization with CUDA

Hello everyone

I’m completely new to CUDA programming, and I’m thinking about doing graphics in CUDA, using OpenGL to handle the rasterization.

So what I have outlined currently is doing the following steps:

Have a stream of verticies, and pass them to a vertex shader (Written in CUDA), the output of the vertex shader should be send to the OpenGL rasterizer (Maybe i need to do some primitive assembly before this is possible). The output of the rasterizer will be passed to a fragment shader, and finally stored in a Frame buffer.

The step I’m having huge trouble finding any information about, is how to get data from CUDA to the OpenGL rasterizer (Is it even possible?).

So my question is, how do I pass data to the rasterizer (OpenGL), and get that data back?

I hope this is possible, and if anyone could point me to some material I can read.

Yes, it’s possible to transfer data directly between CUDA and OpenGL, and display that data using OpenGL. This is a general category of CUDA/OpenGL interop, and there are:

  1. Sample codes:

look for the key concepts of “3D Graphics” and “Graphics Interop” to find lists of relevant sample codes.

  1. API documentation:

  1. Various presentations and resources to help you get started, here is one example: