Skip to content

Commit

Permalink
[orx-fx] Fix pixel-direction.frag
Browse files Browse the repository at this point in the history
  • Loading branch information
edwinRNDR committed Jul 8, 2024
1 parent 9bdf83b commit f077a56
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions orx-jumpflood/src/shaders/glsl/pixel-direction.frag
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ void main() {
pixelDistance *= vec2(1.0, -1.0);
}

float length = length(pixelDistance);
float length_ = length(pixelDistance);
if (unitDirection) {
if (length >= 1E-6) {
pixelDistance /= length;
if (length_ >= 1E-6) {
pixelDistance /= length_;
}
}

Expand All @@ -61,7 +61,7 @@ void main() {
if (signedMagnitude) {
float s = -sign(o_color.b - 0.5);
o_color.rg *= s;
o_color.b = s * length;
o_color.b = s * length_;
}
}
}

0 comments on commit f077a56

Please sign in to comment.