render to texture

just curious, how do you render to a texture? any web pages or similar apprechiated

btw, is it fast enough to allow for several such (say 256x256) textures to be rendered (assuming the geometry is not massive)

Look into glCopyTexImage2D() or glCopyTexSubImage2d(). Both copy from the frame buffer to a texture object, this is the only ‘clean’ solution in OpenGL to render to a texture. In current hardware implementations both are pretty fast.
Also, if that is possible (depends on what you want to do with the rendered textures), try to turn the detail level as low as possible when rendering the textures, turn texture mapping off, etc. I’m working on a 3D engine that implements reflection mapping this way and generally I’d say it’s pretty fast.

lemme just check to see if i got this

change to texture’s “camera” (thus updating matrix and glViewport), render, do a glCopyTexImage2D into a texture, repeat as neccessary

change to main “camera”, render, swap buffers

or?

Check out the pbuffer extension, though the only cards that I think support it is nvidias.

You might wanna have a look at some code I did. A dynamic cube mapping example, which renders into the backbuffer, and updates the textures each frame.

It’s on www.nutty.org in the extension section.

Nutty

Originally posted by AndersO:
Check out the pbuffer extension, though the only cards that I think support it is nvidias.

The ATI Radeon and Rage 128 supports the pbuffer extension as well.