GLTF model has transparent face

167 views Asked by At

I created a gltf file from a third-party software (ifcOpenshell) and my problem is that one side of my model has a solid color while the other side of my model is transparent when viewed on gltfviewer

Here is the front side of my model:

front

And here is the back of the model:

enter image description here

As you can see, it's transparent.

Here is what the mesh looks like:

mesh

And well as a closeup of the normals:

normals

I can't figure out what the issue is. I would appreciate any insights. Thank you.

Here is a link to the glb file

1

There are 1 answers

0
Don McCurdy On BEST ANSWER

Materials in glTF have a doubleSided parameter, and when disabled, a surface is visible only from the front. This file contains only single-sided materials. For a quick test to compare with doubleSided=true, drag the model into https://gltf.report/ and then paste and run the script below in the scripting tab:

for (const material of document.getRoot().listMaterials()) {
    material.setDoubleSided(true);
}

I'm unsure whether ifcOpenshell has the ability to change the doubleSided parameter before export.

One of the thin edges on the side of the mesh is missing entirely, so that won't be fixed by this material setting.