5#include <Common/assertion.h>
6#include <Common/primitive_type.h>
18 const real clampedAlpha =
math::clamp(alpha, 0.0_r, 0.9999_r);
19 const real alpha1p1 = std::pow(clampedAlpha, 1.1_r);
20 return alpha1p1 / (1.0_r - alpha1p1);
25 return std::pow(variance / (1.0_r + variance), 1.0_r / 1.1_r);
30 PH_ASSERT(0.0_r < g && g <= 1.0_r);
32 return std::pow((1.0_r - g) / g, 0.8_r) / (1.0_r + g);
Miscellaneous math utilities.
real variance_to_alpha(const real variance)
Definition conversions.h:23
real alpha_to_variance(const real alpha)
Definition conversions.h:16
real g_to_variance(const real g)
Definition conversions.h:28
T clamp(const T value, const T lowerBound, const T upperBound)
Clamps a value to [lowerBound, upperBound]. None of value, lowerBound and upperBound can be NaN,...
Definition math.h:77
The root for all renderer implementations.
Definition EEngineProject.h:6