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:
22
Resources/Textures/Shaders/drunk.swsl
Normal file
22
Resources/Textures/Shaders/drunk.swsl
Normal 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));
|
||||
}
|
||||
Reference in New Issue
Block a user