mgsx-dev / gdx-gltf

GLTF 2.0 3D format support and PBR shader implementation for LibGDX
Apache License 2.0
214 stars 50 forks source link

Systematic OpenGL error when using unlit material in combination with CSM #107

Closed dar-dev closed 1 year ago

dar-dev commented 1 year ago

Systematic OpenGL error when using an unlit matierial in combination with CSM at line: https://github.com/mgsx-dev/gdx-gltf/blob/f07fd752150e253e709655460e2fc842cde5f662/gltf/src/net/mgsx/gltf/scene3d/shaders/PBRShader.java#LL806C10-L806C10

The PBR shader enables unlitFlag when using unlit material, so the shader tries to set a uniform using an invalid location (-1). This an invalid operation by gl API and it is correctly reported by gl debugger. (see: https://registry.khronos.org/OpenGL-Refpages/gl4/html/glUniform.xhtml#errors).

[LWJGL] ARB_debug_output message ID: 1282 Source: API Type: ERROR Severity: HIGH Message: GL_INVALID_OPERATION error generated. Wrong component type or count.