skybox: taller grad window, smooth grad clamping

This commit is contained in:
minjaesong
2023-07-30 03:29:14 +09:00
parent 439cde09fc
commit 33a8112454
4 changed files with 46 additions and 8 deletions

View File

@@ -166,6 +166,19 @@ final public class FastMath {
return ((1f - scale) * startValue) + (scale * endValue);
}
public static double interpolateLinear(double scale, double startValue, double endValue) {
if (startValue == endValue) {
return startValue;
}
if (scale <= 0.0) {
return startValue;
}
if (scale >= 1.0) {
return endValue;
}
return ((1.0 - scale) * startValue) + (scale * endValue);
}
/**
* Linear interpolation from startValue to endValue by the given percent.
* Basically: ((1 - percent) * startValue) + (percent * endValue)