Model showing as transparent even though MTL says otherwise

I have an OBJ file produced in Blender, along with associated MTL and some textures.

I then load the model + material with OBJLoader + MTLLoader respectively, but the result is not what I would expect.

The model is showing as transparent, even though I can see no reason why it would.

Other models I’ve made have shown up fine. The only difference I can think of with this one is that it was originally imported into Blender from an SKP file using an addon.

Pic in threejs:

All relevant files attached here:
TIMBERfinal.zip (55.6 KB)

Code:

const mtlLoader = new MTLLoader();

mtlLoader.setMaterialOptions({side: THREE.DoubleSide, shading: THREE.FlatShading});

mtlLoader.load('someaddress.com'+accountName+"/"+modelName+".mtl",

    (materials) => {

        materials.preload();

        const objLoader = new OBJLoader();

        objLoader.setMaterials(materials);

        objLoader.load(

            'someaddress.com'+accountName+"/"+modelName+".obj",

            (object) => {

                scene.add(object);

                object.scale.set(1,1,1);

            },

            (xhr) => {

                console.log((xhr.loaded / xhr.total * 100) + '% loaded');

            },

            (error) => {

                console.log('An error happened');

            }

        );

    },

    (xhr) => {

        console.log((xhr.loaded / xhr.total * 100) + '% loaded');

    },

    (error) => {

        console.log('An error happened');

    }

)

The model MTL file specifies both an alpha and a diffuse map for each of its two materials:

map_Kd \TIMBERfinal\metal.jpg
map_d \TIMBERfinal\metal.jpg

...

map_Kd \TIMBERfinal\wood.jpg
map_d \TIMBERfinal\wood.jpg

As a result of the alpha map, THREE.MTLLoader considers the material to be transparent:

To avoid that you can either delete the map_d lines from the file, or make sure nothing is connected to the Alpha slot in Blender.

1 Like

Excellent, thank you very much, that worked as expected