copying screen to texture.

Started by DanDanger, July 07, 2006, 18:49:10

Previous topic - Next topic

DanDanger

Hello.

I am trying to implement one of those lovely bloom filters, however part of the process involves copying the screen to a texture.

Does anyone know the openGL commands I would need to ues to do this?

I thought it might need a pbuffer but i'm not sure now! i've gotten all confused ^_^


www.wolfysgames.com

Orangy Tang

glCopyTexSubImage2D should do the trick.

Rasengan

Hey!

Maybe you can use glReadPixels(...), an example of the use of this function is the creation of screenshots... so the pixels of the screen are stored in a byteBuffer and then, you can store it in an image file, a texture or transform it directly...as you want. (remember the dream effect in Max Payne 2...)

It's only an idee, I'm still an OGL noob for the moment..so I dont know the best way to do that  :wink:

EDIT: glCopyTexSubImage2D... thanks for the tip Orangy Tang!