You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently assets can reference other assets via handles, but the Bevy asset system isn't aware of these dependencies. This hasn't really been a problem until now, but as we start making Bevy more event driven (ex: only updating an asset's RenderResources when the asset changes), this starts creating problems.
For example, when a ColorMaterial asset's referenced texture changes (same handle, different value) a new texture is created on the gpu and the old one is cleaned up because of the Texture AssetEvents. However the ColorMaterial RenderResources aren't updated to use the new RenderResourceId because the AssetRenderResourcesNode hasn't received a new ColorMaterial AssetEvent.
I think the right solution is to allow assets to enumerate their dependencies and use those dependencies to fire a new AssetEvent::DependencyEvent(AssetEvent) event. As AssetEvents are currently generic (AssetEvent) this clearly wont work for arbitrary dependency types.
The alternative solution is to handle depedencies on a case-by-case basis, but its hard to make that work for a generic abstraction like RenderResourceNodes.
Atelier-assets collects metadata about asset dependencies at Import-time by hooking into the Serialize implementation of Handle, meaning user code just needs to #[derive(Serialize)]. The system is fully aware of dependencies up-front, before any asset is loaded, which means dependencies can be guaranteed to be loaded before the asset itself. Metadata can even be analyzed offline or in-editor as the Import (parsing a source file and extracting assets) step is separate from loading the asset at runtime. Atelier-assets is designed with learnings from commercial asset systems like the one in Unity, and is built from the ground-up to work in an editor environment. PTAL and feel free to message me if you decide to have a closer look. https://github.com/amethyst/atelier-assets
Activity
kabergstrom commentedon Aug 10, 2020
Atelier-assets collects metadata about asset dependencies at Import-time by hooking into the
Serializeimplementation ofHandle, meaning user code just needs to#[derive(Serialize)]. The system is fully aware of dependencies up-front, before any asset is loaded, which means dependencies can be guaranteed to be loaded before the asset itself. Metadata can even be analyzed offline or in-editor as the Import (parsing a source file and extracting assets) step is separate from loading the asset at runtime. Atelier-assets is designed with learnings from commercial asset systems like the one in Unity, and is built from the ground-up to work in an editor environment. PTAL and feel free to message me if you decide to have a closer look.https://github.com/amethyst/atelier-assets
cart commentedon Oct 18, 2020
This is resolved by #693 and will be even more resolved by the upcoming atelier-assets migration.
Scale normal bias by texel size (#26)
Scale normal bias by texel size (#26)
Scale normal bias by texel size (#26)