1
0
forked from Rowland/EG
EG/Cesium-1.132/packages/engine/Source/Shaders/Builtin/Functions/maximumComponent.glsl
2025-08-25 17:48:13 +08:00

22 lines
432 B
GLSL

/**
* Find the maximum component of a vector.
*
* @name czm_maximumComponent
* @glslFunction
*
* @param {vec2|vec3|vec4} v The input vector.
* @returns {float} The value of the largest component.
*/
float czm_maximumComponent(vec2 v)
{
return max(v.x, v.y);
}
float czm_maximumComponent(vec3 v)
{
return max(max(v.x, v.y), v.z);
}
float czm_maximumComponent(vec4 v)
{
return max(max(max(v.x, v.y), v.z), v.w);
}