royibernthal Posted September 6, 2016 Share Posted September 6, 2016 I'm loading a 3D model exported to .babylon format using Blender. The end result is usually a .babylon file containg a bundle of meshes each using a different texture. My current solution is to create a container for manipulating all meshes of the same bundle. MeshContainer consists of the array of bundled meshes that were loaded, and when applying position / rotation / etc to the container, they are applied to all of its meshes. For optimization purposes I'm now trying to merge all meshes that are related to the same 3D model instead of using my MeshContainer solution. The problem is, once I merge the meshes, all the textures / materials disappear. I saw that babylon has something called MultiMaterial, it sounds like a direction, but I'm not sure how to proceed, if this even is the right direction. How do I solve this? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted September 6, 2016 Share Posted September 6, 2016 The merger should have all the same materials for this to work. For group your object, use mesh.parent = ; for example. Quote Link to comment Share on other sites More sharing options...
royibernthal Posted September 6, 2016 Author Share Posted September 6, 2016 I do have the MeshContainer solution for grouping like I described, but for optimization purposes I'd like to merge all meshes with their multiple materials. Is it not possible in some way? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted September 6, 2016 Share Posted September 6, 2016 No this is not possible, merge objects must share the same materials, the same textures. . . Quote Link to comment Share on other sites More sharing options...
royibernthal Posted September 6, 2016 Author Share Posted September 6, 2016 Yes I understand, but there must be a way around this. I remember reading in the forum about merging meshes with multiple materials for a platform game using MultiMaterial if I remember correctly, I can't find it. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted September 6, 2016 Share Posted September 6, 2016 May be creating your own merge function: http://doc.babylonjs.com/tutorials/How_to_Merge_Meshes Quote Link to comment Share on other sites More sharing options...
MarianG Posted September 6, 2016 Share Posted September 6, 2016 Or, if there are simple meshes, I think you can do something like here. I mean merge them all, and than apply the material. Quote Link to comment Share on other sites More sharing options...
royibernthal Posted September 6, 2016 Author Share Posted September 6, 2016 @Dad72 Maybe, but I have no clue at all how to even start doing that. Maybe you can give me a direction? @bulisor Unfortunately they are not simple at all, they're models of humans, animals, etc. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted September 6, 2016 Share Posted September 6, 2016 Why not merge your mesh from your modeling software (Blender, 3ds max). This would simplify things. Quote Link to comment Share on other sites More sharing options...
royibernthal Posted September 6, 2016 Author Share Posted September 6, 2016 Would blender know how to treat the textures after the meshes were merged? In my blender I see a model without the textures and only after it is exported I see referenced to the textures which are displayed in bjs. After merging meshes that have different textures, will the .babylon file and textures be exported properly? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted September 6, 2016 Share Posted September 6, 2016 I am user of 3ds max, I will not help you with 'blender' I never use. I hope someone you'll help with 'blender' I know there are many who use on this forum. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.