Microsoft DirectX 8.0 (Visual Basic)

lrp

Linearly interpolates between the 2nd and 3rd source registers by a proportion specified in the 1st source register.

lrp   tDest, tSrc0, tSrc1, tSrc2

Registers

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

Remarks

This instruction performs the linear interpolation based on the following formula.

tSrc0 * tSrc1 + (1-tSrc0) * tSrc2 = tSrc2 + tSrc0 * (tSrc1 - tSrc2)

The following example shows how this instruction might be used.

lrp d, s0, s1, s2    ; d = s0*s1 + (1-s0)*s2 = s2 + s0*(s1-s2)