Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9247743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:48:34+00:00 2026-06-18T09:48:34+00:00

What I am trying to do is to use OpenGL to perform some rendering,

  • 0

What I am trying to do is to use OpenGL to perform some rendering, then use CUDA to perform some read-only post-processing (computations) directly on the rendered RGB and depth components, without copying the data to a PBO.

To do this, I create a FBO and I attach two RBO’s to it (one for the RGBA and one for the DEPTH).

Then, I call cudaGraphicsGLRegisterImage for each RBO with GL_RENDERBUFFER as parameter. For the color RBO cudaGraphicsGLRegisterImage returns cudaSuccess, but for the depth RBO, I receive a cudaErrorInvalidValue.

I’ve read somewhere in the forums that CUDA render buffer interop for the depth component is not currently supported by nVidia, though it is well present in the documentation.

I am using CUDA Toolkit 5.0 and I have a Quadro 2000 card.

Have someone succeeded to do this, and how ?

Here are some code extracts :

glGenRenderbuffers(1, &rbo_color);
glBindRenderbuffer(GL_RENDERBUFFER, rbo_color);
glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA, WIDTH, HEIGHT);
glBindRenderbuffer(GL_RENDERBUFFER, 0);

if (cudaGraphicsGLRegisterImage(&resource_color, rbo_color, GL_RENDERBUFFER, cudaGraphicsMapFlagsReadOnly) != cudaSuccess)
    fprintf(stderr, "Error in registering rbo color with cuda\n");

glGenRenderbuffers(1, &rbo_depth);
glBindRenderbuffer(GL_RENDERBUFFER, rbo_depth);
glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT32F, WIDTH, HEIGHT);
glBindRenderbuffer(GL_RENDERBUFFER, 0);

if (cudaGraphicsGLRegisterImage(&resource_depth, rbo_depth, GL_RENDERBUFFER, cudaGraphicsMapFlagsReadOnly) != cudaSuccess)
    fprintf(stderr, "Error in registering rbo depth with cuda\n");
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T09:48:35+00:00Added an answer on June 18, 2026 at 9:48 am

    I did not have any success binding the depth buffer itself. One work-around for this is to render the depth pixel value into a color buffer and bind the color buffer as you do. You will need to write your own shader to accomplish this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to perform combined rendering with OpenGL for polygonal rendering and CUDA for
I'm trying to use a 3d texture in opengl to implement volume rendering. Each
Using Code::Blocks w/ mingw, and trying to use GLee for some OpenGL on windows.
I am writing CUDA C codes and trying to use OpenGL for the visualization
I'm trying to use the QGLWidget to use OpenGL in a Qt application. I
I was trying to use the function glMultiDrawElements while studying OpenGL (using red book)
I'm using opengl and trying to create a first person camera. All examples use
I'm trying to use OpenGL and GLFW with Derelict3 for the D language, but
I've moved on from trying to use OpenGL through Penumbra to trying to draw
I am trying to use OpenGL with Qt. I was following this example: http://qt-project.org/doc/qt-5.0/qtgui/openglwindow.html

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.