PDA

View Full Version : refreshing the same data



rafal
06-22-2011, 06:00 AM
Hello Everybody !

i have 2 problems and need help. im not a openGL programmer :( but i need use openGL to efficiently display our analisis charts.
ive got it but have 2 perfomrace problems :

problem 1) how to refresh the charts on openGL view without render it again. i want to display on the same view some openGL text under mouse cursor and this is very very slowly because of refresh/render all from the begining when mouse move.

problem 2) similar i think. i want to scroll charts on X axis using scroll bar. and this is very very slow. im using glTranslate function on each charts. all of charts contain about few milions points. how to do that to be fast.

Thank You for help.

_arts_
06-22-2011, 06:48 AM
1) you can render your frame into an FBO (http://www.opengl.org/registry/specs/ARB/framebuffer_object.txt), then display it, and draw text and so on over it.
Render to the FBO only and only if the scene changes and not the text.

2) I'm not sure about it, so I let other people to help on it.

rafal
06-22-2011, 07:11 AM
very thanks !

ad 1. THANK it may help. im reading it.

ad 2. i think i shouldn't use all chart points so i need use some aproximate function on chart and i agree i can do that but i want to use for it openGls techniques/standards appropriate for that problem.

ZbuffeR
06-22-2011, 07:16 AM
2) extending the render to FBO approach, you can draw on separate tiles, say if time is on the X axis, render all points for june on a FBO, attach that to texture1, all points for july to texture2, etc. Then draw these as textured quads while moving around the scroll, dynamically rendering may and april to texture3 and 4 as they become visible. You can maintain a pool of tiles (textures), so scrolling back and forth become very fast (like cached drawings).
Unused ones will be recycled for new ones.

Some tutorials :
http://www.songho.ca/opengl/gl_fbo.html
http://www.flashbang.se/archives/48
http://www.swiftless.com/tutorials/opengl/framebuffer.html

Details :
http://www.opengl.org/wiki/Framebuffer_Object

rafal
06-22-2011, 07:24 AM
this is helpfull idea. and i should use this technique but for another purpose.

in the matter of scrolling i think my main problem is that the chart is very huge data vector and i should render only some of points which are really displayed. how to do that with openGl ? or i must do that on non-openGL application side ?