PDA

View Full Version : very fast range circles ?



GLpeon
06-17-2013, 04:34 PM
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:

1057

aqnuep
06-17-2013, 05:05 PM
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.

Mikkel Gjoel
06-18-2013, 06:48 AM
Have a look at this presentation about Screen Space decals, essentially rendering "on the depthbuffer".
http://www.slideshare.net/blindrenderer/screen-space-decals-in-warhammer-40000-space-marine-14699854

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