Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: very fast range circles ?

  1. #1
    Junior Member Newbie GLpeon's Avatar
    Join Date
    Jan 2008

    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:

    Click image for larger version. 

Name:	cruisf.jpg 
Views:	331 
Size:	64.2 KB 
ID:	1057

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Dec 2007
    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.
    Disclaimer: This is my personal profile. Whatever I write here is my personal opinion and none of my statements or speculations are anyhow related to my employer and as such should not be treated as accurate or valid and in no case should those be considered to represent the opinions of my employer.
    Technical Blog:

  3. #3
    Junior Member Regular Contributor
    Join Date
    Jan 2004
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts