?/TD>
Microsoft DirectX 9.0

Texture Coordinates Register


This vertex shader output register contains per-vertex texture coordinates.

Syntax

Texture Coordinates Register 

Remarks

A register consists of properties that determine how each register behaves.

PropertyDescription
NameoT0 - oT7
CountEight vectors
I/O permissionsWrite-only

The output texture coordinates registers are an array of output data registers. The register data is iterated and used as texture coordinates by the texture sampling stages to supply data to the pixel shader.

Vertex shader versions1_12_02_sw2_x3_03_sw
Texture Coordinate Registerxxxxx

When writing to a texture coordinate register, it is recommended that you pass only as many floating point values as the dimension of the corresponding texture map. Control the values that are passed with a modifier. For example, use .xy for a two-dimensional texture map.

When texture projection is enabled for a texture stage, all four floating point values must be written to the corresponding texture register.

Any of the D3DTTFF* D3DTEXTURETRANSFORMFLAGS should be zero when the programmable pipeline is being used.

Texture Coordinate Range

Object vertex data supplies input texture coordinates. Objects that do not used tiled textures commonly have texture coordinates in the range [0,1]. Objects that use tiled textures, such as terrain, typically have texture coordinates that range from [-?,+?] where the question mark (?) can be a large floating point number.

Texture coordinate interpolation is performed on vertex data for rasterization. During rasterization, texture coordinates are interpolated between object vertices, modified by texture wrapping, and scaled by the texture size (also taking into account texture addressing modes) to produce an integer index. The index is then used to perform a texture lookup. Use the MaxTextureRepeat value in D3DCAPS9 to determine how many times a texture can be tiled.

If texture coordinates are read directly into a pixel shader (using texcoord or texcrd), the texture coordinate range depends on the instruction and the pixel shader version.

Example

Declare the texture coordinate register.

dcl_texcoord v7

Copy the per-vertex texture coordinates to the output register.

mov oT0,  v7

For a more complete code sample, see the Vertex Blend Sample.

Instruction Information

Minimum operating systemWindows 98


© 2002 Microsoft Corporation. All rights reserved.