Transparent part of texture is showed as black

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Rajbir98

So I set the blend mode of a texture to overlay using shaders and here it is

shader_type canvas_item;
uniform sampler2D overlayTexture;
vec4 overlay(vec4 base, vec4 blend){
 vec4 limit = step(0.5, base);
 return mix(2.0 * base * blend, 1.0 - 2.0 * (1.0 - base) * (1.0 - blend), limit);
}


void fragment() {
   vec4 base = textureLod(SCREEN_TEXTURE, SCREEN_UV, 0.0);
   vec4 blend = textureLod(overlayTexture, UV, 0.0); 
   COLOR = overlay(base, blend); // overlay the two textures
}