FastMassSpring icon indicating copy to clipboard operation
FastMassSpring copied to clipboard

MacOS OpenGL version 430 not supported.

Open kevinmore opened this issue 5 years ago • 10 comments

Hi, is there any way to resolve this issue?

kevinmore avatar Sep 25 '20 14:09 kevinmore

Hi, could you try changing the version to 330 in all the shader files?

#version 330

sam007961 avatar Sep 25 '20 15:09 sam007961

Tried, but no luck. And also GLUT on MacOS seems impossible to set OpenGL context profile version.

kevinmore avatar Sep 25 '20 15:09 kevinmore

I'll have to look into. Could you share the error that your getting?

sam007961 avatar Sep 25 '20 16:09 sam007961

It's shader compiling error. I know that I can write an alternative shader for it, but it'll be great if you can look into it.

ERROR: 0:1: '' : version '330' is not supported ERROR: 0:1: '' : syntax error: #version ERROR: 0:7: 'layout' : syntax error: syntax error

kevinmore avatar Sep 25 '20 16:09 kevinmore

You are right, GLUT is the issue here. It seems that GLUT uses X11 which does not support OpenGL > 2.1 on OS X. I would need to either migrate the project to GLFW or rewrite the shaders for 2.1.

I think its probably best migrate to GLFW for the long term so I've create this issue #6 , but as a short term solution I'll try to rewrite the shaders for OS X.

sam007961 avatar Sep 25 '20 17:09 sam007961

I've added a temporary fix for OSX in this branch osx-fix. Let me know if it works out.

sam007961 avatar Sep 25 '20 17:09 sam007961

I think for phong.fshader and pick.fshader, we need to change in to varying.

I also changed a bit of the shader compiling function, because my compiler won't compile otherwise.

GLint len = std::strlen(source); glShaderSource(handle, 1, ptrs, &len);

But after doing so, I'm still having issues at runtime. The app just crashes, with error message

ERROR: 0:21: '<' : syntax error: syntax error Exception caught: Failed to compile shader.

kevinmore avatar Sep 25 '20 18:09 kevinmore

That's strange. Alright, I'll have to setup my mac to investigate this issue on it.

sam007961 avatar Sep 25 '20 18:09 sam007961