Hello, I was wondering. Does the Node keep track of all the Vertices data of every model or does it keep a reference of the model?
Node rootNode = new Node("RootNode");
//as (8 vertices) (Let's say it was a loaded cube)
Spatial object1= assetmanager.loadAsset("something...");
//does it make 8 new vertices? or does it do a direct reference the first object?
Spatial object2= object1.clone();
Ok, so does it make more memory in the System memory? (By system i mean the ddr3-ddr4 memory and not the graphics gddr5 memory)
Or does it allocate only a reference pointer and a boolean or something to say “Hey I m a clone!” and does some copy pasting all over the place with the referenced model?
cause if it s the first point then it would explain why my game waste so much memory. And wouldn’t it be easy to make the second implementation? Or is it already there and I’m just bad and didn’t know about it?
I am not a dev. But yes i am sure. There is even a flag for duplicating material data. But default mesh and material data is not duplicated. This is easily verified by checking the mesh instances or the source.
I even do poor man instancing by using the same mesh data 100s of times in my scenes.