此 GLSL 代码在 ATI 的 OpenGL 中无警告地编译和运行:
void main()
{
vec4 tmp = gl_ModelViewMatrix * gl_Vertex;
tmp.xyz = tmp.xyz / (1 - tmp.w);
tmp.w = 1;
gl_Position = gl_ProjectionMatrix * tmp;
gl_FrontColor = gl_Color;
}
为什么它会因台面而失败?如何解密该错误消息并使其与 Mesa 的实现兼容?
Compilation log:
0:1(88): error: Could not implicitly convert operands to arithmetic operator
0:1(89): error: Operands to arithmetic operators must be numeric
0:1(97): error: type mismatch
最佳答案
尝试将您的 1
更改为 1.0
。
关于opengl - 如何使这段代码在 Mesa3d 上工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5159817/