Krylloan
03-27-2002, 12:26 PM
I'm writing a game that will absolutely require the ability to render to a texture.
I hear everyone saying "it's easy, just render to the backbuffer, then transfer the image to a texture"
The problem is, I need to leave the backbuffer data intact.
This is why. (This is the steps my code takes).
1: Render background.to backbuffer
2: Render model to texture X.
3: Render texture X to backbuffer.
4: Render other miscellaneous objects directly to backbuffer.
5: Repeat steps 2 to 4 between 1 and ~100 times.
6: Render foreground and HUD.
7: Flip Buffers.
I could render each model to a separate texture before rendering the background, then render them all on top of each other.
This, however, would be an excessive waste of texture memory.
I can't seem to find any notes on how to render directly to a texture in OpenGL.
(I haven't looked particularly hard yet, sorry, but I have other bits of code I want to write ...now).
If you can help, you have my thanks.
Simon Hill.
I hear everyone saying "it's easy, just render to the backbuffer, then transfer the image to a texture"
The problem is, I need to leave the backbuffer data intact.
This is why. (This is the steps my code takes).
1: Render background.to backbuffer
2: Render model to texture X.
3: Render texture X to backbuffer.
4: Render other miscellaneous objects directly to backbuffer.
5: Repeat steps 2 to 4 between 1 and ~100 times.
6: Render foreground and HUD.
7: Flip Buffers.
I could render each model to a separate texture before rendering the background, then render them all on top of each other.
This, however, would be an excessive waste of texture memory.
I can't seem to find any notes on how to render directly to a texture in OpenGL.
(I haven't looked particularly hard yet, sorry, but I have other bits of code I want to write ...now).
If you can help, you have my thanks.
Simon Hill.