|
|
How to render/draw buffer object to framebuffer without glDrawPixels.
Hello,
According to opengl spec 4.0 glDrawPixels is deprecated.
For cuda interoperability it seems best to use "opengl buffer objects". (An
alternative could be textures or surfaces but these have caching/concurrency
issues and are therefore unusable for my cuda kernel).
I simply want to create a cuda kernel which maps this opengl buffer object
and uses it as a "pixel array" or a piece of memory holding pixels, later it
unmaps it.
I then want the opengl program to draw the buffer object to the framebuffer.
I would like to use an opengl api which is not deprecated.
What other ways/apis are there to draw a buffer object to the frame buffer ?
(Also render buffers cannot be used since they probably have same issue as
cuda arrays/caching issues, so this rules out framebuffer object/extension
?!?).
Is there a gap/missing functionality in opengl 4.0 now that glDrawPixels is
deprecated ? Or is there an alternative ?
Bye,
Skybuck.
|
|
0
|
|
|
|
Reply
|
Windows7IsOK (161)
|
6/22/2012 9:11:54 PM |
|
It seems the only solution is the following:
1. Create a "(opengl) pixel buffer object" which is hopefully the same as a
"(opengl) (general) buffer object".
2. Use the pixel buffer object for cuda interoperability. (If not possible,
then try a general buffer object"
3. Then either draw the pixel buffer object to a texture with tex* opengl
api calls and then draw the texture to the default framebuffer.
(This is probably a double copy, so probably the slowest method.)
4. Or try and draw the pixel buffer object directly to the framebuffer. I am
not sure if this requires a special framebuffer object/extension.
(This might be faster if it can be done directly, just one copy).
|
|
0
|
|
|
|
Reply
|
Windows7IsOK (161)
|
6/22/2012 9:50:36 PM
|
|
The cuda manual mentions three possible opengl interoperability
possibilities:
1. Buffer objects
2. Textures
3. Render buffers
The cuda manual also mentions that textures and render buffers are cached
and have concurrency issue if the same pixels is read/written from/to by
multiple threads from the same kernel call.
Perhaps my kernel only needs to write the output to each pixel just once, so
I might get away with using textures or render buffers. But the concurrency
issue makes me a bit nervous... what if it does want to read/write the same
pixel multiple times from multiple threads ? I guess in that case I will
have to use buffer objects...
Also the buffer objects seem to come in handy since they could also be used
as source objects for the cuda kernel... so it has multiple functionalities,
input and output. Therefore it's probably the best option to start with for
support. However I am not yet sure if buffer object is equal to pixel buffer
object. I think so though.. ;)
It also seems a bit easier to implement then 2 and 3, those require extra
api calls and types.
Bye,
Skybuck.
|
|
0
|
|
|
|
Reply
|
Windows7IsOK (161)
|
6/22/2012 10:10:00 PM
|
|
|
2 Replies
97 Views
(page loaded in 0.061 seconds)
Similiar Articles: How to draw framebuffer to device context ? - comp.graphics.api ...... an (open gl) frame buffer object for "offscreen rendering" for example render ... create a gl context without a window - comp.graphics.api.opengl ... How to draw framebuffer ... renderbuffer objects - comp.graphics.api.opengl... out that there's a new ATI driver which I installed without ... group, For creating a shadow map I've set up a depth render buffer object, using this code: GLuint frameBuffer ... Image processing the frame buffer under OpenGL - comp.graphics.api ...... processing on the frame buffer under OpenGL. I tried inserting the following code into my render ... GL_RGBA,GL_FLOAT,img); glDrawPixels ... and that > was without doing any ... how to render to metafile? - comp.graphics.api.opengl... PixelFormat settings without result ... How to draw framebuffer to device context ... is using an (open gl) frame buffer object for "offscreen rendering" for example render ... Reading rendered image into memory - comp.graphics.api.opengl ...framebuffer_objects are available on ATI and ... FBO: depth render buffer objects - comp.graphics.api ... in physical memory, without gaps. The SGX can only render into a ... still struggling with FBOs and depth texture (for shadow map ...After rendering to the depth buffer, I ... each time* you go to draw. The framebuffer_object.txt file ... to-texture using FBO works fine without such a call, but the render ... glDrawPixel - what is missing here? - comp.graphics.api.opengl ...... iWidth); //this is width of the frame buffer glDrawPixels(width ... Actually it's the commonly used technique to render ... the traffic at either end of a PTP T without ... Redraw only some objects - comp.graphics.api.opengl... of moving objects. These information arrives without ... calls the draw method of all of my objects ... lot data to render with modern GPUs. Just put every object ... OpenGL video rendering - comp.graphics.api.opengl... an OpenGL texture, it works fine as long as I render ... you can try to use pixel_data_range or pixel_buffer_objects ... In my tests, glTexSubImage2D without PDR or PBO takes ... Incredibly slow! - comp.graphics.api.openglWindows have valid framebuffer contents ... is affinity DC meaning that GL objects ... why you need an offscreen >>>> p-buffer, it *can* be rendered on and read back without ... OpenGL FAQ / 14 Rasterization and Operations on the Framebuffer14.015 How do I use glDrawPixels ... the contents of the framebuffer will be inverted. When you render ... initialize or clear a buffer without calling glClear()? Draw a ... opengl - DrawPixels with PACK Pixel Buffer Object - Stack OverflowHow to render/draw buffer object to framebuffer without glDrawPixels 7/16/2012 11:22:18 AM
|
|
|
|
|
|
|
|
|