When i export a scene which contains batchedmesh in the scene then the gltf is not correct.
It look like the transformation is not done and all meshes are on position 0,0,0 ??
Anyone had the same problem?
When i export a scene which contains batchedmesh in the scene then the gltf is not correct.
It look like the transformation is not done and all meshes are on position 0,0,0 ??
Anyone had the same problem?
GLTFExporter doesn’t know anything about BatchedMesh, no, and there’s no equivalent concept in file formats like glTF. I think it would be necessary to unpack the BatchedMesh into individual meshes before exporting.
I have a very large scene, with over 150.000 meshes which are also very different.
So that is why i use BatchedMesh.
Wouldn’t it be better to build this in the GltfExporter itself, then a mesh would only contain the meshes in a batchedmesh.
Perhaps, depending on the complexity. If it turns out to be a lot of code then it probably doesn’t belong in GLTFExporter (all exporters would need this). If your BatchedMesh usage includes instancing then the exporter could perhaps be changed to use glTF’s instancing feature similar to what we do for InstancedMesh…
… but if the batch geometries are all different and not instanced, the result would be identical to exporting 150,000 distinct meshes.
I agree it is difficult to change this for all exporters, but only gltf has features that could help with this problem.
Found glTF/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/README.md at acfcbe65e40c53d6d3aa55a7299982bf2c01c75d · KhronosGroup/glTF · GitHub which also mentions you.
Would this extension not be helpfull. I can possibly also switch to instanced meshes where the geometric part is the same. Will try to find out how much drawcalls this gives.
The model we create is a neighbourhood with multiple residentialareas and these have multiple buildings. Because the buildings are wooden frames with many details the number off elements grows quickly. The walls may contain different openings which makes the walls on a building base different.
Right, EXT_mesh_gpu_instancing
is supported by GLTFExporter today, but only for THREE.InstancedMesh objects in the scene. The exporter doesn’t know how to handle THREE.BatchedMesh currently.
I don’t personally plan to work on adding BatchedMesh to GLTFExporter, but pull requests would be welcome. Keeping in mind that if the implementation is complex, it should probably go in a utility file, like SceneUtils, and not the exporter itself. Perhaps similar to SceneUtils.createMeshesFromInstancedMesh.
Thank you for the feedback, an other view on the topic helps