I prepared three versions of a model in advance, with different levels of refinement. I want to take these three versions as the LOD levels of the model. I use assetManager to import the model. But I can only see the first model I imported on the web page. Regardless of the distance, the LOD level I added to this model has no effect. What problems may I encounter, how should I modify them, or what knowledge should I learn to solve this problem?
I put my code here and used other people’s models. During editing this sample code, I tried different loading methods in the code and found that as long as I use GLB model as LOD, or add other models or null to GLB model as LOD, it will not work.
I wonder if this is related to the loading principle of Babylon on gltf / GLB model. If I want to use my own GLB / gltf model to realize LOD, what do I need to do?
Hi @escape
Can you please provide a playground when gltf upload on github for example, it will help us find the issue.
Thanks for your reply, I will edit this questions tomorrow.
I have edited my question and hope for your help ::
I changed your PG to move the camera backward and set the LOD on the box:
Box test scaling non-bake | Babylon.js Playground (babylonjs.com)
Use mouse wheel to get back and you’ll see the LOD mesh to change.
Thanks for your answer, it works!
I noticed that there are two meshes underneath the rootmesh in the scene, and the LOD doesn’t work when I set it on rootmesh. When you set LOD on a single mesh such as box, it works. what is the reason of this? I can only set LOD on a single mesh, not for a rootmesh that includes multiple meshes. Is that correct? (if this rootmesh only have one childmesh, will LOD work?)
What can I do if I want to see Box and ring as a whole, and set LOD on this whole scene? Whether the Merge method is required? I’m sorry that I’m new to BABYLON and my questions may a little foolish.
@Cedric
I believe LOD is per mesh. if you want to have 2 meshes linked to an LOD, then you might have to merge them.
Thank you for your answer, you really helped me a lot!