tags:

views:

28

answers:

1

Hi,

I have a simulation that uses OpenGL for drawing. While it is running, I would like to plot some things on top of my simulation in real time, but every iteration I only want to add few lines to that graph, instead of always re-drawing it from scratch (that would be too costly).

How could I create some surface to which I can always add, that does not get erased, and how could I overlay it on top of my simulation?

Thank you!

+5  A: 

How could I create some surface to which I can always add, that does not get erased, and how could I overlay it on top of my simulation?

Render to texture using any technique. Then blit the texture on screen. If you don't want it to get erased, don't erase it.

See "Simple Framebuffer Object" demo from NVidia for more info.

OpenGL doesn't have some kind of automatic "overlay" surface. If you want overlay one scene on top of another, draw second scene on texture, draw first scene, then draw texture.

P.S. Framebuffer objects are part of OpenGL since version 3. But they were available on many cards as extensions before that.

SigTerm
okay thanks, i'll have a look!
karpathy