如何使这个代码在Mesa3d上运行?

时间:2011-03-01 20:16:23

标签: opengl glsl mesa

这个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 个答案:

答案 0 :(得分:3)

尝试将1更改为1.0 s。