Mobile-specific optimizations

(Maximelebled) #1

Hi—I love to use Sketchfab in order to be able to showcase my work fast and easy to people who don't necessarily know what 3D work entails. It's really great for that purpose. However, while all the graphical bells and whistles work great on a computer, they don't always behave nicely on a phone, ESPECIALLY for animated content.

For example, this model of mine performs decently enough on my Galaxy S7... but it's quite jittery in its performance, which is unfortunate when animated:

What might be interesting is being able to disable certain things on mobile. It could be in the player, sure, and in a way, we already have that through the model inspector, but that disables ALL post-processing effects. And my model up there really benefits from the tonemapping, for example—but it could still look great on mobile without bloom and dynamic shadows.

For example, tagging post effects or material effects as "don't enable this on mobile", e.g. subsurface scattering, bloom, SSAO. Same for the "enable shadows" flag on lights.

VR already force disables certain things for the sake of performance, but I would argue it's a special case; when it comes to mobile, offering fine-grained control of what you know you can disable and get away with it would be great.

But sometimes your model is just too detailed, and being able to specify a lower-detailed mesh for mobile might be nice... but I'm sure that's a feature that would get complicated real fast. That said, I'm sure it would really benefit people who want to share photogrammetry and 3D scans.

It might also be cool to have some kind of performance visualizer tool that tells us what is the most expensive thing in our scene—perhaps as part of the model inspector panel... though it is true that this seldom changes when it comes to mobile phones: it's probably going to be 1) vert count 2) dynamic shadows 3) bloom, from what I understand.


Thanks for your feedback and interesting ideas. Sounds like you have already read this article, but I'll include it anyway:

We have a few internal tools for debugging model performance beyond the Model Inspector and stats in Model Information, but none of them are quite ready to be public/user-facing yet.

Giving the user control over mobile features on individual models is intriguing. However, I worry that a a bloated editor interface and educating users on how to use them could be problematic.

In the future, we hope to implement LOD and serve different resolution meshes depending on machine specs. Potentially, we could implement some techniques to load the higher resolution as you zoom in.

For this specific model, your post-processing filters are adding 40-50ms per frame (Bloom alone accounts for about half of that).

You have quite a lot of bones, but otherwise the model does not seem to be particularly complex. @paul_sketch or @stephomi probably has more insight.

(Stephomi) #3

Note that there's a bug that make static shadows acts as dynamic shadows at the moment. It will be fixed soon.
Although with animated models, it's always going to be dynamic when the timeline is playing.

LOD and different resolution meshes is not planned yet and even if we do, it'll only potentially improve experience on high poly models (>1M polys).

We could give insight on what is potentially the "most expensive thing", but sometimes dependent of the device where you'll run it.
If you use a 4k screen but still use an Intel HD gpu instead of the dedicated one. Fillrates and postprocesses will probably be the botteneck.
IPhone's cpu tends to be very effective, which makes cpu bottleneck less of an issue, such as scene hierarchy operations ( number of nodes/transform/geometries/bones/channels/rigs), unlike many androids.

Although a bit hacky, using the model inspector can help pinpoint some particular issues:
- if you see a big difference between postprocess/no postprocess
- if your model is still slow on matcap view, then culprit is probably the polyount or scene hierarchy

That being said, your model is running fine on my nexus 5x, and I don't see any clear change between inspector mode.
Note that for animated models, we don't perform some scene optimization that we do on static scene (bake and flatten as much as we can).