Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Bush2Tree |
I’m using shaders to mask 4 different sprites that cover the same area. After the masks are applied, each sprite should only be showing in its individual corner, and therefore all 4 sprites that were originally covering the same area should be visible. However, it seems that only the last sprite to be rendered is visible, even though it is only covering it’s own corner and therefore should not be covering any of the other sprites. Here is (roughly) the shader code:
shader_type canvas_item;
uniform sampler2D mask;
void fragment() {
COLOR = texture(TEXTURE, UV) * texture(mask, UV);
}
The mask uses white for areas that should be rendered, and transparency for areas that should not be rendered.
I am using 4 instances of the same scene, initialized with different parameters–maybe that’s part of my problem?
Any help is appreciated.