I am trying to make semi-transparent glasses
but when moving it around in threeJS Editor in some positions temples of that glasses seems to be in front of frames or lenses.
This is how it looks like:
I think this is a modeling issue. Babylonjs has fewer problems with it (their sorting algorithm uses bboxes instead of center points, maybe?) but certainly still has issues. Even Blender has sorting trouble with this model:
What exactly is an issue with that model? Itâs just a few parts connected together with transparency, nothing extraordinary with that 3d model.
BTW
When we have tryied to combine all transparent parts to one. https://drive.google.com/file/d/1Te-22Ouyb2tHni7CAOIqNDMjOUb7pbz5/view?usp=sharing
Transparency started to work better for lenses but not for a frame.
Even a single transparent mesh can have these issues, depending on its shape and self-occlusion. Mostly this particular model is difficult because its entire frame is slightly transparent. Compare these two renders, where I change the frameâs material mode in Blender from âAlpha Blendâ to âAlpha Hashâ:
EDIT: Note that these were taken in Blenderâs Eevee renderer, which is a better approximation of a realtime engineâs capabilities.
That works better, but unfortunately you canât export âAlpha Hashâ from Blender. There may be other workarounds possible by splitting up or combining meshes in certain ways, but I donât know what they would be.
It might be worth filing a feature request on three.js for something like an âAlpha Hashâ or âAlpha Ditherâ mode. Weâve discussed it a few times but I donât think there is an open feature request.