distance - HLSL

Returns the distance between two points x and y.

Syntax

ret distance(x, y)

Where:

Name In/Out Template Type Component Type Size
x in vector float any
y in vector float same dimension(s) as input x
ret out scalar float 1

Minimum Shader Version

This intrinsic function is supported in the following (or above) shader versions:

Vertex Shader Pixel Shader
vs_1_1 ps_2_0

See Also

HLSL Intrinsic Functions