1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Merge pull request #105837 from clayjohn/sky-acos-bugfix

Fix float/int comparison in acos_approx in sky template shader
This commit is contained in:
Thaddeus Crews
2025-04-28 10:01:34 -05:00
2 changed files with 2 additions and 2 deletions

View File

@@ -157,7 +157,7 @@ float acos_approx(float p_x) {
float x = abs(p_x);
float res = -0.156583f * x + (M_PI / 2.0);
res *= sqrt(1.0f - x);
return (p_x >= 0) ? res : M_PI - res;
return (p_x >= 0.0) ? res : M_PI - res;
}
// Based on https://math.stackexchange.com/questions/1098487/atan2-faster-approximation

View File

@@ -193,7 +193,7 @@ float acos_approx(float p_x) {
float x = abs(p_x);
float res = -0.156583f * x + (M_PI / 2.0);
res *= sqrt(1.0f - x);
return (p_x >= 0) ? res : M_PI - res;
return (p_x >= 0.0) ? res : M_PI - res;
}
// Based on https://math.stackexchange.com/questions/1098487/atan2-faster-approximation