Jump to content
  • Advertisement
Sign in to follow this  
mathieuxxxx

OpenGL Merging textures for faster rendering?

This topic is 4060 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I will explain my situation before asking for the solution.... I have to draw, in OpenGl, a large grid with a value showed at each point of the grid. The problem is my grid can have as much as 250 000 dots. So when I render 250 000 dots with, on each one a text value(Texture mapped font) my render time is very slow (6 seconds per render) I was wondering if it would be possible to merge all those font texture into a single big bitmap to make it a lot faster? Or if you have any kind of suggestions I'm willing to hear it. Thanks Mat

Share this post


Link to post
Share on other sites
Advertisement
How are you rendering the whole thing at this point?
I assume all the dots are in a static VBO / DL and rendered using a single draw call? (that is, assuming your dots are statically placed)
How about the text? I hope it's not by using wgl.

Share this post


Link to post
Share on other sites
Do you use different fonts?
If not why do you have separate textures?
Or do you mean the strings rendered to textures?

Anyway it should be possible to store several images in a single texture. The constraint should usually be the maximum texture size your system supports. [google]: texture atlas

Share this post


Link to post
Share on other sites
The render is done with CallList. I have a list containing all the dots(GL_POINT) and a list containing all the strings;

About the strings: I have 128 textures representing each character of a font in a list. When I write a string I call each character needed in the character list.

I don't know anything about VBO/DL.. would it be better using it?

BTW I program in C# in case....

Share this post


Link to post
Share on other sites
OpenGL: Store all characters in one texture, and use texture coordinates to shift between them - you should see a tremendous speed increase.

Are all 250K points in your viewport? If not, you could use some kind of hierarchical structure (i.e. tree) to quickly discard invisible points. If they all are visible, a display list would probably be the fastest way to render them - but 250K points are quite a lot, so don't expect great performance.

How quickly are you moving? If a lot of points stay at the same place for a significant length of time, consider using an imposter instead of actual points: a texture which contains an image of these points, updated less frequently than once per frame.

There are also some things to keep in mind since you are using C#: a) make sure you are not overloading the garbage collector by creating thousands of items every frame. b) If you are using Tao, download the latest Tao.OpenGl beta (clicky), you should see a 10x call speed increase when using some functions.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!