2

This is what I am doing now. Is there a built-in function that does this? The documentation is cumbersome and I haven't found something like that.

vec4 biLerp(vec4 a, vec4 b, vec4 c, vec4 d, float s, float t)
{
  vec4 x = mix(a, b, t);
  vec4 y = mix(c, d, t);
  return mix(x, y, s);
}

Any help?

CandleCoder
  • 1,387
  • 4
  • 21
  • 45
user1146657
  • 194
  • 3
  • 15

1 Answers1

5

No, there is no built-in GLSL function to perform 2D linear interpolation on values. You have to write it yourself.

Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982