Circle Area of Effect indicator
This is a small “AOE loading” indicator shader.
It is made for having below a boss, or any 3D mesh dealing AOE damage. Slap it on a plane mesh. Keep the dimensions square but resize the mesh to your liking and add this as a ShaderMaterial.
Parameters:
- `aoe_color`: The color of the effect
- `width`: A value for the width of the external circle in UV coordinates
- `fill_value`: How much of the internal circle is filled, between 0 and 1.
Shader code
shader_type spatial;
uniform vec4 aoe_color : source_color = vec4(1.0, 0.0, 0.0, 0.3);
uniform float width : hint_range(0.001, 0.1, 0.001) = 0.01;
uniform float fill_value : hint_range(0.0, 1.0, 0.1) = 0.5;
void fragment() {
float d = distance(UV, vec2(0.5));
ALPHA = 0.0;
// External circle
if (d >= 0.5 - 2.0* width && d <= 0.5)
ALPHA = 1.0 * aoe_color.a;
// Internal circle
if (d < fill_value * 0.5)
ALPHA = 1.0 * aoe_color.a;
ALBEDO = aoe_color.xyz;
}