Files
tbd-station-14/Resources/Textures/Shaders/flashed_effect.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

19 lines
726 B
Plaintext

uniform float percentComplete;
uniform float fadeFalloffExp = 8;
void fragment() {
// Higher exponent -> stronger blinding effect
float remaining = -pow(percentComplete, fadeFalloffExp) + 1;
// Two ghost textures that spin around the character
vec4 tex1 = texture(TEXTURE, vec2(UV.x + (0.02) * sin(TIME * 3), UV.y + (0.02) * cos(TIME * 3)));
vec4 tex2 = texture(TEXTURE, vec2(UV.x + (0.01) * sin(TIME * 2), UV.y + (0.01) * cos(TIME * 2)));
vec4 textureMix = mix(tex1, tex2, 0.5);
// Gradually mixes between the texture mix and a full-white texture, causing the "blinding" effect
vec4 mixed = mix(vec4(1, 1, 1, 1), textureMix, percentComplete);
COLOR = vec4(mixed.rgb, remaining);
}