Shadow maybe failed in GLES2 and AppSetting failed to choose GL version

Well I may need to explain this clearly.
GL : openGL destoop
GLES: openGL android
GLSL : shader

First issue , for android system:
Android app acts differently. As described shadow system act strangely when set Android Emulator to GLES2.0. Haven’t figure out the reason yet.
During the investigation I need to run JME3 on desktop GL2.0 (and expect GLSL200 used ) to learn how j3md behaves in GLSL200. This leads to the second issue.

Second issue , for desktop:
By investigating the First issue, I discovered a second issue : AppSetting.setRenderer has bugs. Engine failed when set to GL version below 3.2.
Luckily, I may have found a solution as posted.

Third issue , for desktop:
Even with or without issue 2 solved.
what we expect:
GL set to 3.2 , GLSL works on 320 310 … …, and j3md use GLSL320 to compile
What we actually got:
GL set to 3.2, GLSL works on 450 440 … …, and j3md use GLSL450 to compile
The actual GLSL version used is always the highest.
This maybe a feature of GLFW: see this

for reference:
OpenGL Version and associated GLSL Version
2.0 110
2.1 120
3.0 130
3.1 140
3.2 150
3.3 330
4.0 400
4.1 410
4.2 420
4.3 430

OpenGL ES Version and associated GLSL ES Version
2.0 100
3.0 300
3.1 310
3.2 320

1 Like