--- layout: stdlib-reference --- # EvaluateAttributeAtCentroid ## Description Interpolates vertex attribute at centroid position. ## Signature
T EvaluateAttributeAtCentroid<T>(T x)
where T : __BuiltinArithmeticType;
vector<T, N> EvaluateAttributeAtCentroid<T, N:int>(vector<T, N> x)
where T : __BuiltinArithmeticType;
matrix<T, N, M> EvaluateAttributeAtCentroid<T, N:int, M:int>(
matrix<T, N, M> x)
where T : __BuiltinArithmeticType;
## Generic Parameters
#### T: [\_\_BuiltinArithmeticType](../interfaces/0_builtinarithmetictype-029j/index.html)
#### N : int
#### M : int
## Parameters
#### x : [T](evaluateattributeatcentroid-08hj.html#typeparam-T)
The vertex attribute to interpolate.
#### x : [vector](../types/vector/index.html)\<[T](../types/vector/index.html#typeparam-T), [N](../types/vector/index.html#decl-N)\>
The vertex attribute to interpolate.
#### x : [matrix](../types/matrix/index.html)\<[T](../types/matrix/t-0.html), [N](../types/matrix/index.html#decl-N), [M](../types/matrix/index.html#decl-M)\>
The vertex attribute to interpolate.
## Return value
The interpolated attribute value.
## Remarks
x must be a direct reference to a fragment shader varying input.
## Availability and Requirements
Defined for the following targets:
#### hlsl
Available in stages: `amplification`, `fragment`, `compute`, `mesh`, `miss`, `callable`, `closesthit`, `raygen`, `intersection`, `anyhit`.
#### glsl
Available in stages: `amplification`, `fragment`, `compute`, `mesh`, `miss`, `callable`, `closesthit`, `raygen`, `intersection`, `anyhit`.
#### spirv
Available in stages: `amplification`, `fragment`, `compute`, `mesh`, `miss`, `callable`, `closesthit`, `raygen`, `intersection`, `anyhit`.
Requires capabilities: `SPV_KHR_compute_shader_derivatives`, `spvMeshShadingEXT`.