GLSL 有内置的双线性插值函数吗?

use*_*657 2 opengl interpolation function glsl

这就是我现在正在做的事情。有没有一个built-in函数可以做到这一点?文档很麻烦,我还没有找到类似的东西。

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);
}
Run Code Online (Sandbox Code Playgroud)

有什么帮助吗?

Nic*_*las 5

不,没有内置 GLSL 函数来对值执行 2D 线性插值。你必须自己写。