I'm using OpenGL and was told I should draw circles at each vertex of my outline to get smoothness. I tried this and it works great. The problem is speed. It crippled my application to draw a circle at each vertex. I'm not sure how else to fix the anomaly of my outlines other than circles, but using display lists and trying with vertex array both were brutally slow. Thanks
Asked
Active
Viewed 2,267 times
2
-
If you were told on SO, could you provide a link to that question, please, because I do not understand the original problem from your question alone ;) – zerm Jun 14 '10 at 22:07
-
When you say "trying with vertex array", how were you using them? One VA containing a single circle with multiple glTranslates()/glDrawElements() or a single large VA with one glDrawElements() call? – genpfault Jun 14 '10 at 22:16
-
A single large VA with GLDrawArrays() – jmasterx Jun 14 '10 at 22:16
-
1"It crippled my application to draw a circle at each vertex." modern GPU should be able to render few millions of triangles triangles per frame without choking up - if you do it properly. How exactly are you rendering circles? Post code. Try to change circle resolutions. You don't need high-res circles if their radius is 3 pixels - 4..6 segments is enough. Try changing circle resolutions depending on circle size. I.e. if circle is 100+ pixels large, it makes sens to use few hundreds of faces, but for small ones it isn't worth it (no one will notice) - i.e. less polygons for smaller circles. – SigTerm Jun 15 '10 at 03:51
2 Answers
2
One (perhaps too fancy) alternative is to draw a single polygon that bounds the circle (say, a quad), and then use a fragment program to discard the fragments. This would not be entirely trivial to write, but I would bet it's the fastest way.
You would simply pass the circle parameters to the fragment program and discard the fragment if the distance from the fragment center to the center of the circle is bigger than the desired radius.

Carlos Scheidegger
- 1,906
- 1
- 13
- 18
0
Have you seen this article?
..or if you have access to the GL utility library, you could use gluDisk

Jon Cage
- 36,366
- 38
- 137
- 215
-
-
I'm not sure - it's been a long time since I played with OGL. Why not try it? :-) – Jon Cage Jun 14 '10 at 22:38
-
gluQuadrics is based on immediate mode, i.e glBegin/glEnd. Avoid at all costs. – Jun 20 '10 at 00:59