Microsoft DirectX 8.0 (C++) |
Linearly interpolates between the 2nd and 3rd source registers by a proportion specified in the 1st source register.
lrp tDest, tSrc0, tSrc1, tSrc2
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)