hi,
I have a gltf model that needs to be statically displayed many (tens of) thousand times on the surface of the globe. I'm looking into ways to ensure the best possible performance.
what I am currently doing is (in a loop):
hi,
I have a gltf model that needs to be statically displayed many (tens of) thousand times on the surface of the globe. I'm looking into ways to ensure the best possible performance.
what I am currently doing is (in a loop):
Hello,
We don’t have model instancing support in the Cesium release yet, but it has been added to our 3d-tiles branch: https://github.com/AnalyticalGraphicsInc/cesium/tree/3d-tiles
You can see a code example for instancing models using that branch here: https://github.com/AnalyticalGraphicsInc/cesium/blob/3d-tiles/Apps/Sandcastle/gallery/development/3D%20Models%20Instancing.html
And we have instructions for cloning and building the code base here: https://github.com/AnalyticalGraphicsInc/cesium/tree/master/Documentation/Contributors/BuildGuide
Best,
Hannah
thanks a lot hannah. — what a difference that makes!
there is two new problems though:
const handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
handler.setInputAction(
(action) => {
const pickedObject = scene.pick(action.position);
console.log(pickedObject); // → is undefined
, although mouse pointer is definitely over a model
},
Cesium.ScreenSpaceEventType.LEFT_CLICK
);
Yeah picking does not seem to be working for ModelInstanceCollection. Looking at the code I see the root cause but it may be a little while before I get to fixing it. I would like to revamp the system a bit to be able to pick instances and modify their model matrices, rather than the default picking behavior for models.
I’m not sure what’s causing the difference in color, are you able to send over the model you’re using?
Yeah picking does not seem to be working for ModelInstanceCollection.
Looking at the code I see the root cause but it may be a little while
before I get to fixing it.
could you point me to what you think the root cause is?
for the project I am working on I will definitely need picking – maybe I
can have a stab at it.
I would like to revamp the system a bit to be able to pick instances and
modify their model matrices, rather than the default picking behavior for
models.I'm not sure what's causing the difference in color, are you able to send
over the model you're using?
not sure why it looked different before, but changing the diffuse color of
the material fixed it.
The root cause is the model options set pickVertexShaderLoaded, pickFragmentShaderLoaded, pickUniformMapLoaded which override the model’s default picking behavior. However unless the ModelInstanceCollection is backed by a batchTable for Instanced3DModel3DTileContent the pick ids/shaders are not being set. I was going to look into this issue during the bug bash this week, but if I don’t get to it feel free to take it up.
This was added in #4975 at the bug bash.
Patrick
thanks so much!