PDA

View Full Version : Drawing to an offscreen float pbuffer



12-16-2003, 02:55 AM
Hi,
I'm trying to draw to an offscreen float pbuffer (32 bits per channel with alpha), but every time I try to do a drawing operation (glBegin(anything) or glDrawArrays()) i get the "invalid operation" OpenGL error. If i use 8 bits per channel no error will occur. What's the matter? I've checked the choose pixel format attribs and the create PBuffer attribs over and over but I can't find the problem. Will someone help me, please? Thanks.

Caran

Relic
12-16-2003, 04:40 AM
Drawing into float buffers only works with fragment programs.

12-16-2003, 05:01 AM
That's ok. I'm actually using fragment programs but I have to draw a quad (glBegin(GL_QUADS)) on the entire buffer to force the fragment program to run for every pixel. But, as I already said, glBegin gives me an "invalid operation" error.

Relic
12-16-2003, 07:09 AM
You're sure that it's nothing from before the glBegin?
You haven't called glGetError in between glBegin and glEnd?
Show some code! http://www.opengl.org/discussion_boards/ubb/wink.gif

12-16-2003, 07:15 AM
The code i pretty complex, but I've called glGetError just before glBegin and it showed no error. Before that there is just window creation and extensions initialization. I've tried to use the same code from the constructor of the RenderTexture class by Mark J. Harris and the same error occurred. I'm going crazy! http://www.opengl.org/discussion_boards/ubb/confused.gif