[SOLVED] Exception when migrating to JME 3.3

Hello Guys,
I’m getting this exception after migrating from 3.2 to 3.3:

Uncaught exception thrown in Thread[jME3 Main,6,main] RendererException: compile error in: ShaderSource[name=Common/MatDefs/Light/PBRLighting.frag, defines, type=Fragment, language=GLSL110] ERROR: 0:203: 'constructor' : constructing matrix from matrix (reserved in GLSL 1.10) WARNING: 0:204: 'inverse' : function not available in current GLSL version - trying implict argument conversion ERROR: 0:204: 'inverse' : no matching overloaded function found - implicit conversion not allowed ERROR: 0:204: 'assign' : cannot convert from 'const float' to '3X3 matrix of float'

1 Like

Using macOS on JME 3.3.0-stable, I presume?

The exception looks a bit like issue 1304.

Hi Stephen,
I’m using Windows 10 on a HP ProBook 4330s with Intel HD Graphics 3000 video card

1 Like

And 3.3.0-stable?

Yes 3.3.0-stable

If it’s 1304, it should be fixed in the latest master and v3.3 branches. As a test, could you build your own JME libraries from source?

Sure! I’ll do that and report if it fixed the problem
Thanks

I compiled the sources and while a lot of tests are crashing, the basic tests are working.
So which jar should I replace in order to fix my original issue?

I believe the PBR fixes are all in jme3-core.

1 Like

Thanks Stephen. This solved my problem but now I’m facing another issue with the new code:

Uncaught exception thrown in Thread[jME3 Main,6,main]
RendererException: compile error in: ShaderSource[name=Common/MatDefs/Light/PBRLighting.frag, defines, type=Fragment, language=GLSL110]
ERROR: 0:203: ‘constructor’ : constructing matrix from matrix (reserved in GLSL 1.10)
WARNING: 0:204: ‘inverse’ : function not available in current GLSL version - trying implict argument conversion
ERROR: 0:204: ‘inverse’ : no matching overloaded function found - implicit conversion not allowed
ERROR: 0:204: ‘assign’ : cannot convert from ‘const float’ to ‘3X3 matrix of float’

I think it happened tpo some time in the past and someone here helped me fixing a shader’s code but i’m not sure…
What do you think?

I’ll try locating the shader’s fix and report back if it solved the problem…

I think you’ve exceeded the limits of my shader expertise :wink:

I hope someone more knowledgable will follow up with you.

@RiccardoBlb maybe?

1 Like

RiccardoBlb did helped with in the past with a similar problem:

But I don’t have the knowledge to apply the fix in this shader

can you post the shader dump? So we see what line is 203 and 204.

The inverse define is added in the GLSLCompat.gsllib.

1 Like

You mean the lines 203-204 from PBRLighting.frag ?

vec4 specularColor = (nonMetalSpec - nonMetalSpec * Metallic) + albedo * Metallic;
vec4 diffuseColor = albedo - albedo * Metallic;

No, the lines 203 and 204 in the error dump / stacktrace.
Shaders have import statements, are manipulated in code etc. The final shader program that is send to the gpu is a concatenation of all of this.

When a shader fails to compile, jme dumps the complete shader that is send to the gpu. You will see that line 203, 204 (where the error is thrown) are not lines 203 and 204 in the PBRLighting.frag file.

Thats the same error Message, so the Shader wasnt updated at all

So,… wasn’t this fixed in Fixing PBR on <= GLSL 130: by MeFisto94 · Pull Request #1321 · jMonkeyEngine/jmonkeyengine · GitHub ?

Workaround is to set a 3+ coreprofile if the drivers support it.

1 Like

It looks like it was meged to master 18 days ago…
After compiling the sources which jar includes these fixes?