Two textures of different types use the same sampler location

he …
i’m getting this:

[.WebGL-00000FD801BA7800] GL_INVALID_OPERATION: Two textures of different types use the same sampler location.

together with

[.WebGL-00000FD801BA7800] GL_INVALID_OPERATION: Mismatch between texture format and sampler type (signed/unsigned/float/shadow).

was working on an update for … it happens when turning off the planet’s cross sections. i’m not messing with textures or materials there at all but i do change the layers for some entities. not 100% sure where it comes from since it’s a warning that leads nowhere. the entities which i reassign to their original layers are not drawn. i accidentially found out that changing browsersize starts to redraw the missing entities … though it sounds as if it wasn’t about layers. i’d be happy for any direction. (using latest chrome/windows 11) …

thanks …

@mvaligursky Any ideas just from the error messages?

@rtz23 It be great if you can somehow share a reproducible project for this.

Does this also happen with older versions of the engine? (Docs here: Using a Custom Engine | Learn PlayCanvas)

This usually happens if a material does not have all textures set that is requires, and while rendering, it uses whatever texture was set in that slot by some previous render call - and that textures is not what the shader expects.

It can surface even when not messing with materials / textures, by simply changing the order of rendering, which it seems you’re doing, and now the incorrectly set up material follows up another material which sets up the slot to a different texture type.

I suspect we could add some assets / warnings in the code about this. I believe I did for WebGPU renderer I’m working on.

1 Like

@yaustar @mvaligursky

i tried it with both engine versions giving me the same result. so it obviously happens when changing the renderlayers for my entities. the layers i have set up represent layers of the planets themselves. like biome1, biome2, biome3, oceans, clouds and civillizations. i need to push them to different renderlayers when switching to cross-section mode. there is a sphere i’ve split in half overlaying half of each planet and ontop of that there is a cone with the planet’s insides. the problem occurs if i switch everything back to its original layer.

so @yaustar it could be very hard to reproduce this in a simple project. it would most likely help to find and understand the problem though.

but @mvaligursky i think this already points me into a direction - i will double and triple check all the materials in use if there is anything odd. i need to take a look on how i create the actual cross sections - they use randomized parameters as well, so i possibly mess with materials / textures there. as for a warning/error message with a hint to the actual asset would be super helpful to track down such a problem in the future …

may take me some time to get back to it. but i’m going tell you if i find anything.
thanks for support as always!

typically I would only expect this to happen with materials you change parameters (textures) on using a script, not the ones set up in the Editor.

It’d be also worth testing against some older versions of the engine, in case there was something broken recently.