I am trying to implement unit selection circles, like the ones you see in starcraft 2 when you select a bunch of units.
I am doing this for a mobile phone game so I have access to OpenGL ES 3.0.
I know there is some technique called deferred decals but since I am not using deferred rendering it seems like it's not for me.
I mean if it was faster to do it with deferred I could go ahead and implement it using pixel local storage or something? but that's another idea.
So I narrowed it down to 2 ideas but I am not sure which one makes more sense:
1) Take a 2048x2048 texture and draw quads into it at the unit positions from a camera thats looking down at it. Basically same as a shadowmap but writing circles into a color buffer instead of only using the depth buffer. When drawing the scene just sample this texture as I would a shadowmap.
2) Draw the scene and pass into it an array of matrices which are like the cameras looking down onto the unit position. In the fragment shader do a loop over these matrices and perform some kind of projection technique to see if that pixel is sampling a circle. This would limit the amount of circles by 32 maximum in a scene.
Any other ideas? I really have no clue how starcraft 2 implements this but they could very likely be using the deferred decal technique.
I don't want to just draw circles as quads as it looks bad when they intersect the floor and stuff, and with depth test disabled it also looks bad.
If its a huge resource hog for current mobile devices maybe I should abandon this idea altogether? really stuck at the moment.