Randoloot/resources/asteroid_cutout.gdshader
2026-10-12 22:16:09 +02:00

9 lines
266 B
Plaintext

shader_type canvas_item;
// Remove the white backing from the original JPEG atlas at render time.
void fragment() {
vec4 texel = texture(TEXTURE, UV);
float background = smoothstep(0.86, 0.98, min(texel.r, min(texel.g, texel.b)));
COLOR.a *= 1.0 - background;
}