Files
tbd-station-14/Resources/Textures/Shaders/gradient_circle_mask.swsl
AJCM-git ae41d03ec6 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
2020-07-07 19:19:00 +02:00

24 lines
692 B
Plaintext

uniform float percentagedistanceshow = 0.05;
uniform float gradientfalloffwidth = 3.0;
vec4 circle(in vec2 uv, in vec2 pos, float rad, in vec3 color) {
float d = length(pos - uv) - rad;
float t = clamp(d, 0.0, 1.0);
return vec4(color, t);
}
void fragment() {
vec2 uv = FRAGCOORD.xy;
vec2 res_xy = vec2(1.0/SCREEN_PIXEL_SIZE.x, 1.0/SCREEN_PIXEL_SIZE.y);
vec2 center = res_xy*0.5;
float radius = percentagedistanceshow * res_xy.y;
vec4 grad = vec4(0.8 - length( uv - center )/res_xy.y * gradientfalloffwidth);
vec4 layer1 = vec4(vec3(255.0),0.0);
vec4 layer2 = circle(uv, center, radius, grad.rgb);
COLOR = mix(layer1, layer2, layer2.a);
}