switch mobile, fix shader

This commit is contained in:
Nordup 2024-07-16 01:28:12 +04:00
parent 6d009d0fc1
commit d4190fbd9e
7 changed files with 21 additions and 14 deletions

View file

@ -1,14 +1,18 @@
shader_type canvas_item;
uniform bool ext_texture_is_bgra;
uniform bool fill_alpha;
uniform bool show_render;
const vec4 zero = vec4(0);
void fragment() {
if (show_render) {
COLOR = vec4(COLOR.rgb, 1);
} else {
COLOR = zero;
}
if (ext_texture_is_bgra) {
COLOR = COLOR.bgra; // Swizzle BGRA to RGBA
}
if (fill_alpha) {
COLOR = vec4(COLOR.r, COLOR.g, COLOR.b, 1);
}
}