Because of the title of the previous question, I need to create a new topic.
The problem now is that when I create ThinInstance using the merged Mesh, if the ThinInstance Matrix is offset too much, it will disappear, but not at the origin, because the Mesh that created ThinInstance is at the origin, And what the surrounding box shows is normal.
If Iâm understanding your question correctly, this is normal behavior, because the bounding box of a thin instanced mesh is the box surrounding all of the thin instances. So if one mesh is instanced very far away, the box will be big.
Yeah, youâre right. But according to my experience, Thin Instance does not support single Thin Instance culling. Since my thininstances are scattered all over the scene, all of my Thin instances should be displayed when the camera sees the bounding box. But hereâs the thing: My thin instances will only show up if my camera contains the origin mesh.
I want thin instance to display. My other mesh is fine because it has only one mesh so there is no need to merge. The thin instance that doesnât show up is because I used the MergedMesh function.
@carolhmj Stupid solution to this problem: Keeping the origin mesh inside the camera at all times. requires switching to WebGPU mode because I used ReverseDepthBuffer
But I believe there are better solutions than this one
This PR will fix the problem with the far mesh not appearing:
The problem (bug in Babylon) in your first PG is that a mesh with thin instances doesnât maintain a bounding info per submesh and uses the bounding info of the original submesh (without thin instance). The PR will fix that.
Regarding the z-fighting problem, try to use bigger minZ values (like 1 or 10).