mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 17:24:44 -04:00
Saved the TransparentChecker shader as a resource
In case it gets used in other places too in the future, like preview backgrounds.
This commit is contained in:
parent
d8a1e5de12
commit
28c4ee8f90
2 changed files with 17 additions and 18 deletions
15
src/Shaders/TransparentChecker.shader
Normal file
15
src/Shaders/TransparentChecker.shader
Normal file
|
@ -0,0 +1,15 @@
|
|||
shader_type canvas_item;
|
||||
render_mode unshaded;
|
||||
|
||||
uniform float size = 10.0;
|
||||
uniform vec4 color1 : hint_color = vec4(0.7, 0.7, 0.7, 1.0);
|
||||
uniform vec4 color2 : hint_color = vec4(1.0);
|
||||
|
||||
void fragment() {
|
||||
vec2 pos = mod(FRAGCOORD.xy, size * 2.0);
|
||||
bool c1 = any(lessThan(pos, vec2(size)));
|
||||
bool c2 = any(greaterThanEqual(pos, vec2(size)));
|
||||
float c = c1 && c2 ? 1.0: 0.0;
|
||||
COLOR = mix(color1, color2, c);
|
||||
COLOR.a = 1.0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue