retrace/Shaders/FadeOut.shader
incredibleLeitman 0d37f1076d added fadeOut effect if get in touch with a meldewesen
only triggers for under 50 % Pill level, otherwise there will be an conversation
2019-12-14 15:32:29 +01:00

15 lines
404 B
GLSL

shader_type canvas_item;
render_mode unshaded;
uniform float cutoff : hint_range(0.0, 1.0);
uniform float smooth_size : hint_range(0.0, 1.0);
uniform sampler2D mask : hint_albedo;
uniform vec4 color : hint_color;
void fragment()
{
float value = texture(mask, UV).r;
float alpha = smoothstep(cutoff, cutoff + smooth_size, value * (1.0 - smooth_size) + smooth_size);
COLOR = vec4(color.rgb, alpha);
}