Performs smooth (cubic Hermite) interpolation between 0 and 1.
| 472 | |
| 473 | // Performs smooth (cubic Hermite) interpolation between 0 and 1. |
| 474 | static float SmoothStep(float amount) |
| 475 | { |
| 476 | return amount <= 0 ? 0 : amount >= 1 ? 1 : amount * amount * (3 - 2 * amount); |
| 477 | } |
| 478 | |
| 479 | // Performs a smooth(er) interpolation between 0 and 1 with 1st and 2nd order derivatives of zero at endpoints. |
| 480 | static float SmootherStep(float amount) |
no outgoing calls
no test coverage detected