mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Fix float/int comparison in acos_approx in sky template shader
Strict GLSL implementations will not automatically convert `0` to a float
This commit is contained in:
parent
e37c6261ea
commit
d2dce41681
2 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue