diff --git a/jme3-core/src/main/resources/Common/ShaderLib/GLSLCompat.glsllib b/jme3-core/src/main/resources/Common/ShaderLib/GLSLCompat.glsllib index c8eddf308..180559562 100644 --- a/jme3-core/src/main/resources/Common/ShaderLib/GLSLCompat.glsllib +++ b/jme3-core/src/main/resources/Common/ShaderLib/GLSLCompat.glsllib @@ -43,9 +43,11 @@ out vec4 outFragColor; #endif #if __VERSION__ == 110 -mat3 mat3(mat4 m) { +mat3 mat3_sub(mat4 m) { return mat3(m[0].xyz, m[1].xyz, m[2].xyz); } +#else + #define mat3_sub mat3 #endif #if __VERSION__ <= 140 diff --git a/jme3-core/src/main/resources/Common/ShaderLib/PBR.glsllib b/jme3-core/src/main/resources/Common/ShaderLib/PBR.glsllib index bf23d547d..d27c0222f 100644 --- a/jme3-core/src/main/resources/Common/ShaderLib/PBR.glsllib +++ b/jme3-core/src/main/resources/Common/ShaderLib/PBR.glsllib @@ -143,7 +143,8 @@ float renderProbe(vec3 viewDir, vec3 worldPos, vec3 normal, vec3 norm, float Rou if(lightProbeData[0][3] != 0.0){ // oriented box probe - mat3 wToLocalRot = inverse(mat3(lightProbeData)); + // mat3_sub our compat wrapper for mat3(mat4) + mat3 wToLocalRot = inverse(mat3_sub(lightProbeData)); vec3 scale = vec3(lightProbeData[0][3], lightProbeData[1][3], lightProbeData[2][3]); #if NB_PROBES >= 2