NexusSocial / nexus-vr

Monorepo for most code
Apache License 2.0
18 stars 7 forks source link

Progressive Asset Loading #73

Open MalekiRe opened 6 months ago

MalekiRe commented 6 months ago

Issue Summary

Currently we use bevy's asset loader unmodified for loading GLTF worlds and vrm avatars. This causes massive amounts of lag because it will load them as soon as possible.

Proposed Solution

Add purposeful delay to loading, either performance based ( measuring current frame times and when dipping below them stop loading new parts of assets ) or just fixed ( load a new model node every 0.1 seconds ).

Drawbacks / Side effects

This will show assets slowly loading in, and is used opposed to progress bars / waiting areas. In VR friction is huge, and having people immediately teleport to new worlds, and then progressively load assets is an alternative that I personally prefer.

Other

We can draw gizmo's for players heads and hands while they aren't loaded for others, as well as do some sort of physical fixing to origin until the floor has been confirmed to be loaded or something, to ensure you don't fall through the world with physics / character controller when loading.

MalekiRe commented 6 months ago

Appears to actually just be a slow down caused by bevy's rendering pipeline which should get fixed in the next few versions

SafariMonkey commented 6 months ago

@MalekiRe I am guessing you are talking about the delay during shader compilation, in which case I think we're waiting on https://github.com/bevyengine/bevy/pull/10812 to be able to do that in the background. It won't stop it being slow, but we can at least serve frames in the meantime.