Godot Version
4.3
Question
` Hi, I have the following shader -
shader_type canvas_item;
uniform sampler2D screen_texture: hint_screen_texture;
void fragment() {
COLOR = texture(screen_texture, SCREEN_UV);
float alpha = 1.0 - texture(TEXTURE, UV).a;
COLOR.a = alpha;
}
This is the structure of the project -
-Img
-Tilemaps
–TextureTilemap
–BackBufferCopy
–ShapeTilemap (with shader)
By design, the shader is applied to the ShapeTilemap to determine transparency based on the texture’s alpha channel. This allows you to clip the textures from the TextureTilemap according to the shape defined in the ShapeTilemap.
However, for me it leads to a lot of artifacts and bugs in the transparent zone. I don’t know how to implement it correctly, although such functionality sounds like the most simple thing…
`