PBuffer & Render to Texture (read & write)
Hi,
I'm trying to render into a pbuffer subbuffer (e.g. WGL_FRONT_LEFT_ARB) and at the same time I want to use subbuffers of the pbuffer (WGL_BACK_LEFT_ARB, WGL_AUX0_ARB) as texture uniforms for my fragment program. I don't even know if that's possible, but I think I read about that somewhere.
This is roughly how I thought it could work:
(using a GeForce 6800 GT)
For the next pass I want to render into the buffer that I used for reading in this pass. Accordingly I want to read the buffer that has the results from the previous pass.
wglBindTexImageARB(...) always results (GetLastError()) in error code 3221684230 which is neither ERROR_INVALID_OPERATION, ERROR_INVALID_DATA, nor ERROR_INVALID_WINDOW_HANDLE.
I use the following attributes for my pbuffer:
and the following pbuffer related extensions in my program:
Any idea how I can get this working?
Thanks a lot!
I'm trying to render into a pbuffer subbuffer (e.g. WGL_FRONT_LEFT_ARB) and at the same time I want to use subbuffers of the pbuffer (WGL_BACK_LEFT_ARB, WGL_AUX0_ARB) as texture uniforms for my fragment program. I don't even know if that's possible, but I think I read about that somewhere.
This is roughly how I thought it could work:
(using a GeForce 6800 GT)
Code:
_oFPBuffer.activate();
...
glActiveTexture(GL_TEXTURE2);
glEnable(GL_TEXTURE_2D);
glGenTextures(1, _iTexRead);
glBindTexture(GL_TEXTURE_2D, _iTexRead);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
...
glDrawBuffer(WGL_FRONT_LEFT_ARB);
glActiveTexture(GL_TEXTURE2);
glBindTexture(GL_TEXTURE_2D, _iTexRead);
if( !wglBindTexImageARB(&_oFPBuffer, WGL_BACK_LEFT_ARB) )
{ ... error ... }
glUniform1iARB(_iTexUnitDiagN1, 2);
...
glBegin(GL_QUADS);
{ ... }
glEnd();
glActiveTexture(GL_TEXTURE2);
wglReleaseTexImageARB(&_oFPBuffer, WGL_BACK_LEFT_ARB);
...For the next pass I want to render into the buffer that I used for reading in this pass. Accordingly I want to read the buffer that has the results from the previous pass.
wglBindTexImageARB(...) always results (GetLastError()) in error code 3221684230 which is neither ERROR_INVALID_OPERATION, ERROR_INVALID_DATA, nor ERROR_INVALID_WINDOW_HANDLE.
I use the following attributes for my pbuffer:
Code:
int attribList[] =
{
WGL_SUPPORT_OPENGL_ARB, true,
WGL_RED_BITS_ARB, 32,
WGL_GREEN_BITS_ARB, 32,
WGL_BLUE_BITS_ARB, 32,
WGL_ALPHA_BITS_ARB, 32,
WGL_STENCIL_BITS_ARB, 8,
WGL_DEPTH_BITS_ARB, 24,
WGL_FLOAT_COMPONENTS_NV, true,
WGL_BIND_TO_TEXTURE_RGBA_ARB, true,
WGL_DRAW_TO_PBUFFER_ARB, true,
WGL_DOUBLE_BUFFER_ARB, true,
WGL_AUX_BUFFERS_ARB, true,
0,
};and the following pbuffer related extensions in my program:
Code:
"GL_NV_float_buffer " \
"WGL_ARB_pixel_format " \
"WGL_ARB_pbuffer " \
"WGL_ARB_render_texture " \
"WGL_ARB_extension_string "Any idea how I can get this working?
Thanks a lot!
apparently the aqua theme doesn't help at all, after all
OneSadCookie Wrote:apparently the aqua theme doesn't help at all, after all
You mean to scare away windows programmers? I was wondering about the aqua theme...
Maybe some day we'll all be using EXT_framebuffer_object, but for now the specifics of pixel formats and window/pbuffer drawables are highly OS-specific. So this question is better asked on the Windows OpenGL forum. iDevGames is Macintosh-centric.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Render video (e.g. QuickTime) to buffer or texture? | Ingemar | 14 | 11,040 |
Jun 8, 2011 04:09 PM Last Post: mdejong1024 |
|
| pbuffer blending problem on macmin g4 | madjerry | 4 | 3,258 |
Nov 27, 2009 03:14 AM Last Post: madjerry |
|
| Render to Texture? | IBethune | 5 | 5,233 |
May 2, 2007 04:25 AM Last Post: IBethune |
|
| Pbuffer problems on Intel NVIDIA GeForce 7300 GT | NYGhost | 5 | 3,720 |
Oct 26, 2006 09:39 AM Last Post: NYGhost |
|
| pBuffer - how to draw in it, then display it? | taojones | 0 | 2,100 |
Nov 13, 2005 09:54 AM Last Post: taojones |
|

