PDA

View Full Version : Can I use backbuffer as a texture? How to do?



hedgehog70
02-27-2003, 11:31 PM
Hi,

I want to use part of my render image as a texture to simulate mirror effect, what shall I do.

Thanks

Bob
02-28-2003, 12:22 AM
Have a look at glCopyTex(Sub)Image2D.

V-man
02-28-2003, 04:41 AM
Or
http://oss.sgi.com/projects/ogl-sample/registry/ARB/wgl_render_texture.txt

(will give performanec problems on some cards)

heath
03-02-2003, 10:23 AM
If you are sure that your window won't be obscured by menus or dialog boxes,during the rendering of the scene you wish to grab, you'll be able to use the backbuffer as a source for you texture using glCopyTexSubImage2D. If however there is the potential for menus/dialogs obscuring portions of the display then depending upon the OpenGL driver you could suffer from pixel ownership problems, and thus cannot rely on the contents of the backbuffer not having "holes" where the dialogs are.

Your best bet would probably be to use PBuffers, or render to texture if they are supported, Or make sure that the dialogs/menus don't obscure your canvas.

Heath.

hedgehog70
03-03-2003, 06:23 AM
Thanks, but glCopyTex(Sub)Image2D and render to texture can't deal with 1024x768 image, it only support 1024,512,256...

Asgard
03-03-2003, 06:34 AM
Then either use WGL_NV_render_texture_rectangle or use a 1024x1024 texture and adjust your texture coordinates appropriately to only use 1024x768.