Open KrabatTilt opened 5 years ago
You need to assign the BatchedMeshGeometryModel3D a material as master material.
And also needs to provide your own function to merge all texture together as a single texture map and assign into the master material map.
Also the texture coordinates for each mesh need to be corrected based on how you merge your textures as well.
HelixToolkit provided an image packer tool (needs further implementation to support file streams) to pack multiple textures together. But you still need to correct the texture coordinates in each mesh.
You may use SpriteSheetPacker as well.
I am using helix-toolkit version 2.5.1.
I am trying to load and display a lot of small rectangular tiles with different texture loaded from file. Currently I put every tile separately into a ModelGroup which works fine. But it seems to generate a performance issue as UI becomes laggy when removing/adding items from/to the model group while viewport is moved by the user. So I tried to implement loading all tiles together in one BatchedMeshGeometryModel3D and adding just this model to the ModelGroup. But unfortunately, this does not work. The BatchedModel is added but not displayed.
Below is my code of the Viewport and model creation logic.
Viewport:
ModelCreation: