Simple web repository for André Bois (aka ZbuffeR)



Go to the robotics page... (updated the 25th of August 2008)



OLD: (updated the 3th of february 2004)

I made this page because of an apparent slowdown of using glCopyTexSubImage from a pbuffer. Thanks to the members of the opengl forum, is was possible to narrow the problem down to this :

« With any Geforce, simply using the following pbuffer parameters for wglCreatePbufferARB make glCopyTexSubImage perform 100 times slower than without them :

WGL_TEXTURE_FORMAT_ARB,WGL_TEXTURE_RGB[A]_ARB,
[WGL_DEPTH_TEXTURE_FORMAT_NV,WGL_TEXTURE_DEPTH_COMPONENT_NV]
WGL_TEXTURE_TARGET_ARB,WGL_TEXTURE_2D_ARB,

So the pbuffer parameters are likely to be empty, or contain only WGL_MIPMAP_TEXTURE_ARB,TRUE. »

You can follow the whole story on the OpenGL advanced forum here... There is probably no need to post anymore on this particular thread, the problem is solved.

Thanks all for your participation !

About the program which led me to stumble on this :

The goal is to produce a 'real' motion blur, with the best performance possible.

On both programs, hit 'V' to toggle vsync (off by default), 'B' to toggle blur rendering (on by default). In this latter case, only the final quads are not displayed, but all the internal renderings are still performed.

You can see the FPS on the text console, just drag the GL window a bit to uncover it. Be sure to keep the GL window on top, or else the GL will not refresh (either a bug from me or from GLFW ??).

truemotionblur_RTT.exe

truemotionblur_pbuffer_copytexsub.exe

truemotionblur_copytexsubimage.exe

truemotionblur_bb_copytexsub.exe

This one creates 12 pbuffers (512x512), render to each a slightly different image, then uses those pbuffers as textures to draw 12 texture-mapped translucent quads on the visible frame buffer.

UPDATED : This one uses only 1 pbuffer (512x512) to minimize context-switches, and uses glCopyTexSubImage followed by a clear 12 times to get the textures. Corrected version, especially for Geforces.

This one uses only 1 pbuffer (512x512) to minimize context-switches, and uses glCopyTexSubImage followed by a clear 12 times to get the textures. Now I know that using non useful attribs for the pbuffer DOES really slow down the GeForces (namely the ones used for Render To Texture, see the OpenGL forum).

On Radeon, it is almost as fast as RTT.

This one DOES NOT uses any pbuffer, just draw to the backbuffer (512x512) and uses glCopyTexSubImage followed by a clear 12 times to get the textures. Too bad it is still slower than the others, it is much simpler to code because there are no GL or WGL extensions. It works on any OpenGL 1.1 implementation.

Athlon 1Ghz/GeForce3 Ti200/Det45.23 : 37 fps

Athlon 1Ghz/GeForce3 Ti200/Det45.23 : 32 fps

Athlon 1Ghz/GeForce3 Ti200/Det45.23 : 0.29 fps

Athlon 1Ghz/GeForce3 Ti200/Det45.23 : 30 fps

Code : RENDER.C

RENDER_fast_pbuffer_copytexsub.C

RENDER_slow_copytexsubimage.C

RENDER_bb_copytexsub.C



The C code is developped with lcc-win32 and GLFW. As it is still in tests, it may be hard to read and have comments in french, you are warned.

END OF FILE