texm3x3

DirectX8

Microsoft DirectX 8.1 (pixel shader versions 1.2 and 1.3)

texm3x3

Performs a 3×3 matrix multiply when used in conjunction with two texm3x3pad instructions.

texm3x3 dest, src

Registers

Argument Description RegistersVersion
vn cn tn rn
dest Destination register x 1.2, 1.3
src Source register x 1.2, 1.3

Remarks

This instruction is the same as the texm3x3tex instruction, without the texture lookup.

This instruction is used as the final of three instructions representing a 3×3 matrix multiply operation. The 3×3 matrix is comprised of the texture coordinates of the third texture stage, and by the two preceding texture stages. Any texture assigned to any of the three texture stages is ignored.

This instruction must be used with two texm3x3pad instructions. Texture registers must follow the following sequence.

tex t(n)                 // Define tn as a standard 3-vector (tn must
                         // be defined in some way before it is used).
texm3x3pad t(m),   t(n)  // where m > n
                         // Perform first row of matrix multiply.
texm3x3pad t(m+1), t(n)  // Perform second row of matrix multiply.
texm3x3    t(m+2), t(n)  // Perform third row of matrix multiply to get a
                         // 3-vector result.

Here is more detail about how the 3×3 multiply is accomplished.

// The first texm3x3pad instruction performs the first row of the multiply 
// to find u'.
u' = TextureCoordinates(stage m)UVW • t(n)RGB   

// The second texm3x3pad instruction performs the second row of the multiply 
// to find v'.
v' = TextureCoordinates(stage m+1)UVW • t(n)RGB   

// The texm3x3tex instruction performs the third row of the multiply
// to find w'.
w' = TextureCoordinates(stage m+2)UVW • t(n)RGB 

// Place the result of the matrix multiply in the destination register.
t(m+2)RGBA = (u', v', w', 1)