LWJGL Forum

Programming => OpenGL => Topic started by: DanDanger on July 07, 2006, 18:49:10

Title: copying screen to texture.
Post by: DanDanger on July 07, 2006, 18:49:10
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
Title: copying screen to texture.
Post by: Orangy Tang on July 08, 2006, 13:56:05
glCopyTexSubImage2D should do the trick.
Title: copying screen to texture.
Post by: Rasengan on July 08, 2006, 14:26:36
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!