What does the distance parameter of ISimplificationSettings stand for?
Is it the distance between the mesh and the camera, or the vertical depth of the mesh from the screen or something else?
I want to implement a feature where I can help the user get the distance parameter. If the user changes the camera field of view, the distance parameter can be automatically updated to help the user design the ISimplificationSettings.
For LOD you may define the distance to viewer (by default), or screen coverage. It is performed at mesh level
mesh.useLODScreenCoverage = true;
In this case values must be between 0 and 1
mesh.addLODLevel(0.1, knot01);
In this case bigger value means a bigger size on the screen, and thus a more detailed LOD. This is the opposite order than with distance, where a big distance meant a smaller size, and therefore a less detailed LOD.
More info - Babylon.js docs
Note that if you do it more than once you need to dispose all simplified meshes, otherwise they will add to the previous ones, and remove LOD settings.
No, the LOD levels are camera independent. I believe in this case you need to implement some own code to calculate the average FOV or some another value used for simplification.
If you need separate LOD treatment for different cameras you need to clone all meshes, assign LayerMask to them and to the second camera and then perform a separate simplification. But this may be quite perf heavy and not optimal from the common sense of view.
I manually calculate the screen coverage of the mesh and set some columns of mesh according to the screen coverage to achieve LOD switching based on screen coverage.
Is it possible to achieve LOD grid display under different cameras?