shaders: Use clamp in doubleCircleSigmoid. (#3824)

This commit is contained in:
Dickby 2023-11-11 14:15:37 +01:00 committed by GitHub
parent e44d6de555
commit 7345b1a1ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -205,9 +205,7 @@ const float c = 0.66; // Determines the smoothness of the transition of unboost
// http://www.flong.com/archive/texts/code/shapers_circ/ // http://www.flong.com/archive/texts/code/shapers_circ/
float doubleCircleSigmoid(float x, float a) { float doubleCircleSigmoid(float x, float a) {
float min_param_a = 0.0; a = clamp(a, 0.0, 1.0);
float max_param_a = 1.0;
a = max(min_param_a, min(max_param_a, a));
float y = .0; float y = .0;
if (x <= a) { if (x <= a) {