Actually you would have to update the mesh node parameters as well, otherwise they index into a vertex buffer which is too small. But these attributes are read-only at the moment.
Ahhh of course, the geometry is put into a mesh. Does the mesh have its own set of indices?
Internally, why not just attach the geometry to the mesh and reference the geometry from within the mesh when retrieving mesh geometry data? (I'm probably not thinking about many design issues!!)
Marciano, if the Mesh parameters are read-only, does that mean that anchor must also remove the mesh node and then create a new mesh node when the geometry is loaded again?
If so, then he will also need to remove the model node which holds the geometry will he?
For a future version I would prefer to have the batch data (index and vertex range) stored in the geometry resource along with the local AABB to avoid all these issues that we have now
Sounds like a good move to make.
Are there any issues with your first solution of just unloading the resource and deactivating the corresponding scene nodes?
Not just deactivating, but removing the scene node is what he did.
He said that works well enough so he should be ok for now.
anchor, what happens if you simply remove the geometry resource and set the node invisible?
Do not remove the Node.
Then when the node becomes visible again, load the geometry resource again.
If that works, that is the most efficient. You should only need to remove the node if geometry resources are shared, then you must remove all nodes that contain that particular geometry.
I don't see why it should not work to simply unload the resource because the engine will not attempt to render the invisible node, hence the engine should not try to access the geometry for invisible nodes.
The only problem is, does the Mesh and Model node need to be recreated, or can they be updated?