One_Eleven_Android/darkening_shader.tres
2024-11-10 03:34:28 +03:00

17 lines
395 B
Text

[gd_resource type="Shader" format=2]
[resource]
code = "shader_type canvas_item;
uniform float alphaChannel=1;
void fragment() {
vec4 pixelColor = texture(TEXTURE, UV);
COLOR = texture(TEXTURE, UV);
float newAlpha=(alphaChannel);
vec2 fromCenterVec=UV.xy-vec2(0.5,0.5);
if (newAlpha>=0.0f){
COLOR.a=30.64*newAlpha*length(fromCenterVec);
} else COLOR.a=0.0f;
COLOR.a=alphaChannel;
}"