Textured Objects invisible after importing as GLTF from Blender

I am creating a model in Blender and use textures from Blenderkit. If I import the Model into my three.js scene via GLTFLoader, all objects with Blenderkit textures become invisible. I get the following error message in Chrome:

“THREE.WebGLTextures: Trying to use 16 texture units while this GPU supports only 16”

I never use more than one texture on the same object. Also, the texture is definitely compatible with the GLTFLoader. If I disable the shadow map, it works. The problem is that I cannot use the Blenderkit textures and shadow map at the same time.

I use the PCFSoftShadowMap, but I’ve tried BasicShadowMap aswell and it doesn’t change anything.

Here is how I’m loading the model into three.js:

const loader = new GLTFLoader();
loader.load('model.glb', (gltf) => {
    console.log('Model loaded successfully:', gltf);
    const model = gltf.scene;
    model.scale.set(2, 2, 2);
    gltf.scene.traverse(function (child) {
        if (child.isMesh) {
            child.castShadow = true
            child.receiveShadow = true
}, undefined, (error) => {
    console.error('Error loading model:', error);

And here how it looks like without shadowmap and with shadowmap.
The visible parts in the second picture have a single color, no Blenderkit texture.

1 Like

This means one of your objects, for some reason, uses more than 16 textures in it’s material (object meaning a Mesh, not an Object3D or a model.)

Would you be able to share the part of the model (as GLTF) that’s causing trouble?