Microsoft DirectX 8.0 (C++)

texm3x3vspec

Performs specular reflection and environment mapping where the eye-vector is not constant.

texm3x3vspec   tDest, tSrc0

Registers

tDest
Destination register, holding the result of the operation.
tSrc0
Source register, specifying the input argument.

Remarks

This instruction is used for texture addressing. It works just as texm3x3spec, except that the eye-ray is taken from the w-components of the three sets of texture coordinates used as rows of the matrix.

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.
texm3x3vspec t3, t0  ; Perform third row of matrix multiply, sample
                     ; texture 2, do reflection calculation
                     ; using eye ray, and sample texture 3
                     ; specular map.
mov r0.rgb, t3       ; Put specular color into the result.
mov r0.a,   t3       ; Put diffuse color into the alpha channel.

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.

See Also

texm3x3spec