Numa Posted December 1, 2016 Share Posted December 1, 2016 Hi there, I'm trying to load a 35mb obj file. on mobile it crashes the browser (on an iphone 6, chrome/safari). I monitored the memory and it looks like when parsing the file memory goes up to 200+mb ? Is that normal? Is there a way to "stream" the data? Just to make sure I'm not doing anything silly with it I'd like to test it in the playground, how can I do that? the file is here: https://dl.dropboxusercontent.com/u/28007926/gg/bigModel.obj My obj data comes in as a string then I'm using sceneLoader.Append(). Thanks Quote Link to comment Share on other sites More sharing options...
Kesshi Posted December 1, 2016 Share Posted December 1, 2016 That doesn't surprise me. Obj is a text based format and parsing a 35mb text file is not an easy job. obj is not good for complex models. I would recommend that you try to convert your model into the babylon format (e.g. with blender or one of the other exporters: https://github.com/BabylonJS/Babylon.js/tree/master/Exporters ) gryff 1 Quote Link to comment Share on other sites More sharing options...
gryff Posted December 1, 2016 Share Posted December 1, 2016 @Numa : I downloaded your .obj file and took a look at it in Blender as @Kesshi suggested. It imported into Blender fine, but as there is no .mtl file all the 96 meshes have no materials!! I added a light and camera (that can be done in javascript code if you wish) and exported it as a .babylon file. The exporter gave me 96 "warnings" about the export ( the lack of materials) Anyway, I opened the .babylon file in the BJS Sandbox - see image below. If you want either the .blend file or the exported .babylon file so that you can test the.babylon file on a mobile device - I can post them here. cheers, gryff Quote Link to comment Share on other sites More sharing options...
Numa Posted December 2, 2016 Author Share Posted December 2, 2016 Thanks a lot, yeah I converted it into a .babylon file and it was about half the size, that worked better on mobile Also I know about the materials, I don't need them in my project. Now I need your opinion, we're going to move away from obj at this point as it is just too heavy to work with (and doesn't have bones) and I'm still unsure which format to use to keep files as small/fast loading as possible. We have a very specific workflow. People bring 3d models from all formats into our program (build with unity), edit the models in unity, save them out to our server, which then displays them in babylon. so the workflow is: upload any format to server --> server converts to our format of choice to be read by Unity -> unity saves back to the server to format of choice --> view in babylon. Do you recommend any format? It must have : - a robust unity importer/exporter - a robust babylon importer - support skinned meshes / bones - be as light / fast as possible I was going to go with GLTF but it sometimes produces files larger than obj's so I'm not sure. Quote Link to comment Share on other sites More sharing options...
gryff Posted December 2, 2016 Share Posted December 2, 2016 @Numa : not sure I can be much help with your workflow as I tend to work with Blender. All I can suggest is you have a look at the Unity exporter to.babylon. As you mentioned the .obj format "doesn't have bones ", you might want to check how well the Unity Exporter exports rigs (and animations?). Just one final thought, if the end viewing device is "mobile", you may want to watch out for rigs with a lot of bones. @JCPalmer, I think, recommends less than 30 bones for mobile devices. Now I have some character rigs with 90+ bones which don't work well on a desktop PC - so could be a disaster on a mobile device . You might want to perhaps start a new thread on finding out more about the export of rigs from Unity to BJS. Good luck. cheers, gryff Quote Link to comment Share on other sites More sharing options...
Numa Posted December 4, 2016 Author Share Posted December 4, 2016 Ok thanks a lot I'll have a look at this soon! Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted December 4, 2016 Share Posted December 4, 2016 The theoritical max on iOS is 32. One my recent Android tablet, the theoretical max is 64. If you exceed based on what else you are doing to the materials / meshes of the skeleton, it is going to fallback to cpu skinning. Have already mentioned what else needs to be taken into account. Numa 1 Quote Link to comment Share on other sites More sharing options...
gryff Posted December 4, 2016 Share Posted December 4, 2016 @JCPalmer : Thanks Jeff - I just could not find that thread cheers, gryff 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.