Microsoft Directx 8.1 (pixel shader version 1.4) |
Loads the destination register with color data (RGBA) sampled using the contents of the source register as texture coordinates. The sampled texture is the texture associated with the destination register number.
texld dest, src
Argument | Description | Registers | Version | |||
---|---|---|---|---|---|---|
vn | cn | tn | rn | |||
dest | Destination register | x | 1.4 | |||
src | Source register | x | 1.4 phase 1 | |||
x | x | 1.4 phase 2 |
When using r(n) as a source register, the first three components (XYZ) must have been initialized in the previous phase of the shader.
To learn more about registers, see Registers.
This instruction samples the texture in the texture stage associated with the destination register number. The texture is sampled using texture coordinate data from the source register.
The syntax for the texld and texcrd instructions expose support for a projective divide with a Texture Register Modifier. For pixel shader version 1.4, the D3DTTFF_PROJECTED texture transform flags is always ignored.
Rules for using texld:
The texld instruction offers some control over which components of the source texture coordinate data are used. The complete set of allowed syntax for texld follows, and includes all valid source register modifiers, selectors, and write mask combinations.
texld r(m), t(n).xyz // Uses xyz from t(n) to sample 1-D, 2-D, or 3-D texture. texld r(m), t(n) // Same as previous. texld r(m), t(n).xyw // Uses xyw (skipping z) from t(n) to sample 1-D, 2-D or 3-D texture. texld r(m), t(n)_dw.xyw // Samples 1-D or 2-D texture at x/w, y/w from t(n). The result // is undefined for a cube-map lookup. texld r(m), r(n).xyz // Samples 1-D, 2-D, or 3-D texture at xyz from r(m). // This is possible in the second phase of the shader. texld r(m), r(n) // Same as previous. texld r(m), r(n)_dz.xyz // Samples 1-D or 2-D texture at x/z, y/z from r(m). // Possible only in second phase. // The result is undefined for a cube-map lookup. texld r(n), r(n)_dz // Same as previous.