Hi all, I’ve faced with opengl version problem on macbook pro (mac os x 10.10). When I specify in AppSettings opengl version 3, I have a following error:
Apr 23, 2015 12:37:13 PM com.jme3.system.JmeDesktopSystem initialize
INFO: Running on jMonkeyEngine 3.1.0 (snapshot-github)
* Branch: master
* Git Hash: 38e4580
* Build Date: 2015-04-07
Apr 23, 2015 12:37:14 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: LWJGL 2.9.3 context running on thread jME3 Main
* Graphics Adapter: null
* Driver Version: null
* Scaling Factor: 1
Apr 23, 2015 12:37:14 PM com.jme3.app.Application handleError
SEVERE: Failed to create display
java.lang.NullPointerException
at com.jme3.renderer.opengl.GLRenderer.loadExtensions(GLRenderer.java:142)
at com.jme3.renderer.opengl.GLRenderer.loadCapabilitiesCommon(GLRenderer.java:246)
at com.jme3.renderer.opengl.GLRenderer.loadCapabilities(GLRenderer.java:474)
at com.jme3.renderer.opengl.GLRenderer.initialize(GLRenderer.java:490)
at com.jme3.system.lwjgl.LwjglContext.initContextFirstTime(LwjglContext.java:221)
at com.jme3.system.lwjgl.LwjglContext.internalCreate(LwjglContext.java:266)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:118)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:212)
at java.lang.Thread.run(Thread.java:745)
Apr 23, 2015 12:37:14 PM com.jme3.system.lwjgl.LwjglAbstractDisplay run
SEVERE: Display initialization failed. Cannot continue.
I read a lot of posts and still don’t understand why this problem is happening. Lwjgl library contains necessary attributes for mac os x opengl 3.2 support and specifying opengl 3 version in jme AppSettings should enable opengl core profile support… but
I don’t know what profile jME/LWJGL tries to acquire but OSX only support 3.2 core profile. Maybe some code is asking for a 3.2 compatible profile - which will probably fail on most Macs.
Enabling OpenGL3 support doesn’t actually do much, because jME3 doesn’t use any OpenGL3 features. It just uses OpenGL extensions on top of OpenGL2.
So even though you get an OpenGL 2.1 context from the hardware, you still get many OpenGL3 features.
The reason for this is that many GPUs out there don’t actually support OpenGL3, but they support many of its features via extensions.
I came up to this setting because with opengl 2.1 (by default on mac) I’m not able to compile glsl shaders 1.50 version. For example post processing water doesn’t work with opengl 2.1 =( so if I stay with opengl 2.1 I won’t be able to use shaders 1.50. I don’t want to refuse of mac os x support for my project, though it the simpliest way.
I had a shader compilation error during my jme app startup. It was caused by unsupported shader version (glsl 1.50). I can’t show exact error log here right now, because I left my mac at home.
Even if I will manage to use water filter with 1.20 shader, it still looks like a bug.
There was a bug for quite some time that had to do with technique selection, so it would choose the GLSL 1.5 technique even though it wasn’t supported by the hardware.
Also there was another bug with the GLSL 1.2 version of the shader that caused a visual glitch, this bug was also present in jME 3.0.
Both of those should be fixed in the latest jME 3.1 master.
Not sure how restrictive osx drivers are, but if they follow their strictness, it would at least be required to create and bind a VAO in a 3.2 core profile. Nothing impossible but not supported at current state.
I’ve checked latest build and there is no issue with auto detecting appropriate shader version for water filter =) Is it possible that issue with opengl 3 for mac os x will be fixed?)