1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-02-07 19:09:50 +00:00
Pixelorama/src/Shaders/UITransparency.gdshader
Variable 252e93cc9c
Transparency improvements (#680)
* add limit change with brush

* Delete Draw.gd

* Delete BaseTool.gd

* added error calculation

* revert last commit

* Error calculations

* Update UITransparency.gdshader

* Update UITransparency.gdshader

* Update UITransparency.gdshader

* used "screen_uv" instead of "UV"
2022-04-28 00:03:56 +03:00

22 lines
492 B
Plaintext

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);
void fragment(){
if (
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)
){
COLOR.a = alpha;
}
}