How to make this code work on Mesa3d?

This GLSL code compiles and runs without warning in 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;
}

Why is this happening with mesa? How to decrypt this error message and make it compatible with 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
+3
source share
1 answer

Try changing 1to 1.0s.

+3
source

Source: https://habr.com/ru/post/1795591/


All Articles