Microsoft DirectX 8.0 (C++)

texm3x3tex

Returns the result of the final 3×3 matrix multiply.

texm3x3tex   tDest, tSrc0
tDest
Destination register, holding the result of the operation.
tSrc0
Temporary source register, specifying the input argument.

Remarks

The texm3x3tex instruction is used as the final of three instructions representing a 3×3 matrix multiply operation performed in a pixel shader's texture declaration. The result of this instruction will contain the resulting transformed vector. The input argument to this declaration should be the input to the matrix multiply. Texture coordinates assigned to this stage are used as a row of the matrix.

The 3×3 matrix is comprised of the texture coordinates of this and the two preceding stages. The resulting three-component-vector is then used to index into the texture assigned at this stage, (which can be either a cube texture or a volume texture) to produce the final color. No texture colors are sampled from the preceding two stages, and any operator assigned to them is overridden by this one.

tex t0             ; Define t0 as a standard 3-vector.
texm3x3pad t1, t0  ; Perform first row of matrix multiply.
texm3x3pad t2, t0  ; Perform second row of matrix multiply.
texm3x3tex t3, t0  ; Perform third row of matrix multiply.

dp3 r0, t0, v0     ; Compute lighting intensity for diffuse
                   ; using v0.

A bump (normal) map should be set on stage 0, and cube texture should be set on stage 3. Any textures set at stages 1 or 2 are ignored.

Texture coordinate set 0 positions the bump map. Texture coordinate sets 1, 2, and 3 are the rows of the 3×3 matrix.

Note that this instruction has an unnamed input which is the assigned texture that corresponds to this texture stage.