zed

03-28-2005, 12:44 PM

whats the standard graphics way of describing a lerp?

texenvcombine uses a*X + b*(1-X) but both glsl and cg use a*(1-X) + b*X

ARB_texture_env_combine INTERPOLATE_ARB

Arg0 * (Arg2) + Arg1 * (1-Arg2)

-------------------------------

glsl genType mix (genType x,genType y,genType a)

Returns x * (1 – a) + y * a

-------------------------------

cg lerp(a,b,f)

(1-f)*a + b*f

ps/ why has the glsl spec got 1 – a there that should be 1.0 - a, tsk tsk, naughty boys :)

texenvcombine uses a*X + b*(1-X) but both glsl and cg use a*(1-X) + b*X

ARB_texture_env_combine INTERPOLATE_ARB

Arg0 * (Arg2) + Arg1 * (1-Arg2)

-------------------------------

glsl genType mix (genType x,genType y,genType a)

Returns x * (1 – a) + y * a

-------------------------------

cg lerp(a,b,f)

(1-f)*a + b*f

ps/ why has the glsl spec got 1 – a there that should be 1.0 - a, tsk tsk, naughty boys :)