abs
all
any
cos
ddx
ddy
dot
dst
exp
fma
lit
log
mad
max
min
mul
pow
rcp
sin
tan
Expand Minimize

step

Compares two values, returning 0 or 1 based on which value is greater.

ret step(y, x)

 

Parameters

ItemDescription

y

[in] The first floating-point value to compare.

x

[in] The second floating-point value to compare.

 

Return Value

1 if the x parameter is greater than or equal to the y parameter; otherwise, 0.

Remarks

This function uses the following formula: (x >= y) ? 1 : 0. The function returns either 0 or 1 depending on whether the x parameter is greater than the y parameter. To compute a smooth interpolation between 0 and 1, use the smoothstep HLSL intrinsic function.

Type Description

Name Template Type Component Type Size
yscalar, vector, or matrix float any
xsame as input y float same dimension(s) as input y
retsame as input y float same dimension(s) as input y

 

Minimum Shader Model

This function is supported in the following shader models.

Shader ModelSupported
Shader Model 2 (DirectX HLSL) and higher shader modelsyes
Shader Model 1 (DirectX HLSL) yes (vs_1_1 and ps_1_4)

 

See also

Intrinsic Functions (DirectX HLSL)

 

 

Community Additions

ADD
Show:
© 2014 Microsoft