PDA

View Full Version : rendering to a back buffer



04-10-2001, 11:39 AM
How would I go about rendering a scene to a buffer, then import it as a texture on a scene polygon? I was trying to simply render it to a jpeg, and then load the jpeg onto the poly; but even this was hard to locate code for. any suggestions?

Nutty
04-10-2001, 12:00 PM
Provided you're using double buffering, your rendering should automatically be on the back buffer.

(I believe there is some functionality between switching between this, and stencil buffers, and what not.. but I dont remember)

To get your rendered image into a texture, you want to use glTexCopySubImage, when your texture is currently bound.

You might want to use glViewport, to setup the rendering size to the dimensions of your texture.

You could also use Pixel buffers (PBuffers) though the only tut I've found on this is in delphi. On the main news board of www.opengl.org (http://www.opengl.org)

I have a dynamic cubemap demo on my website, that basically copies 6 renderings from the back buffer into a texture. You might want to take a look.

it's at
www.nutty.org (http://www.nutty.org)

hope that helps.

Nutty

DaViper
04-11-2001, 12:51 AM
Originally posted by Nutty:
To get your rendered image into a texture, you want to use glTexCopySubImage, when your texture is currently bound.


If you don't have an existing Texture you should use glCopyTexImage

Chris