PDA

View Full Version : Render to texture on Linux...



Stephen Webb
08-06-2003, 10:25 PM
I need to be able to render to a texture using the (ARB? Nvidia?) extensions...(ie not glCopyTexImage2D)...The code I have found so far is windows specific. I have zero experience using extensions, and it has been recommended to me that I try to make existing examples work rather than doing it all myself...

SO, the example code is written for Windows, and I have tried to convert it over to run on a Linux system, but I don't even have (and can't find) the header files....

for instance:
#include <glh_nveb.h>
#include <glh_extensions.h>
#include <nv_algebra.h>
#include <nv_manip.h>

Much less the libraries that they refer to....Am I missing something here?

Also, I haven't had luck with finding GLX counterparts to these:

"WGL_ARB_pbuffer " \
"WGL_ARB_pixel_format " \
"WGL_ARB_render_texture "

("required extensions")

Am I expecting too much (can RTT be accomplished on Linux...) Can anyone point me to some documentation on these extension (or using extensions in general? Has anyone done this?

Is this more complicated than it has to be? (hint: yes)

Why not:

glWriteBuffer(GL_TEXTURE, texureHandle)

!?

The end of my rope is in sight, so someone please respond if only to commiserate with me... http://www.opengl.org/discussion_boards/ubb/smile.gif

-Steve

Asgard
08-06-2003, 11:23 PM
The counterpart to WGL_ARB_pbuffer under Linux is GLX_SGIX_pbuffer. And the counterpart to WGL_ARB_pixel_format is GLX_SGIX_fbconfig.
However, as you've found out, WGL_ARB_render_texture is not (yet) available for GLX and therefore you can't do true render-to-texture on Linux. The only option is to either copy from the framebuffer to a texture or, if your window is resizable and you cannot rely on always being able to fill the entire texture, you'll have to use a pbuffer, render to it, and then copy from the pbuffer to a texture.

It is expected that the yet-to-be-finalized super/berbuffers extension an ARB working group is currently working on will make render-to-texture a whole lot easier in OpenGL and without requiring the use of windowing system-specific extensions.

[This message has been edited by Asgard (edited 08-07-2003).]

SergeVrt
08-06-2003, 11:27 PM
You might find linux pbuffer sample in mesa samples at mesa official site