Microsoft DirectX 8.0 (Visual Basic) |
Takes the color sampled by the preceding stage as DuDvL perturbation data with luminance information.
texbeml tDest, tSrc0
The texbeml instruction transforms the color's red and green components by the 2-D bump environment mapping matrix, adds the components to the current stage's texture coordinates, and samples this texture at the resulting 2-D address. Then it applies a luminance correction using the luminance value (L), and the Microsoft® Direct3D® API-specified luminance and bias texture stage values.
The following pixel shader defines the color in the destination register as the color taken from the texture map set at stage 1, indexed by an address perturbed by the values of the red and green channels, and sampled from the map set on stage 0.
tex t0 ; Define t0 to get a 3-tuple DuDvL. texbeml t1, t0 ; Compute u = u1 + mat00*r0.r + mat01*r0.g, and ; v = v1 + mat10*r0.r + mat11*r0.g. ; Then apply luminance correction. mov r0, t1 ; Copy final result to output color.
The texture is set at the second stage, the texture set on the first stage is ignored.
This operation is a macro of two instructions (consuming 2 stages/slots): u' = u + du*M00 + dv*M01 and v' = v + du*M10 + dv*M11 where M00, M01, M10, and M11 are D3DTSS_BUMPENVMAT00, D3DTSS_BUMPENVMAT01, D3DTSS_BUMPENVMAT10, and D3DTSS_BUMPENVMAT11.
Note that this instruction has an unnamed input which is the assigned texture that corresponds to this texture stage.