Need advice regarding OpenGL (and Qt5)
-
Personally if you are looking to refactor anyway I would go for VBOs in new code. Is your heightmap in a texture or are you passing the heights through as part of the VBO/array?
Which OpenGL version are you targetting?
-
I need the code to run on old computer (let's say 5 year) with integrated chipset even slowly, but it has to display something. Obviously I also need that code to be super fast on a recent computer.
I want to be able to pick a point and draw x/y lines crossing at that point.
With the previous vbo code, everything was smooth until I clicked a point.
After updating the texture, the framerate was crappy. I found thread mentionning this kind of issue with vbo but without a clear answer and too openGL-savy for me. -
OK OpenGL 3 or so sounds a reasonable ball park so VBOs should be fine. I would keep you static and dynamic data in separate VBOs (i.e. heightmap in static or infrequently updated VBO) and the the data for user-selected points to draw in a dynamic VBO.
Difficult to recommend too much more specifics without knowing more really. Good luck though :)
-
I have something that works nicely but I just found a computer with an old intel chipset and openGL 1.4
The rendering is choppy on that one :( -
Not entirely surprising, that is very old!
-
I probably need to display a low-res mesh when panning/rotating to fix that.
I guess I need to handle two version for all my arrays (vertices, texture array, indices) -
I would suggest using VBOs where available and if you really need to support OpenGL 1.x then a fallback to rendering with arrays. That way you get the best performance where the hw supports it.
-
Fallback + low-res -> 50fps when dragging the heightmap
Now I need a way to decide if the current graphic card need the low-res trick or not. Should I guess from the openGL version only? -
Well the technique can be determined form the version number alone I think. The resolution should be determined at runtime by timing your frames. Depends if performance or quality is more important to you.
-
I think I'm now satisfied with my code. One last question regarding renderPixmap.
It looks like I've a very common issue (lot's of similar question according to google): the texture is not displayed.
http://www.qtcentre.org/threads/976-renderPixmap-and-textureHowever I don't know how to fix that.