?/TD>
Microsoft DirectX 9.0

tex (Pixel Shader)


Loads the destination register with color data (RGBA) sampled from a texture.

The texture must be bound to a particular texture stage (n) using IDirect3DDevice9::SetTexture. Texture sampling is controlled by IDirect3DDevice9::SetSamplerState.

Syntax

tex (Pixel Shader) dest

Registers

dest
Destination register.

Remarks

Pixel shader versions1_11_21_31_42_02_x2_sw3_03_sw
texxxxx

The destination register number specifies the texture stage number.

Texture sampling uses texture coordinates to look up, or sample, a color value at the specified (u,v,w,q) coordinates while taking into account the texture stage state attributes.

The texture coordinate data is interpolated from the vertex texture coordinate data and is associated with a specific texture stage. The default association is a one-to-one mapping between texture stage number and texture coordinate declaration order. This means that the first set of texture coordinates defined in the vertex format are by default associated with texture stage 0.

Texture coordinates may be associated with any stage using two techniques. When using a fixed function vertex shader or the fixed function pipeline, the texture stage state flag TSS_TEXCOORDINDEX can be used in IDirect3DDevice9::SetTextureStageState to associate coordinates to a stage. Otherwise, the texture coordinates are output by the vertex shader oTn registers when using a programmable vertex shader.

Instruction Information

Minimum operating systems Windows 98


© 2002 Microsoft Corporation. All rights reserved.