So I have a code that plots a bunch of points on the screen. They all have position and color associated with them. Currently I’m using VBOs to display them and it works fine. Points are static and all I do is rotate the view around them, zoom in/out and such. What I notice is that when I hit around 3-4 million points I see a big performance hit, so I wanted to see if shaders would be of any benefit.
I never did any work with shaders so I’m not sure if they would help in this situation. Any clues?
Shaders are instructions applied to data.
On the vertex side or the fragment side, you might apply less instructions that fixed path, and gain some speed.
How do you draw your points currently ? STATIC_DRAW ? Blending ? Alpha testing ? Please show some code.
And your hardware is ?
So I assume I’m doing a STATIC_DRAW. The points are always stationary and don’t move in space all that moves is the camera around them. Here is the code on how I draw the points.
Try breaking your draw into smaller batches. The exact size of each smaller batch is something you’ll need to experiment with, but start at maybe 50,000 per batch and go up from there.
So I just tried drawing 50k at a time and it didn’t seem all that impressive. I’d say slightly better, but nothing spectacular. Might go from 1.5fps to maybe 2fps.
M//Hax: I got a Quadro NVS 135M. I hope that it should be enough to do what I want it to do. I’m hoping that it will be able to draw 20-30 million points at some time.
That’s a mobile quadro…I don’t know if it’s going to be able to do it. I’m using a Quadro FX 580, and i can easily draw 10Mils points. I never tried over that, but it would probably work. Maybe something is wrong in your VBO as well! I used my program on a pc with an onboard graphic card and it could run at 11 fps with 2 Mils points.