2022-01-31 00:18:04 +00:00
|
|
|
shader_type canvas_item;
|
|
|
|
|
|
|
|
uniform float alpha = 0.0;
|
|
|
|
|
|
|
|
uniform vec2 screen_resolution = vec2(1280, 720);
|
|
|
|
uniform vec2 position = vec2(100.0, 100.0);
|
|
|
|
uniform vec2 size = vec2(100.0, 100.0);
|
2022-04-27 21:03:56 +00:00
|
|
|
|
2022-01-31 00:18:04 +00:00
|
|
|
|
|
|
|
void fragment(){
|
|
|
|
|
|
|
|
if (
|
2022-04-27 21:03:56 +00:00
|
|
|
SCREEN_UV.x >= (position.x)/(screen_resolution.x)
|
|
|
|
&& (1.0 - SCREEN_UV.y) >= (position.y)/(screen_resolution.y)
|
|
|
|
|
|
|
|
&& SCREEN_UV.x <= (position.x + size.x)/(screen_resolution.x)
|
|
|
|
&& (1.0 - SCREEN_UV.y) <= (position.y + size.y)/(screen_resolution.y)
|
2022-01-31 00:18:04 +00:00
|
|
|
){
|
|
|
|
COLOR.a = alpha;
|
|
|
|
}
|
2022-04-27 21:03:56 +00:00
|
|
|
}
|