16 if (gradient_type == 0) {
19 if (gradient_type == 1) {
20 float r =
max(
x, 0.0f);
23 if (gradient_type == 2) {
24 float r =
min(
max(
x, 0.0f), 1.0f);
26 return (3.0f * t - 2.0f * t * r);
28 if (gradient_type == 3) {
29 return (
x +
y) * 0.5f;
31 if (gradient_type == 4) {
38 if (gradient_type == 5) {
41 if (gradient_type == 6) {
51 f =
clamp(f, 0.0f, 1.0f);
53 color =
float4(f, f, f, 1.0f);
SIMD_FORCE_INLINE const btScalar & z() const
Return the z value.
constexpr T clamp(T, U, U) RET
void node_tex_gradient(float3 co, float gradient_type, float4 &color, float &fac)
float calc_gradient(float3 p, int gradient_type)