Hubs-Foundation / hubs

Duck-themed multi-user virtual spaces in WebVR. Built with A-Frame.
https://hubsfoundation.org
Mozilla Public License 2.0
2.13k stars 1.41k forks source link

Better determining the default material quality on mobile devices #5234

Open takahirox opened 2 years ago

takahirox commented 2 years ago

Is your feature request related to a problem? Please describe.

Currently Hubs sets low material quality for all mobile devices. But new mobile devices are getting more powerful and powerful. They may be powerful enough to run Hubs with medium or high material quality.

Describe the solution you'd like

We may want to improve the determination of setting the default material quality on mobile devices. For example, Hubs may be able to detect device models or their GPU and determine the best quality mode from them.

Additional context

Even if their mobile devices are powerful enough, some (or most) of them may still prefer low material quality mode for saving battery. How we should do for such scenarios? Poping up the preference dialog for selecting material quality mode when they enter a room at first time? Improving the discoverability with material quality mode?

rawnsley commented 2 years ago

Any heuristic based on the reported environment is going to be difficult. Browsers don't always tell the truth and there are factors outside the reported parameters that influence performance. The mapping of environment to recommended quality is also going to be complex and imprecise.

Scene complexity is the other critical factor and turning raw model statistics into a single measure of "drawability" is ambiguous at best.

Eventually you will be dividing these two approximations by each other and comparing the result with an empirical threshold. This is an open-ended and highly subjective piece of work.

I would suggest we consider a more direct approach based simply on dropped frames. There would be some subjectivity in how long a period you measure and how many drops is too many, but these a more closely aligned with user experience.

The biggest challenge I can see with this approach is that it can only be determined at runtime whereas the heuristic can be evaluated before the page loads. This is particularly relevant because the material quality is currently fixed during a session and the page must be reloaded. A runtime request to reload the page could work "Would you like to switch to low quality?", but it's not an ideal user experience.

If quality could be adjusted at runtime this approach would not only work, but would open up other opportunities to tune performance. For instance, imposing model LoD limits or reducing animation evaluation for distance objects.