Advertisement

pbuffers and glCopyTexSubImage2D()

Started by August 09, 2004 05:13 AM
1 comment, last by Lyve 20 years, 3 months ago
Hello members, I'm implementing impostors right now to render volumetric clouds using a pbuffer for offscreen rendering of the clouds. However, I'm unable to transfer my pbuffer to a texture because glCopyTexSubImage2D() takes over one second to copy the data for a 1024x1024 RGBA pbuffer on a P4 3GHZ with a GFFX5700. My pbuffer is created using the following flags:

iattributes[2*niattribs ] = WGL_DRAW_TO_PBUFFER_ARB;
iattributes[2*niattribs+1] = true;
niattribs++;
iattributes[2*niattribs ] = WGL_DEPTH_BITS_ARB;
iattributes[2*niattribs+1] = 16;
niattribs++;
iattributes[2*niattribs ] = WGL_RED_BITS_ARB;
iattributes[2*niattribs+1] = 8;
niattribs++;
iattributes[2*niattribs ] = WGL_GREEN_BITS_ARB;
iattributes[2*niattribs+1] = 8;
niattribs++;
iattributes[2*niattribs ] = WGL_BLUE_BITS_ARB;
iattributes[2*niattribs+1] = 8;
niattribs++;
iattributes[2*niattribs ] = WGL_ALPHA_BITS_ARB;
iattributes[2*niattribs+1] = 8;
niattribs++;
iattributes[2*niattribs ] = WGL_ACCELERATION_ARB;
iattributes[2*niattribs+1] = WGL_FULL_ACCELERATION_ARB;
niattribs++;
iattributes[2*niattribs ] = WGL_PIXEL_TYPE_ARB;
iattributes[2*niattribs+1] = WGL_TYPE_RGBA_ARB;
niattribs++;

wglChoosePixelFormatARB(....);
.
.
.
.
.
int iattribs[] =
{
    WGL_PBUFFER_LARGEST_ARB, 1,
    WGL_TEXTURE_FORMAT_ARB,WGL_TEXTURE_RGBA_ARB,
    WGL_TEXTURE_TARGET_ARB, WGL_TEXTURE_2D_ARB,
    WGL_MIPMAP_TEXTURE_ARB, 0,
    0
}
wglCreatePbufferARB(...);

My texture is created using gluBuild2DMipmaps( GL_TEXTURE_2D, 4, 1024, 1024, GL_RGBA, GL_UNSIGNED_BYTE, pData ); Using wglBindImageARB() to display the pbuffer is no problem, but what I want is to use the same pbuffer multiple times for different images, storing the resulting data over multiple frames without the need to update them. Any ideas? Regards, Lyve
_____________________________________http://www.winmaze.de, a 3D shoot em up in OpenGL, nice graphics, multiplayer, chat rooms, a nice community, worth visiting! ;)http://www.spheretris.tk, an upcoming Tetrisphere clone for windows, a 3D tetris game on a sphere with powerful graphics for Geforce FX and similar graphics cards.
I tried to replace gluBuild2DMipmaps() by glTexImage2D(), but still no luck.
_____________________________________http://www.winmaze.de, a 3D shoot em up in OpenGL, nice graphics, multiplayer, chat rooms, a nice community, worth visiting! ;)http://www.spheretris.tk, an upcoming Tetrisphere clone for windows, a 3D tetris game on a sphere with powerful graphics for Geforce FX and similar graphics cards.
Advertisement
Found it:

I replaced:

int iattribs[] =
{
WGL_PBUFFER_LARGEST_ARB, 1,
WGL_TEXTURE_FORMAT_ARB,WGL_TEXTURE_RGBA_ARB,
WGL_TEXTURE_TARGET_ARB, WGL_TEXTURE_2D_ARB,
WGL_MIPMAP_TEXTURE_ARB, 0,
0
}

with:
int iattribs[] = { 0 };

now it's working
_____________________________________http://www.winmaze.de, a 3D shoot em up in OpenGL, nice graphics, multiplayer, chat rooms, a nice community, worth visiting! ;)http://www.spheretris.tk, an upcoming Tetrisphere clone for windows, a 3D tetris game on a sphere with powerful graphics for Geforce FX and similar graphics cards.

This topic is closed to new replies.

Advertisement