PBR examples do not work on OSX

To get any examples to work, I had to modify the build.gradle of the jme3-examples module to remove the headless argument and the rest. It doesn’t seem to be needed:

After fixing that, when trying to run the PBR examples, I get this exception:

RendererException: compile error in: ShaderSource[name=Common/MatDefs/Light/PBRLighting.frag, defines, type=Fragment, language=GLSL110]
ERROR: 0:197: GLSL 110 does not allow sub- or super-matrix constructors
ERROR: 0:198: Use of undeclared identifier 'wToLocalRot'
ERROR: 0:198: Use of undeclared identifier 'wToLocalRot'
ERROR: 0:211: Use of undeclared identifier 'wToLocalRot'
ERROR: 0:212: Use of undeclared identifier 'rayLs'
ERROR: 0:215: Use of undeclared identifier 'wToLocalRot'
ERROR: 0:219: Use of undeclared identifier 'rayLs'
ERROR: 0:220: Use of undeclared identifier 'rayLs'
ERROR: 0:221: Use of undeclared identifier 'firstPlaneIntersect'
ERROR: 0:221: Use of undeclared identifier 'secondPlaneIntersect'
ERROR: 0:222: Use of undeclared identifier 'furthestPlane'
ERROR: 0:222: Use of undeclared identifier 'furthestPlane'
ERROR: 0:222: Use of undeclared identifier 'furthestPlane'
ERROR: 0:224: Attempt to use 'distance' as a variable
ERROR: 0:225: Use of undeclared identifier 'intersectPositionWs'

The other examples seem to work. Is this a known issue?

I’m using Oracle Java 1.8.0_162, running on MacOS High Sierra V 10.13.6

I posted this as an issue on github as well: PBR examples do not work on OSX · Issue #903 · jMonkeyEngine/jmonkeyengine · GitHub

The other examples I tried seem to work.

There was a little typo that prevents PBR from compiling the good thing it’s fixed now. the bad thing you need to wait for the next version of jme to use PBR or use the master branch for now

I am using the latest from master that I compiled myself. This is not fixed.

This actually works fine on Linux.

Ah, it seems that on Mac laptops I’ve tried, the gl string is always something that starts with 2.1, e.g., “2.1 ATI-1.68.20”. So, maybe this is another issue entirely. They are supposed to support 4.1.

OSX supports 4.1 Core profile or 2.1 compatibility profile. I had some struggles with that in the past and never really got it to work in jME (but this was years ago). I’ve also have had to switch to the JOGL renderer to avoid various LWJGL issues on OSX so maybe try that and see if it requests a core profile.

If you set the opengl version with AppSettings.setRenderer it will use core profile, eg for opengl 3.2

        AppSettings settings=new AppSettings(true);
        settings.setRenderer(AppSettings.LWJGL_OPENGL3);        
        app.setSettings(settings);

So what happens if someone has a 2.1 compatible card only in that case? Does it crash?

Thanks for your suggestion. This worked when I forced the renderer.

Yes, you can check the capabilities to see if the version is supported.
The compatibility profile is implementation dependant, so it can be outdated or incomplete for some drivers.