2021-04-21 18:01:33 +05:30
|
|
|
shader_type canvas_item;
|
|
|
|
render_mode unshaded;
|
|
|
|
|
2023-11-22 01:06:25 +02:00
|
|
|
uniform bool red = true;
|
|
|
|
uniform bool blue = true;
|
|
|
|
uniform bool green = true;
|
|
|
|
uniform bool alpha = false;
|
2024-04-12 01:26:46 +03:00
|
|
|
uniform sampler2D selection : filter_nearest;
|
2021-04-21 18:01:33 +05:30
|
|
|
|
|
|
|
|
|
|
|
void fragment() {
|
|
|
|
// Get color from the sprite texture at the current pixel we are rendering
|
|
|
|
vec4 original_color = texture(TEXTURE, UV);
|
|
|
|
vec4 selection_color = texture(selection, UV);
|
|
|
|
vec4 col = original_color;
|
|
|
|
if (red)
|
2022-06-02 00:04:08 +03:00
|
|
|
col.r = 1.0 - col.r;
|
2021-04-21 18:01:33 +05:30
|
|
|
if (green)
|
2022-06-02 00:04:08 +03:00
|
|
|
col.g = 1.0 - col.g;
|
2021-04-21 18:01:33 +05:30
|
|
|
if (blue)
|
2022-06-02 00:04:08 +03:00
|
|
|
col.b = 1.0 - col.b;
|
2021-04-21 18:01:33 +05:30
|
|
|
if (alpha)
|
2022-06-02 00:04:08 +03:00
|
|
|
col.a = 1.0 - col.a;
|
2021-04-21 18:01:33 +05:30
|
|
|
|
2022-04-23 14:39:17 +03:00
|
|
|
vec4 output = mix(original_color.rgba, col, selection_color.a);
|
2021-04-21 18:01:33 +05:30
|
|
|
COLOR = output;
|
2022-04-23 14:39:17 +03:00
|
|
|
}
|