playcanvas / playcanvas/engine
AssetListLoader should load dependencies for all asset types
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 16.8k
- Forks
- 2k
- Avg merge
- 4h 32m
- Merged PRs (30d)
- 222
Description
Currently AssetListLoader is only loading dependencies of asset type model.
My use case:
When switching between scenes I want to use the AssetListLoader to preload all assets and show a progress bar.
I parse the scene and create a list of all assets which need to be loaded.
Let's say the scene contains a render component. When loading the render component the glb won't be loaded with it.
This results in pop in, when changing the scene.
There are multiple asset types, where this problem occurs:
| Asset Type | Missing dependencies |
|---|---|
| cubemap | textures |
| material | textures |
| render | glb |
| ... | ... |
There are 2 solutions to this problem:
- Handle loading of dependencies in AssetListLoader (similar to model asset type)
- Handle loading in AssetRegistry.load. (When a asset is loaded, always load it's dependencies)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read src/framework/asset/asset-list-loader.js at the linked lines and compare its current model dependency handling with src/framework/asset/asset-registry.js around line 388. Trace how cubemap, material, and render assets are loaded, then determine which approach ensures their listed dependencies are loaded before the asset-list progress completes and prevents scene-switching pop-in.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100