DMath.max(a,b);
a - { Scalar or vector } b - { Scalar or vector}
Returns the maximum of two same-typed scalars a and b or the respective components of two same-typed vectors a and b. The result is a three-component vector.
max implementation for a float3 vector.
float3 max(float3 a, float3 b)
{
return float3(a.x > b.x ? a.x : b.x,
a.y > b.y ? a.y : b.y,
a.z > b.z ? a.z : b.z);
}max is sometimes recognized as a compiler built-in code in certain graphic compilers.
When the compiler encounters a call to a built-in function, it can choose to generate inline code to perform the operation instead of a function call, which can lead to more efficient code.