updates
This commit is contained in:
parent
276d43613d
commit
4298caf5cb
552 changed files with 42990 additions and 776 deletions
24
game/resources/steal_ring.gdshader
Normal file
24
game/resources/steal_ring.gdshader
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
shader_type spatial;
|
||||
// Billboarded radial progress ring above a crop unit while a thief takes it. Fills clockwise
|
||||
// from the top; drawn over the scene so crops and buildings never hide it.
|
||||
render_mode unshaded, cull_disabled, depth_test_disabled, shadows_disabled;
|
||||
|
||||
uniform float progress : hint_range(0.0, 1.0) = 0.0;
|
||||
uniform vec4 fill_color : source_color = vec4(1.0, 0.45, 0.1, 1.0);
|
||||
uniform vec4 back_color : source_color = vec4(0.05, 0.05, 0.05, 0.6);
|
||||
|
||||
void vertex() {
|
||||
MODELVIEW_MATRIX = VIEW_MATRIX * mat4(INV_VIEW_MATRIX[0], INV_VIEW_MATRIX[1], INV_VIEW_MATRIX[2], MODEL_MATRIX[3]);
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
vec2 p = UV * 2.0 - 1.0;
|
||||
float r = length(p);
|
||||
if (r > 1.0 || r < 0.58) {
|
||||
discard;
|
||||
}
|
||||
float a = fract(atan(p.x, -p.y) / 6.2831853 + 1.0);
|
||||
vec4 c = a <= progress ? fill_color : back_color;
|
||||
ALBEDO = c.rgb;
|
||||
ALPHA = c.a;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue