Good afternoon.
Over time airport scenerys become more and more detalized and we trying to find best solution’s for the performance optimization. Recently in SDK i read about Model Attachment, and for me it’s very interesting. Cause i am cam make one camera model with LOD’s, one ventilation model with LOD’s etc. And attach it to the building base throughout the airport. Finnaly we have buildings with activating LOD per submodel (Theoretically that can positive affected on performance)
How suitable is this method (Model Attachment) for scenery creation?How will this affect on performance?
And another question.
When i make base model with model attachments i need to describe for every attached models. ( If i have 100 cameras on building for the 100 cameras i need to make separate strings and XML file will be so big). How i can optimize it, and what you advice to me with that method.
Thanks for attantion!
For scenery creation, if you use lots of repeated objects, it’s way more effective to be sure they are Instances and they are exported as such from Babylon.
I’m using 3ds Max terminology, if you use Blender, I don’t know what’s the matching term but, as a general rule, instances are objects that are all “linked clones” so, if you edit any of them, all their instances in the scene will change as well.
Instances are recognized and if you use them a lot, you can see the effect as a reduction in the .gltf file size, because the mesh data is shared, only the transformations are individually exported.
This method is very effective to increase performances, especially when you have many moderately complex objects repeated many times. Sometimes, you need to use some common sense if it’s worth doing an instance, for example:
-
Do you have 50 objects made of 1000 polygons each ? You surely want to use Instancing in this case.
-
Do you have 1000 objects of 10 polygons each ? In this case, not so much, it might be more effective to just collapse them all in a single 10K polygons object, because the overhead of handing 1000 transformations is overkill for such simple objects, best to simply collapse them all.
Instancing doesn’t need to do anything in the XML behaviour.
Attaching, instead, is usually more suited to animated Simobjects with some behavior, where an object is shared by many objects, for example a driver that might end up driving many different vehicles, or any case of fairly complex objects that might be attached to something else especially if that object is animated, because you can attach to any node, and the attached object would follow the eventual node animation.
Thank’s for reply!
But if i have 50 buildings with the 5 animated conditioners on each building (conditioners per one object it duplicated as instance). Overall in simulator for all buildings we will have 50 drawcalls on conditioners only and must to make LOD’s for all that 50 objects with the same model of conditioners.
But if we have possibility to add conditioner as Model Attachment - in this case we have 1 conditioner gltf model, with the LOD’s, animations etc. And this is object for my 50 buildings will duplicates as MSFS placement model (If I understand correctly - when we placed object into MSFS scenery editor that the same as instancing).
Animated objects will break instancing and will always be separate calls, no matter method you use.
It’s difficult to know what would be best in your case, without knowing how many polygons each of your objects has.
You might consider an hybrid approach: make the static parts as instanced meshes, possibly part of a single Simobject, and the Attach to them the animated parts.
And yes, of course there’s the LOD issue, which would need to be tweaked differently when the object is attached to something else.