Drunk Shader (#8910)

Co-authored-by: Kara D <lunarautomaton6@gmail.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
Leon Friedrich
2022-06-23 16:33:25 +12:00
committed by GitHub
parent bf489adb91
commit c25f2e6283
19 changed files with 395 additions and 4 deletions

View File

@@ -0,0 +1,22 @@
uniform sampler2D SCREEN_TEXTURE;
uniform highp float boozePower;
const highp float TimeScale = 0.5;
const highp float DistortionScale = 0.01;
void fragment() {
highp float mod = mix(0.0, DistortionScale, boozePower);
vec2 coord = FRAGCOORD.xy * SCREEN_PIXEL_SIZE.xy;
float time = TIME * TimeScale;
vec2 offset = vec2((mod * 1.5) * sin(time * 1.5), (mod * 2.0) * cos(time * 1.5 - 0.2));
highp vec4 tex1 = zTextureSpec(SCREEN_TEXTURE, coord + offset);
if (boozePower > 0.5) {
offset = vec2((mod * 2 - DistortionScale) * sin(time * 0.333 - 0.2), (mod * 2 - DistortionScale) * cos(time * 0.333));
tex1 = mix(tex1, zTextureSpec(SCREEN_TEXTURE, coord + offset), mix(0.0, 0.3, boozePower*2-1));
}
offset = vec2((mod * 1.0) * sin(time * 1.0 + 0.1), (mod * 1.0) * cos(time * 1.0));
COLOR = mix(tex1, zTextureSpec(SCREEN_TEXTURE, coord + offset), mix(0.0, 0.5, boozePower));
}