Microsoft DirectX 8.0 (C++) |
Performs specular reflection and environment mapping.
texm3x3spec tDest, tSrc0, tSrc1
This operation takes the resulting post-transformed vector, and uses it as the normal to reflect an eye-ray vector. This eye-ray vector is always the constant color c0. Then, the instruction uses the result as an address to look up in a cube texture set at that stage. A specular environment map would be preloaded.
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. texm3x3spec t3, t0, c0 ; Perform third row of matrix multiply, do ; reflection calculation, and sample texture 3. mov r0, t3 ; Copy final result to output color.
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.