very fast range circles ?

I was looking at supreme commander, and how they have rage circles that are painted on the terrain for each unit, and I was curious on how they did that ?

I am thinking they might be using a textured quad with a circle shape in the alpha buffer, and then stretch that to what they need, and use a shader to get it the color they want but, that would produce jaggies if the texture was too low of a res.

Doing the “normal” way of using a vertex array seems to be way too slow, since they would have to factor in the terrain height.

Are they doing something special here ?
Here is a pic:

[ATTACH=CONFIG]447[/ATTACH]

Instead of using a texture you can use shader math to achieve the same thing without the problem of undersampling.

The only thing you have to do is to calculate the distance from a specified radius circle, scale it, and then you’ll get the smooth round-shaped range circle.

Have a look at this presentation about Screen Space decals, essentially rendering “on the depthbuffer”.

  • alternatively, they could just be doing it directly in the terrain-shader, but this would lead to a lot of wasted processing.