Select to view content in your preferred language

Crash on iOS trying to run .slpk 3D building layer

2721
14
05-21-2024 02:17 PM
StarrLong
Emerging Contributor

We have built a large scale Active Digital Twin of the Port of Corpus Christi that includes base layers and a 3D building layer using .slpk files. 

We are using the Unity Maps Plugin.

When we run a 3D building layer / .slpk  above 50mb the application crashes instantly on an iOS device (10th generation iPad Pro). 

For reference on windows we can run a 500mb + file with no instability of any kind.

I have attached a screenshot of the windows version and the crash logs from TestFlight. 

 

0 Kudos
14 Replies
StarrLong
Emerging Contributor

Also can you please confirm which iOS device you are running your tests on? We ran our tests on iPad Pros (5th and 6th generations)

0 Kudos
StarrLong
Emerging Contributor

I was wondering if you had been able to review my clarifying questions?

0 Kudos
AShahbaz
Esri Contributor

Sorry for the late response. Here is some more information

1. How are you able to diagnose that there were missing meshes in the file? Is there a tool in ArcGIS Pro for that? Did you read that in an error message somewhere? If so can you point us to some documentation?

What I meant by that is that in the app, not all meshes or the best textures are rendered. It is not related to the layer itself, but is an artifact that happens when there is not enough memory available to load further goemetry/textures. See below a screen capture. Once we added a (small enough) extent to the map, it loaded the entire geometries withing that extent.

Untitled Project.gif

 

2. You mention updating our .slpk with LODs. Can you point us to some documentation on how to do that? My cursory search could only find a mention of it as a feature but not how to use it.

I used this tool to convert your slpk to a newer i3s version. It added some finer LoDs for the textures, but the geometries still seem unaffected (see screen capture below). The way I test the existence of LoDs is to play the scene in the editor and manually change the "Quality Scaling Factor" under ArcGIS Camera Component and look for changes in the scene.

There is probably a way of integrating the LoD generation in your data creation workflow, but I am not familiar with that. I am sure someone else at Esri could point you to the right process. But in the meantime you could convert your slpk with the above tool and test it within your app to see if there is any improvement. You may want to try the tool with and without the -x option, which provides some optimization but has a big effect on the size of the output slpk. You could also set the "Quality Scaling Factor" in your app to a small value (e.g., 0.1) to see if it has any effect on the crash.

factor3.gif

 

3. While I understand how not having LODs or missing meshes might cause us to run out of memory at runtime I am confused because it feels a little counterintuitive because at initial load won't it actually increase the memory size due to the need to have the multiple assets to support the LODs? For us the crash happens as soon as we load the building layer.

 

4. You mention above that you were able to run an .slpk that is actually larger than the one that crashes for us. Your San Diego one is 360 mb while the one we sent you is only 204 mb. Am I to understand that if LODs are present the initial load in will be smaller and it will then dynamically stream in the rest of the file therefore preventing running out of memory?

To be clear, I am not sure if adding LoDs will resolve your issue because we haven't been able to reproduce the crash, but since we experienced memory issues with your slpk (as implied by the missing geometries/textures), this could be a place to start.

There are two different ways where memory is used. One is for unpacking the slpk into the memory. And you are right that adding LoDs will likely increase this memory need. The other one is the on-demand loading of the assets based on the location of the camera. Here, lack of LoDs will increase the memory demand since higher-quality geometries and textures will be loaded even for objects far away from the camera. For testing purposes, setting the quality scaling factor to a small value will be helpful in limiting the assets that are being loaded in the first place. Or, as mentioned before, adding an extent to the map could achieve the same. If you still hit the crash with a small extent, we are probably not on the right track.


Also can you please confirm which iOS device you are running your tests on? We ran our tests on iPad Pros (5th and 6th generations)

11-Inch iPad Pro (4th Generation) M2 chip, 8GB ram, 128GB storage, model number mnxd3ll/a. Could you please provide more details on your devices as well?

0 Kudos
StarrLong
Emerging Contributor

Thank you again for the answers!

We are testing primarily on 2 mobile devices (one older, one newer):

iPad Pro 3rd Gen: M1 Chip, 256 GB Storage, 8 GB RAM

iPad Pro 7th Gen: M4 Chip, 1 TB Storage, 16GB RAM

Is there a chance that because we had our slpk in an older version of the is3 format we could be triggering the fatal error? 

0 Kudos
AShahbaz
Esri Contributor

I can't say that for certain, but I doubt that the version per se would cause the error. The plugin supports versions 1.7 and higher (the one you shared was 1.7). It is possible though that the converter does some optimization/fixes along the way.

Trying to better understand the issue it would be interesting to know whether the crash still happens with (a) the updated slpk, (b) a map extent.

0 Kudos