Tagged: emscripten, lzma, memory, xz
- This topic has 6 replies, 4 voices, and was last updated 5 years, 7 months ago by scalare.
-
AuthorPosts
-
2019-04-25 at 6:36 pm #14230scalareCustomer
Hi, we’re very close to finish our proof of concept development, and we’re now getting into files and textures optimization. Our configurator setup includes a main gltf file and several dummy external gltf files, each of which include just a plane mesh with just a material applied to it.
So, when we need to apply a different material to an object, we load the corresponding dummy gltf file into the scene with “append scene” puzzle, and when it is loaded, we copy over the material from the loaded mesh to the desired object.
While this worked perfectly for “regular” gltf files, we cannot make it work with LZMA compressed files. We can load the main gltf.xz file without problems, but we’re not able to load the xz files for the dummy files. We get errors in the console, like this:
Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value 16777216, (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0
In fact, all the examples in the documentation for both “append scene” and “load scene” puzzles have their examples with files that go like “path/to/scene.gltf”.
But it seems that specifying a file that includes the xz extension isn’t working. Oh, and by the way, we already have the option “compressed assets” enabled at the Init category for the puzzles.Any ideas of what we may be doing wrong? Thank you!
2019-04-26 at 1:03 pm #14260Yuri KovelenovStaff2019-04-27 at 9:51 pm #14270scalareCustomerThank you!
2019-04-30 at 9:09 am #14305Alexander KovelenovStaffHi,
this is a memory issue with XZ decoder. It may happen if your assets are compressed with a high compression rate or large dictionary (more than 8MB in size). What tool did you use to compress your scenes? Check out the following topic in the manual to get more info about proper compression settings.
If you used conventional “Enable LZMA Compression” feature included in Blender/3ds Max plug-ins please send us the loaded asset so we can investigate this issue further.
2019-04-30 at 12:28 pm #14324scalareCustomerHi Alexander,
yes, I just used the “Enable LZMA Compression” feature in Blender. However (not sure if this could be the cause), I did not create a separate blender file for each of the dummy files. I just created those planes from a previous version of the same main blender file, where I selected only the planes with the camera icon to indicate that I wanted to export just that mesh (one time per each dummy), and exported them from there. After doing that, I removed the dummy meshes from the blender file and exported the main file without them.
Attached you will find a zip file with the gltf and bin files for a dummy, and their compressed versions, and a texture that is used for the material.
Thanks a lot!
2019-04-30 at 5:36 pm #14329Ivan LyubovnikovStaffHi scalare, we’ve figured out and fixed this issue. It should be available in the upcoming 2.12 release, probably this week.
Co-founder and lead developer at Soft8Soft.
2019-04-30 at 6:55 pm #14330scalareCustomerThat’s great, thank you, Ivan!
-
AuthorPosts
- You must be logged in to reply to this topic.