-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Description
When loading a large number (multiple thousands) of PrefabLightmapData objects into a scene, the lookup time for the corresponding lighting data is prohibitively time-consuming.
Expected Behavior
The time should be as near linear as possible with the number of different PrefabLightmapData prefabs not on their instances.
Actual Behavior
As the number of prefabs increases that use the PrefabLightmapData component, the time that it takes to load that data increases.
Steps to Reproduce
- Bake a prefab using the light mapping tool
- Create a new scene and create a large number of instances of that single prefab
- Run the scene and take note of the time it takes to load
- Add more of the same prefab
- Run the scene and take note of the time it takes to load
Context
In a production game that could potentially use thousands of these prefab instances, the time it takes to load the assets makes changing scenes a time-consuming task. For end users, this load time may negatively impact their experience.
Possible Fix
Create a more sophisticated caching mechanism that lives in the scene (perhaps as a singleton) that can register prefabs (that are loaded and use a dictionary or some other container) to check for and later assign lighting assets as needed.