Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skybox fragment shader error in 2.2.1 on Android #130

Open
yahel-ck opened this issue Sep 27, 2024 · 0 comments
Open

Skybox fragment shader error in 2.2.1 on Android #130

yahel-ck opened this issue Sep 27, 2024 · 0 comments

Comments

@yahel-ck
Copy link

Hey :)

I'm trying to upgrade my project to use gdx-gltf version 2.2.1 (currently using 2.1.0) and I'm getting a compilation error in the fragment shader of the Skybox:

com.badlogic.gdx.utils.GdxRuntimeException: Fragment shader:
    ERROR: 0:1: '' :  version '430' is not supported
    ERROR: 0:2: '' :  #version required and missing.
        at com.badlogic.gdx.graphics.g3d.shaders.BaseShader.init(BaseShader.java:169)
        at com.badlogic.gdx.graphics.g3d.shaders.DefaultShader.init(DefaultShader.java:624)
        at net.mgsx.gltf.scene3d.scene.SceneSkybox$SkyboxShader.init(SceneSkybox.java:191)
        at com.badlogic.gdx.graphics.g3d.utils.BaseShaderProvider.getShader(BaseShaderProvider.java:36)
        at net.mgsx.gltf.scene3d.scene.SceneSkybox.getRenderables(SceneSkybox.java:247)
...

I got this error when running on an Android emulator (Pixel 5 API 32), but I got no error when running on a real Pixel 8 device.

I was using the basic constructor SceneSkybox(envCubemap) to create it, and I also tried SceneSkybox(envCubemap, SRGB.NONE, null, true) because I noticed the the new code adds #version if lod is enabled, and it did run on the Pixel 5 emulator, but this time I got an exception on my Pixel 8 device:

com.badlogic.gdx.utils.GdxRuntimeException: L0001 Shader languages do not match.
        at com.badlogic.gdx.graphics.g3d.shaders.BaseShader.init(BaseShader.java:169)
        at com.badlogic.gdx.graphics.g3d.shaders.DefaultShader.init(DefaultShader.java:624)
        at net.mgsx.gltf.scene3d.scene.SceneSkybox$SkyboxShader.init(SceneSkybox.java:191)
        at com.badlogic.gdx.graphics.g3d.utils.BaseShaderProvider.getShader(BaseShaderProvider.java:36)
        at net.mgsx.gltf.scene3d.scene.SceneSkybox.getRenderables(SceneSkybox.java:247)
        at com.badlogic.gdx.graphics.g3d.ModelBatch.render(ModelBatch.java:239)

I would appreciate some help to fix this so I can run this properly on all devices.
Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant