I'm not sure if this question is appropriate for this site. I figured this would be the best place to ask. I need to draw 15+ circles on the screen and translate/move each of them per frame. I don't know whether I should use vertices to draw the circle, or simply draw a square and attach an image of a circle on it. I thought it would be more practical/professional to use vertices but I then thought it might be a lot to handle. If each circle had 1000 points(so its smooth), that means each circle has 1002 vertices. 15 of those make 15,030 vertices I'm multiplying by a model matrix per frame. I figured that would be a lot for a device to handle. So then I thought about simply a square with 5 vertices(using a triangle strip) and just attaching a circle image as a texture. This would only make for 75 vertices to update per frame - a lot less. I also would be guaranteed to have a smooth looking circle. I just feel like this way isn't as professional. So I came here hoping for people with experience. Which method should I use for drawing circles? Vertices or Texture mapping? Or another method perhaps? Again, I apologize if this is a dumb question or if it has already been asked.
Asked
Active
Viewed 1,066 times
0
-
1You can draw a really smooth circle with the method described [here](http://stackoverflow.com/questions/11452729/how-do-i-draw-a-filled-circle-with-opengl-es-on-iphone) – user3312130 Feb 28 '14 at 01:05
-
Thanks, but I already wrote a method for drawing a circle. – josephoneill Feb 28 '14 at 01:07
-
It's not something you need to rewrite, you just implement the shader and draw a square and the shader turns it into a scalable, smooth circle without needing lots of vertices or a circle image. – user3312130 Feb 28 '14 at 01:37
-
Ah, ok. Well, thanks then. :) I'll use it if I choose to use vertices. – josephoneill Feb 28 '14 at 01:43
-
The approach in the linked post uses the exact same number of vertices as you would for drawing a texture, only instead of you supplying an image ahead of time, it would calculate the circle on the fly using shaders. You'd use almost exactly the same code for specifying vertices there as you would when drawing textures. The tradeoff is in additional fragment shader load, which will depend on the number of circles and their size, but the shader approach guarantees perfectly sharp circles no matter their size on screen. – Brad Larson Feb 28 '14 at 18:54
-
If I want 15 circles, I would need to load the shader 15 times? Can I create a circle class and create 15 instances but call the shader once and translate each individually? – josephoneill Feb 28 '14 at 20:32