?/TD> |
Microsoft DirectX 9.0 |
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.
Property Description Name oT0 - oT7 Count Eight vectors I/O permissions Write-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 versions 1_1 2_0 2_sw 2_x 3_0 3_sw Texture Coordinate Register x x x x x 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 RangeObject 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 v7Copy the per-vertex texture coordinates to the output register.
mov oT0, v7For a more complete code sample, see the Vertex Blend Sample.
Instruction Information
Minimum operating system Windows 98