更新时间:2023-01-28 08:59:04
您清楚地了解,GL将要执行的三角插值并不是您想要的. 因此普通数据不能直接来自顶点数据.
As you clearly understands, the triangle interpolation that GL will do is not what you want. So the normal data can't be coming directly from the vertex data.
恐怕您正在设想的解决方案是您可以实现的***解决方案.而且无论您选择什么,都需要将[0..1]系数从顶点传递到着色器(包括2x2纹理.您需要它们作为纹理坐标).
I'm afraid the solutions you're envisioning are about the best you can achieve. And no matter what you pick, you'll need to pass down [0..1] coefficients from the vertex to the shader (including 2x2 textures. You need them for texture coordinates).
不过,您可以采取一些技巧来简化流程.
There are some tricks you can do to somewhat simplify the process, though.