View Full Version : Fastest and Easiest Render-to-Texture method?

03-07-2005, 12:24 AM
The first method is using glCopyTex(Sub)Image?D, easy but slow.
Another: WGL_ARB_render_texture, need multiple render context.
GL_EXT_frame_buffer_object, not widely supported currently.

Are there any other good methods?

03-07-2005, 01:47 AM
Are you sure glCopyTexSubImage is slow? I use it all the time and a lot of games use it (Doom3/ Call of Duty) You have any stats to quote on relative speeds?

03-07-2005, 08:41 AM
slow? to backup sqrt-1 from memory testing im getting something like 3billion pixels a second! with copytexsubimage, perhaps youre not using it with the correct path

03-08-2005, 01:23 AM
I did not do any testing but I think glCopyTexSubimage must be slower than using GL_EXT_framebuffer_object because it has to copy the pixel data from the framebuffer instead of rendering directly into the texture in the first place.

If using a p-buffer or GL_EXT_framebuffer_object would not be faster, why would I use them for anything else than rendering to floating point textures, or textures which are larger than the framebuffer?

03-08-2005, 03:22 AM
A pbuffer is faster because there is less data transfert, but there is the cost of switching rendering context.
My small tests gave pbuffer about 20% faster for 512x512 rgba textures.
With GL_EXT_framebuffer_object it should be better.

However to me the problem of simple glCopyTexSubimage is not really performance but generality : no way to handle textures bigger than viewport, and undefined behaviour when other windows overlap part of the copied window.