V1.42 GL errors in console. V1.41.0 is OK

I have a project that is OK when launched against v1.41.0 but has loads of WEBGL errors in V1.42.0. It is only happening on Android. No errors on iOS or MAC.

I know it would be good if I created a minimal project but I’ve got a deadline so would it be possible if I could give access to my project to the Playcanvas support team?

The app is published on PlayCanvas. Is there are way to publish an app against v1.41.0?

Here are example of the errors. Looks related to compressed textures.

GL ERROR :GL_INVALID_OPERATION : glDrawElements: Texture bound to texture unit 0 with internal format GL_ETC1_RGB8_OES is not compatible with sampler type GL_SAMPLER_2D_SHADOW_EXT

glDrawElements: Texture bound to texture unit 0 with internal format GL_COMPRESSED_RGBA_ASTC_4x4_KHR is not compatible with sampler type GL_SAMPLER_2D_SHADOW_EXT

Are you self hosting? If so, you can replace the PlayCanvas engine file in the build with a version on our code server GitHub - playcanvas/engine: Fast and lightweight JavaScript game engine built on WebGL and glTF

Eg https://code.playcanvas.com/playcanvas-1.41.0.min.js

As it’s the weekend, no one is really in the ‘office’ (it’s 1am in London)

When’s the deadline?

I’m not self hosting. I publish the app on Playcanvas and set as iframe src from the small site I am self hosting. Deadline is the end of the weekend. It would be handy I you could add the &use_local_engine=https://code.playcanvas.com/playcanvas-1.41.0.js the the url of published builds.

You can email support@playcanvas.com with the project URL and we can add ourselves to the project.

Or you can give ‘yaustar’ read access

Can you also send repro steps, branch and scene to get the error if there steps involved?

Hmm… I can’t see this being investigated and fixed before the weekend if I’m being realistic.

We might be able to have a temp workaround which is going to be a kludge. I will investigate tomorrow on the work around.

Thank you!. I will send details.

This is a complete kludge and should never be used barring emergencies. It basically stops the current engine from loading and loads the 1.41.2 instead: https://playcanvas.com/editor/scene/1176181

One script is loaded before the engine

The 1.41.2 engine is loaded after the engine

1 Like

It worked! Brilliant.

@Kulodo133 I’ve tried the project on my Pixel 2 and I can’t reproduce the WebGL errors.

What device do you have?

Pixel 4a Android 11

        // Formats reported from Pixel4a Android 11

        // astc: app.graphicsDevice.extCompressedTextureASTC   YES
        // dxt:  app.graphicsDevice.extCompressedTextureS3TC   NO
        // etc2  app.graphicsDevice.extCompressedTextureETC    YES
        // etc1  app.graphicsDevice.extCompressedTextureETC1   YES
        // pvr   app.graphicsDevice.extCompressedTexturePVRTC  NO
        // atc   app.graphicsDevice.extCompressedTextureATC    NO

Reproduced on my Pixel 2. Turns out WebGL errors don’t show up on remote logs :confused:

1 Like

I am using chrome://inspect/#devices on desktop chrome connected to Android device via USB.

GL ERROR :GL_INVALID_OPERATION : glDrawElements: Texture bound to texture unit 0 with internal format GL_ETC1_RGB8_OES is not compatible with sampler type GL_SAMPLER_2D_SHADOW_EXT

glDrawElements: Texture bound to texture unit 0 with internal format GL_COMPRESSED_RGBA_ASTC_4x4_KHR is not compatible with sampler type GL_SAMPLER_2D_SHADOW_EXT

These errors seem like a shadow map is not correctly set up on webgl device for whatever reason. The shader uses a shadow sampler to read from a shadow texture, but different texture is set up there for some reason - somehow shadow was either not created, or incorrect shader is used which should not use shadow or similar. Hard to say.
What shadow’s are you using? What filtering type? (PCF vs VSM) - it could be worth experimenting with different options to isolate the problem. I assume disabling shadows stops this. Also, perhaps try running debug version of the engine (if not already) to see if there’s some engine errors reported.

@mvaligursky I will check your suggestions out this evening ( UK time ). As these errors don’t get reported in V1.41.0 but do in V1.42.0 I guess it could be an engine issue but equally might be an issue in my project that has just come to light in 1.42.0.

Commit on the engine when the errors start happening: Shadow mapping refactoring (#3155) · playcanvas/engine@5cd4bf6 · GitHub

Interestingly, it only happens on a scene load, not if you start in the scene

Removed the lights in the scene. WebGL errors don’t show up. So it looks related to loading scene or assets and shadow mapping at the moment. Trying to minimise the repro at the moment

I’ve got ROOM6 down to a bare minimum state that reproduces the error:

However, when I replace the existing scene loading logic with my own simple one, the error doesn’t come up. Chances are that it’s related to the loading logic that you have or the assets that are loading or the scene settings :thinking:

1 Like

Hi @yaustar could you give me read access to your project so I can take a look later?

@Kulodo133 , what is your playcanvas username?