Linear Interpolation

It would commonly take in 3 scaler or 2 vector and a scaler, and return the result of the formula

x + s(y-x).


I often find this function useful for cheap generation of points along a relatively straight line. It is also very useful to calculate the display of health/power/magic bar, eg

healthBarLength = lerp(healthBarStart, healthBarMaxLength, %healthLeft)

In UI it is a very good helper function to convert relative screencoord to absolute screencoord


It is frequently used for alpha blending, blending of normal maps, terrain splatting. I like to use it for signal scaling,

eg getting value max(0, NdotL) / max(0, NdotV) to scale to some other values for various effects.