Jump to content
  • Advertisement
Sign in to follow this  

reading from a pbuffer

This topic is 4798 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to read from a pbuffer, but I'm not exactly sure how. I'm not trying to make a texture, I'm trying to read from a pbuffer for the use of a mouse map of a 3d landscape. I'm currently using glReadPixels, but that doesn't seem to work. Would I need to make a call to wglMakeCurrent(pbuffer_device,pbuffer_render_context) in order to correctly glReadPixels? Is there a better way to read from a pbuffer?

Share this post


Link to post
Share on other sites
Advertisement
Hi,

You should combine the pbuffer extension with the renter_to_texture. Once rendering in your pbuffer, when switching back to your original context(the visible onscreen buffer or another pbuffer), this extension lets you bind your pbuffer as a texture so you can access it with regular texture coordinates. This far more efficient than glReadPixels functions:
http://oss.sgi.com/projects/ogl-sample/registry/ARB/wgl_render_texture.txt

I would also suggest you to have a look at the framebuffer_object new extension, it is operationnal on Nvidias hardware with beta drivers(I don't know for ATI cards), and is really THE extension for doing offscreen rendering at "cheap" performance cost(have also lots of options and flexibility):
http://oss.sgi.com/projects/ogl-sample/registry/EXT/framebuffer_object.txt

Cheers, Jeff.

Share this post


Link to post
Share on other sites
Which Beta version drivers are you using for NVIDIA that supports EXT_framebuffer_object ?

Have you tried this ? If so on which graphics card ?

Share this post


Link to post
Share on other sites
I'm using the 76.41 drivers and yes I use framebuffer_objects in my code that does some complex multipass offscreen before final rendering. Here you go for the driver it will change your life :-)
http://downloads.guru3d.com/download.php?det=1022

It also has GLSL 1.10 support wich is great.
My card is a GF6600.


Cheers, Jeff.

Share this post


Link to post
Share on other sites
Quote:
Original post by funkeejeffounet

this extension lets you bind your pbuffer as a texture so you can access it with regular texture coordinates. This far more efficient than glReadPixels functions

Cheers, Jeff.


How would I access the pixel data of a texture?

Share this post


Link to post
Share on other sites
search for 'fragment shaders' and 'vertex shaders' on google.

Shaders are small programs run on the vertex and/or fragment processors of your video card.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!