tex1Dgrad - HLSL

1D gradient texture lookup.

Syntax

ret tex1Dgrad(s, t, ddx, ddy)

Where:

Name In/Out Template Type Component Type Size
s in object sampler1D 1
t in vector float 1
ddx in vector float 1
ddy in vector float 1
ret out vector float 4

This function samples a texture using the sampler specified by s, the texture coordinate in t, the x gradient in ddx, and the y gradient in ddy. The gradient values select the appropriate mipmap level of the texture for sampling.

When compiling code to ps_3_0, significant code reordering is done to move gradient computations outside of flow control.

Minimum Shader Version

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

Vertex Shader Pixel Shader
n/a ps_2_0

See Also

HLSL Intrinsic Functions