Object NOT transparent disappear behind himself

Hello, I have an issue with three.js. I import a “big” glb model on my scene. The object is NOT transparent but if the model is covered by itself on the camera view, the foreground become transparent. (as you can see on the picture, the background montain is on foreground).

I tried some solutions like :

  • depthTest to false on glb material
  • sortOrder to false
  • Use logarithmicDepthBuffer
  • Change material transparent to false
  • Change alphaTest from 0 to 1 by 0.1 steps
  • Change the material to double side

I’m not the only one to get this error because when I upload my .glb file on this website based on three.js : gltf-viewer.donmccurdy.com I get the same problem. But if I upload my model on this other website (also based on three.js gltf.insimo.com there is no more problem. I tried to read the code of the second website on github but ther is too much source file :frowning:

You can download my glb file at : 1fichier.com/?z6hwqimlej12yw3uzaxv

Sorry for my English,
and thank you for help :slight_smile:

The problem is that this model is, in fact, transparent. Perhaps that wasn’t your intention, and it probably shouldn’t be, but it is.

You can fix this by changing it back to opaque, and restoring the default depthWrite value:

mesh = content.getObjectByName('mesh_0');
mesh.material.transparent = false;
mesh.material.depthWrite = true;

Before:

After:

Oh thank you a lot it’s works but when I do this an other issue appear :frowning:

The water reflection make some traces on water if I move the camera with orbitControl.

But you’re right my object shouldn’t be transparent… I don’t why is it… I will try to use an other exporter for maya or see if something is wrong. Maybe this will resolve all problem :slight_smile:

Ensure to to use the latest dev version until R116 is published. There was a fix added that improves the reflections of Water and Reflector.

I have finally found an other solution by setting the rendering order of the water to 1

Thank you :wink: