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

tex2D - HLSL


There are two overloaded tex2D texture lookup functions:

2-D texture lookup

This function performs a 2-D texture lookup.

Syntax

ret tex2D(s, t)

Where:

NameIn/OutTemplate TypeComponent TypeSize
sinobjectsampler2D1
tinvectorfloat2
retoutvectorfloat4

Minimum Shader Version

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

Vertex ShaderPixel Shader
n/aps_1_1

2-D texture lookup with partial derivatives

This function performas a 2-D texture lookup also, but also uses the partial derivatives to help pick the level of detail (LOD).

Syntax

ret tex2D(s, t, ddx, ddy)

Where:

NameIn/OutTemplate TypeComponent TypeSize
sinobjectsampler2D1
tinvectorfloat2
ddxinvectorfloat2
ddyinvectorfloat2
retoutvectorfloat4

Minimum Shader Version

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

Vertex ShaderPixel Shader
n/aps_2_0


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