mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-02-21 13:03:13 +00:00
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"
This commit is contained in:
parent
b9a841a360
commit
252e93cc9c
1 changed files with 7 additions and 5 deletions
|
@ -5,15 +5,17 @@ uniform float alpha = 0.0;
|
||||||
uniform vec2 screen_resolution = vec2(1280, 720);
|
uniform vec2 screen_resolution = vec2(1280, 720);
|
||||||
uniform vec2 position = vec2(100.0, 100.0);
|
uniform vec2 position = vec2(100.0, 100.0);
|
||||||
uniform vec2 size = vec2(100.0, 100.0);
|
uniform vec2 size = vec2(100.0, 100.0);
|
||||||
//1280, 720
|
|
||||||
|
|
||||||
void fragment(){
|
void fragment(){
|
||||||
|
|
||||||
if (
|
if (
|
||||||
UV.x >= (position.x)/(screen_resolution.x) && UV.y >= (position.y)/(screen_resolution.y)
|
SCREEN_UV.x >= (position.x)/(screen_resolution.x)
|
||||||
&&
|
&& (1.0 - SCREEN_UV.y) >= (position.y)/(screen_resolution.y)
|
||||||
UV.x <= (position.x + size.x)/(screen_resolution.x) && UV.y <= (position.y + size.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;
|
COLOR.a = alpha;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue