I have lego blocks. Most of them are opaque, but some are semi transparent.
For some reason, the semi transparent blocks have missing faces. I have checked the normals on the faces and they are all facing outwards. Models are imported .glb files created in Blender 2.8.
Iāve tried MeshLambertMaterial and MeshPhongMaterial material types and that makes no difference.
It is the same for all the different shape lego pieces.
The angle of view seems to make a difference. See here with the scene rotated 45 degrees. You can see that the faces nearest us (pointed to with arrow) are now visible:
Thank you very much. I did have quite a wide range for the near and far values. So I just changed that as recommended and unfortunately it hasnāt solved the issue. Iāve calculated (by watching the objects getting clipped) that the optimal near and far values are 50 and 80 which clips just in front of the scene and just behind it.
this.camera = new THREE.PerspectiveCamera(12, 1000 / 750, 50, 80);
The FOV is intentionally very small by the way because I need the ānobbinsā of the blocks to overlap, but donāt want an ortho camera. Might that be the cause?
Itās in general recommended to set Material.depthWrite to false whenever you set Material.transparent to true. This already happens for all transparent glTF assets you load via THREE.GLTFLoader.
Well, itās not a solution for all cases but in general recommended. Anyway, depth sorting issues are somewhat an unsolved problem right now and possible workarounds use case sensitive. TBH, I donāt know how to solve this for you Lego block.
No Iām afraid I didnāt. Iām just going to live with it. It seems to be related in some way to being a transparent material at certain camera angles, but beyond that Iām stumped.
Thank you thatās very kind of you. Unfortunately is in a deeply complicated Angular implementation so extacting that would be pretty hard. If you want to have a play with the live thing though you can do so here: https://oodlu.org/share-app/blocs
Yeah, you wouldnāt be able to do anything with that as itās compiled bundles. I just thought you might be interested to see the app. Iām not too worried about solving this so worry not. I appreciate your offer though, thank you
Apologies for the delay, Iāve been up to my eyeballs. Thank you for this. I just tried it and unfortunately it didnāt help. I appreciate the suggestion though.
I have just run into this issue, it happens when I set my blender materials to alpha hashed and move the camera to certain angles.
Are there any new developments on this?
Did you manage to fix it?