mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-18 17:19:50 +00:00
Fix warnings in MarchingAntsOutline.gdshader
This commit is contained in:
parent
e686f114a8
commit
df139ed645
|
@ -10,6 +10,11 @@ uniform float frequency = 50.0;
|
||||||
uniform float stripe_direction : hint_range(0, 1) = 0.5;
|
uniform float stripe_direction : hint_range(0, 1) = 0.5;
|
||||||
|
|
||||||
|
|
||||||
|
bool is_zero_approx(float num) {
|
||||||
|
return num < 0.0001;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool has_contrary_neighbour(vec2 uv, vec2 texture_pixel_size, sampler2D tex) {
|
bool has_contrary_neighbour(vec2 uv, vec2 texture_pixel_size, sampler2D tex) {
|
||||||
float i = -ceil(width);
|
float i = -ceil(width);
|
||||||
float j = ceil(width);
|
float j = ceil(width);
|
||||||
|
@ -21,7 +26,7 @@ bool has_contrary_neighbour(vec2 uv, vec2 texture_pixel_size, sampler2D tex) {
|
||||||
vec2 xy1 = uv + texture_pixel_size * vec2(x1, y1);
|
vec2 xy1 = uv + texture_pixel_size * vec2(x1, y1);
|
||||||
vec2 xy2 = uv + texture_pixel_size * vec2(x2, y2);
|
vec2 xy2 = uv + texture_pixel_size * vec2(x2, y2);
|
||||||
|
|
||||||
if (xy1 != clamp(xy1, vec2(0.0), vec2(1.0)) || texture(tex, xy1).a == 0.0 || xy2 != clamp(xy2, vec2(0.0), vec2(1.0)) || texture(tex, xy2).a == 0.0) {
|
if (xy1 != clamp(xy1, vec2(0.0), vec2(1.0)) || is_zero_approx(texture(tex, xy1).a) || xy2 != clamp(xy2, vec2(0.0), vec2(1.0)) || is_zero_approx(texture(tex, xy2).a)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue