This problem had perplexed me for a long while.
In my project,I want to render a large number of ship models(maybe 1000 or more),the model is loaded from a glb file and added to CesiumJS as a primitive object,
Here is the code snippet, "this.viewer" in which is an instance of Cesium.Viewer.
this.viewer.scene.primitives.addPrimitive(Cesium.Model.fromGltf(<any>{
url: require('../../../res/model3d/ship.glb'),
modelMatrix: modelMatrix,
scale: 0.2,
minimumPixelSize: 16,
maximumScale: 1000,
silhouetteColor: Cesium.Color.GREENYELLOW,
silhouetteSize: 2
}));
In order to load 1000 ship models,I simplely loop this snippet for 1000 times with different "modeMatrix".
As I run the application, the consequence is expected but with a horrible performance(with 1FPS or even worse).
So, is there a better and highly effective way to render thousands of 3D models that share the same glb file.
I hope it can work exactly like the GeometryInstance do, load the glp file once and reuse it in many instances