Export (0) Print
Expand All
abs
all
any
cos
ddx
ddy
dot
dst
exp
fma
lit
log
mad
max
min
mul
pow
rcp
sin
tan
Expand Minimize
2 out of 8 rated this helpful - Rate this topic

ddx

Returns the partial derivative of the specified value with respect to the screen-space x-coordinate.

ret ddx(x)

 

This function computes the partial derivative with respect to the screen-space x-coordinate. To compute the partial derivative with respect to the screen-space y-coordinate, use the ddy function.

This function is only supported in pixel shaders.

Parameters

ItemDescription

x

[in] The specified value.

 

Return Value

The partial derivative of the x parameter.

Type Description

Name Template Type Component Type Size
xscalar, vector, or matrix float any
retsame as input x float same dimension(s) as input x

 

Minimum Shader Model

This function is supported in the following shader models.

Shader ModelSupported
Shader Model 5 and higher shader modelsyes
Shader Model 4 yes
Shader Model 3 (DirectX HLSL) yes
Shader Model 2 (DirectX HLSL) yes in ps_2_x; unsupported in ps_2_0.
Shader Model 1 (DirectX HLSL) no

 

This function is supported in the following types of shaders:

VertexHullDomainGeometryPixelCompute
x

 

See also

Intrinsic Functions (DirectX HLSL)

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.