Lazy Loading with Hooks and Custom Material support#35
Open
g4borg wants to merge 2 commits into
Open
Conversation
7 tasks
Added three features on top of upstream bevy_sprite3d v8.0: 1. Async Asset Loading - Sprites no longer panic when assets aren't loaded - Uses WaitingSprites resource and IoTaskPool for deferred construction - Graceful error handling with warnings instead of panics 2. User-Provided Material Support - Detects when user provides MeshMaterial3d before Sprite3d - Preserves user material settings, only overrides texture fields - New Sprite3dUserMaterial marker component 3. Sprite.color Tinting Support - Sprite.color now applies as base_color tint on cached materials - Added base_color to MatKey for proper caching Also adds bevy_log feature for warning messages.
These files document the fork-specific features and can be excluded from PRs to the upstream repository.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I was inspired by @vertesians pull request to fork Sprite3d and implement on top of it the same kind of lazy loading with hooks.
Additionally, I wanted to have the support to supply custom materials, or just set the color of a 3d Sprite as well quickly, so I added a more hybrid approach to the material handling: one can either provide a full Material in the bundle to finetune all sorts of settings, or just set Sprite.color.
I also expanded the caching with the color.
Now I am sorry, but before I even realized, I had code formatted the files I touched, and I have yet to come back to it and clean up a few repetititions. If this is really a problem, I can try to manually format it back before rustfmt kicked in.
I am perfectly aware, that his pull request might be a bit big, and not accepted, but as the other one inspired me to do this, maybe it can also inspire yet another take until such features come into the official crate.
I personally just needed these features already :)