tex2Dgrad - HLSL
Microsoft DirectX 9.0 SDK Update (October 2004)

tex2Dgrad - HLSL


2-D gradient texture lookup.

Syntax

ret tex2Dgrad(s, t, ddx, ddy)

Where:

NameIn/OutTemplate TypeComponent TypeSize
sinobjectsampler1D1
tinvectorfloat2
ddxinvectorfloat2
ddyinvectorfloat2
retoutvectorfloat4

This function samples a texture using the sampler specified by s, the texture coordinates 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 ShaderPixel Shader
n/aps_2_0 *

* - If the D3DPS20CAPS cap is set with D3DPS20CAPS_GRADIENTINSTRUCTIONS, the compiler maps this statement to texldd.



© 2004 Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center.