Draiken
Draiken

Reputation: 3815

Drawing simple shapes or using sprites with OpenGL

I want to create a simple shape, let's say, a circle, it might have transparency, colors, etc. but it's still a simple circle.

In every tutorial I see, people use sprites. I am not sure what should I use for my case.

Should I use a sprite with a circle or should I try and draw the shape myself?

What are the advantages of each method?

Is there a line dividing them or is it just experience to know which one to use?

Upvotes: 0

Views: 1118

Answers (1)

GetLastError
GetLastError

Reputation: 86

GPU geometry is composed of triangles or line segments so it'll be inefficient to draw a circle in this way, it'll require too many triangles for it to look smooth.

The two more efficient ways to do that are:

  1. Use a sprite
  2. Use a shader and draw the circle. Check ShaderToy, more specifically the "Shapes" preset.

Upvotes: 1

Related Questions