Skip to main content
GameDev.net gamedev.net
🔒 Locked

Rendering using pbuffers under Linux?

Started by karx11erx Dec 16, 2005 at 10:48 AM 6 replies 1.5k views
Original Post
karx11erx
karx11erx
I have recently added rendering to textures using pbuffers to an application I maintain. On Windows, I can use the pbuffer directly as a texture after having rendered to it. How do I accomplish that on Linux? All coding examples I could find copy the pbuffer to some texture before rendering with the texture.
_________karx11erxVisit my Descent site or see my case mod.
Wasting Time
Wasting Time
The Linux graphics drivers need to support an extension for "render to texture". The drivers I have used do not appear to support this, so I have to render to the pbuffer and then copy it to the texture. I guess you would need to check the extensions for your card. Is it possible that a Linux graphics driver might actually support WGL_ARB_render_texture? I do not see an equivalent GLX extension in the glxext.h file.
Promag
Promag
Or you could use Framebuffer Objects (FBO) since is more recent and probably faster. I used in linux for rendering to texture and multiple render targets.
markr
markr
I don't know how to do this using the SGIX pbuffer extension. I'm not sure whether you can.

But you can create a texture using glCopyTexImage2d from some other buffer, usually the back buffer, front buffer, or some aux buffer, within the same context.

I've used this and it seems pretty fast, even though there is some copying going on - it's all on the video card memory anyway.

If copying the texture from the back, front or aux buffers isn't convenient, you can still use a pbuffer and glCopyTexImage2d into a texture shared with the main (i.e. visible) context. Sharing can be enabled when you create the pbuffer context.

But using the back buffer works for me. I guess it could be awkward though if you need to use it for something else during the rendering of whatever it is you're rendering.

Mark
karx11erx
karx11erx
I am going for FBOs now, as it looks like they're sufficiently supported. I just haven't found out how to destroy them yet. The docs I know about this don't contain too much about this.
_________karx11erxVisit my Descent site or see my case mod.
Kalidor
Kalidor
Quote:
Original post by karx11erx
I am going for FBOs now, as it looks like they're sufficiently supported. I just haven't found out how to destroy them yet. The docs I know about this don't contain too much about this.
glDeleteRenderbuffersEXT and glDeleteFramebuffersEXT

The best doc you're going to find on using FBOs is the FBO spec.
karx11erx
karx11erx
Thanks. Found it already. :)

[Edited by - karx11erx on December 16, 2005 4:27:37 PM]
_________karx11erxVisit my Descent site or see my case mod.
karx11erx
karx11erx
The stuff I've built doesn't work. I am getting a black texture from rendering to the framebuffer.

Heck, there are never any really good OpenGL coding examples anywhere! :(

I have been working after the FBO doc you linked to.
_________karx11erxVisit my Descent site or see my case mod.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.