You've already forked godot
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user