Re-organizing the Resources folder. Part 1. (#1234)
* First commit * Lockers * Lockers electric boogaloo * Crates and Lockers * Almost finishing the Textures folder * Updating texture paths. Reminder to fix: * Lockers * Windows * Vending Machines * APC * Catwalks * Bedsheets and Cloaks * Status effects * dont know what happened here * Commit before merge * re-organizing * Lockers broken * Commit before merge * Submodule * renaming * Fixing most issues * forgot these ones * Updating submodule * typo * Fixing some paths * fixing some paths * updating submodule * (hopefully) fixing the submodule
This commit is contained in:
25
Resources/Textures/Shaders/cooldown.swsl
Normal file
25
Resources/Textures/Shaders/cooldown.swsl
Normal file
@@ -0,0 +1,25 @@
|
||||
light_mode unshaded;
|
||||
|
||||
const float PI = 3.14159265;
|
||||
|
||||
uniform float progress = 0.0;
|
||||
|
||||
void fragment() {
|
||||
vec4 col = texture(TEXTURE, UV);
|
||||
vec2 center = vec2(0.5,0.5);
|
||||
vec2 delta = UV.xy - center;
|
||||
|
||||
float angle = atan(delta.x, -delta.y) + PI;
|
||||
|
||||
float dist = length(delta);
|
||||
float dist_fwidth = fwidth(dist) * 0.67;
|
||||
|
||||
float dist_alpha = smoothstep(0.1-dist_fwidth, 0.1, abs(dist-0.35));
|
||||
|
||||
float angle_delta = (progress * PI * 2) - angle;
|
||||
float arc_length = angle_delta * dist;
|
||||
|
||||
float angle_alpha = progress > 0 ? smoothstep(dist_fwidth, 0.0, arc_length) : 0.0;
|
||||
|
||||
COLOR = vec4(col.xyz, 1-max(dist_alpha, angle_alpha));
|
||||
}
|
||||
Reference in New Issue
Block a user