How to use texture in 128-bit-color pbuffer?

Hi.
I mat a problom when renderring a rectangle with texture in pbuffer. I just draw a single frame and read it back by glReadPixels. When the pbuffer use 32-bit color, everything wents ok. But when a 128-bit-color pbuffer used, all of the pixels were set to (0, 0, 0, 0). How to use texture in this case? Thanks.

Could you provide a bit more information or code? It sounds just too general…

Sorry for late. I used a fragment program:
!!ARBfp1.0
PARAM TZERO = { 0.0, 0.0, 0.0, 0.0 };
PARAM TONE = { 0.9, 0.9, 0.9, 0.9000001 };
ATTRIB tcoord0 = fragment.texcoord[0];
ATTRIB tcoord1 = fragment.texcoord[1];

TEMP a, b;
TEMP t;
TEX a, tcoord0, texture[0], 2D;
TEX b, tcoord1, texture[1], 2D;
MOV result.color, b;
END
But result.color was set to be (0, 0, 0, 0) no matter what texture[1] was.

There could be a large number of things wrong.

Here are some that I can think of right away:

  • Creating the context for the pbuffer could fail.
  • Making the device/context current could fail (not: it’s not certain that you can use the same context for 32-bit and 128-bit targets)
  • You may have forgotten to share lists into the context.
  • Blending might be turned on – that’s not supported for float targets.

I would suggest you sprinkle your code liberally with “assert(!glGetError())” at the beginning and end of every function in your code, and at opportune intermediary points if functions are long.

I had the same problem today. I wanted to render a 32 - bit RGBA texture on GFFX5600. It was the first time I used pbuffers and ARB_render_texture. Took me about a 30 minutes to debug 8 lines of code! Finnaly I discovered that my mesh didn’t fit into the clipping volume. How stupid…

Context was created and made current successfully. No Lists. No blending. Mesh in volume. Free window dc failed, but getLastError() returned “Operation succeed”.

Do you create the fragment program inside your pbuffer context? Sorry for stupid question…

I did create the fragment program for pbuffer. When the pbuffer use 32-bit color, everything wents ok. So I think there may be some problom when pixel format of pbuffer is different from that of window.