View Full Version : Portable render-to-texture?

03-24-2001, 06:36 AM
Is there a reliable way to do this? It doesn't have to be massively speedy; I'd just like something clean. Right now there only seem to be two options:

1) WGL_ARB_pbuffer : not supported by all (much?) hardware, and (I assume) only ever available on Windows.

2) Render to back buffer, then move to texture memory using glTexCopySubImage2D, recently optimized thanks to Matt. The problem here is windowed apps, where a) the back buffer may not be big enough for the texture, and b) the GL context might not own the contents of parts of the backbuffer (because the window is partially or wholly obscured by another one).

Does anyone know of a solution that doesn't involve a horrible rat's nest of dodgy assumptions and special-case logic?

03-24-2001, 01:11 PM
I think you have to render to a buffer

03-25-2001, 07:50 AM
Just off the top of my head...
How about creating another rendering context with DRAW_TO_BITMAP instead of DRAW_TO_WINDOW? Render your stuff into this new rendering context, then subimage it into your texture from the bitmap data...

I seem to remember mcraighead mentioning that NVidia are working on a way of rendering directly into a texture...any more news on this? It would certainly make possible some weird effects...