Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PBuffers with GLX

15 views
Skip to first unread message

Sang Ahn

unread,
Sep 19, 2002, 5:16:06 PM9/19/02
to
When creating a PBuffer, does in have to have the same characteristics
as the framebuffer? If the framebuffer does not have the alpha
channel (24-bit RGB pixels), is there a way to create a Pbuffer that
has 32-bit pixels? Also, how can this be bound to a texture under
GLX? Thanks.

Sang Ahn

Jason Allen

unread,
Sep 19, 2002, 5:40:21 PM9/19/02
to
Your pbuffer fbconfig is totally independant of your framebuffer's fbconfig
(unless you are sharing your rendering context between the two). You should
have no trouble creating a 32-bit pbuffer when your framebuffer is 24bit.

There isn't currently a way to bind a GLX pbuffer (like
WGL_ARB_render_texture) so you'll have to stick with good old
glCopyTexImage2D and glCopyTexSubImage2d.

Jason A.

"Sang Ahn" <san...@surgicalinsights.com> wrote in message
news:bc6dc74a.02091...@posting.google.com...

Max Celedon Collins

unread,
Sep 19, 2002, 7:41:02 PM9/19/02
to
When you create a pixel buffer, you can set differents characteristics for it. To bind a texture, you need to active the pixel buffer context yo can use glReadPixels (slow) or glCopytexSubImage2d (faster).

greetz

--
Max Celedon Collins
http://ugs3d.sourceforge.net
http://www.xinitry.cl

On 19 Sep 2002 14:16:06 -0700

Sang Ahn

unread,
Sep 20, 2002, 9:48:45 AM9/20/02
to
That's the problem, I can't seem to create 32-bit pixel width for the
pbuffer. This is some sample of the code I'm using

// Frame buffer attribute list
int nFBAttrib[] = {GLX_DOUBLEBUFFER, 1,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_DEPTH_SIZE, 12,
None};
// P buffer attribute list
int nPBAttrib[] = {GLX_DOUBLEBUFFER, 0,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_ALPHA_SIZE, 1
GLX_DEPTH_SIZE, 12,
None};
Display* dpy = XOpenDisplay(NULL);
int nElements;
GLXFBConfig* fbc; // Frame buffer config
GLXFBConfig* pbc; // P buffer config

fbc = glXChooseFBConfig(dpy, DefaultScreen(dpy), nFBAttrib,
&nElements); // this line works fine
pbc = glXChooseFBConfig(gpy, DefaultScreen(dpy), nPBAttrib,
&nElements); // this line returns nElements = 0

As you can see the last line doesn't allow me to create an
alpha-channel for the pbuffer. Any help is greatly appreciated
"Jason Allen" <jra...@yahoo.com> wrote in message news:<9vri9.490194$q53.16...@twister.austin.rr.com>...

César Blecua Udías

unread,
Sep 20, 2002, 10:40:06 AM9/20/02
to
Sang Ahn wrote:
>
[...]

>
> fbc = glXChooseFBConfig(dpy, DefaultScreen(dpy), nFBAttrib,
> &nElements); // this line works fine
> pbc = glXChooseFBConfig(gpy, DefaultScreen(dpy), nPBAttrib,
> &nElements); // this line returns nElements = 0

You didn't tell us about your hardware, OS, nor GLX version. You're
calling GLX 1.3 functions in that code. Does your system support GLX 1.3
? If affirmative, does your hardware support destination alpha?

César
cesar...@ono.com

Ruud van Gaal

unread,
Sep 20, 2002, 12:27:52 PM9/20/02
to
On 20 Sep 2002 06:48:45 -0700, san...@surgicalinsights.com (Sang Ahn)
wrote:

>That's the problem, I can't seem to create 32-bit pixel width for the
>pbuffer. This is some sample of the code I'm using
>

>// P buffer attribute list
>int nPBAttrib[] = {GLX_DOUBLEBUFFER, 0,
> GLX_RED_SIZE, 1,
> GLX_GREEN_SIZE, 1,
> GLX_BLUE_SIZE, 1,
> GLX_ALPHA_SIZE, 1
> GLX_DEPTH_SIZE, 12,
> None};

>As you can see the last line doesn't allow me to create an
>alpha-channel for the pbuffer. Any help is greatly appreciated

I think the framebuffer must support the config though; so on some
cards you might find that you cannot request alpha buffers.

Try 'glxinfo' to see if there's a visual ID that suits your specs (and
modify your specs accordingly).
Also, try a GLX_DEPTH_SIZE of 16, 24 or 32. 12 is odd; your GLX
implementation might be braindead and refuse the config based on that.


Ruud van Gaal
Free car sim: http://www.racer.nl/
Pencil art : http://www.marketgraph.nl/gallery/

Sang Ahn

unread,
Sep 20, 2002, 3:22:43 PM9/20/02
to
Sorry about the omission of info. My setup supports all of the things
you've mentioned below, destination alpha in the frame buffer (I'm
running Solaris 8, Elite3D card, which has 24 bit-wide frame buffer).
With a 32-bit wide frame buffer, I would render to the frame buffer,
and then load to texture memory, and the alpha bits would be
preserved. With the 24-bit wide frame buffer of the Elite3D, I lose
the alpha values when I load to texture memory. I want to set up a
pbuffer that does have the alpha to which I can render to and load to
texture memory, and keep the alpha values.

César Blecua Udías <cesar...@ono.com> wrote in message news:<3D8B3346...@ono.com>...

Ian D Romanick

unread,
Sep 21, 2002, 4:02:48 AM9/21/02
to
san...@surgicalinsights.com (Sang Ahn) writes:

>That's the problem, I can't seem to create 32-bit pixel width for the
>pbuffer. This is some sample of the code I'm using

This is 100% device dependent. It seems that your device doesn't support
this. There is nothing in the pbuffer specification that requires a device
driver to behave either way. Apparently, the driver for you device behaves
in a way that's inconvenient, but not illegal.
--
"...the VCR is to the American film producer and the American public as the
Boston strangler is to the woman home alone." -- Jack Valenti 1982

Thanks Jack, but you don't know jack!

César Blecua Udías

unread,
Sep 21, 2002, 5:47:08 AM9/21/02
to
Sang Ahn wrote:
>
> Sorry about the omission of info. My setup supports all of the things
> you've mentioned below, destination alpha in the frame buffer (I'm
> running Solaris 8, Elite3D card, which has 24 bit-wide frame buffer).
> With a 32-bit wide frame buffer, I would render to the frame buffer,
> and then load to texture memory, and the alpha bits would be
> preserved. With the 24-bit wide frame buffer of the Elite3D, I lose
> the alpha values when I load to texture memory. I want to set up a
> pbuffer that does have the alpha to which I can render to and load to
> texture memory, and keep the alpha values.

Does your machine have a FBConfig-capable 'glxinfo' tool? The 'glxinfo'
tool shows the list of GLX visuals for your framebuffer configuration.
If your 'glxinfo' version supports FBConfigs (like the SGI version), it
will tell whether each visual can be used for windows, pixmaps and
pbuffers.

Btw, when you say "24-bit wide frame buffer", do you mean that you can
configure your hardware to have a 24bit or 32bit framebuffer? In such
case, the number and type of supported visuals is likely to change (even
for pbuffers). This is typical on SGIs. The 'xsetmon' SGI tool settings
can change the list of visuals returned by 'glxinfo' on many SGI
workstations.

César
cesar...@ono.com

0 new messages