Conversation
917c1a9 to
8448f5f
Compare
|
Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke! If it's expected, please add the M-Deliberate-Rendering-Change label. If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it. |
1 similar comment
|
Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke! If it's expected, please add the M-Deliberate-Rendering-Change label. If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it. |
|
Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke! If it's expected, please add the M-Deliberate-Rendering-Change label. If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it. |
1 similar comment
|
Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke! If it's expected, please add the M-Deliberate-Rendering-Change label. If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it. |
|
Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke! If it's expected, please add the M-Deliberate-Rendering-Change label. If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it. |
|
Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke! If it's expected, please add the M-Deliberate-Rendering-Change label. If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it. |
|
Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke! If it's expected, please add the M-Deliberate-Rendering-Change label. If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it. |
|
Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke! If it's expected, please add the M-Deliberate-Rendering-Change label. If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it. |
|
Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke! If it's expected, please add the M-Deliberate-Rendering-Change label. If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it. |
|
Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke! If it's expected, please add the M-Deliberate-Rendering-Change label. If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it. |
|
Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke! If it's expected, please add the M-Deliberate-Rendering-Change label. If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it. |
|
Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke! If it's expected, please add the M-Deliberate-Rendering-Change label. If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it. |
|
Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke! If it's expected, please add the M-Deliberate-Rendering-Change label. If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it. |
…one that turns main world StandardMaterial entities into a resource.
|
Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke! If it's expected, please add the M-Deliberate-Rendering-Change label. If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it. |
|
For some reason, CodeQL thinks logging UUIDs passed into I'm also not sure exactly why there's a rendering difference. I believe it is a boundary condition of some kind for texture atlases. Some discussion about it here: https://discord.com/channels/691052431525675048/743663673393938453/1472354467105083452 The diffs are very tiny though, and afaik this seems to be an ordering problem on main. |
|
Re the rendering difference, I had the exact same issue with that one example in another PR: #18465 (comment). Went away without me changing anything. |
Objective
Solution
Assetsresource.AssetHandleProviderinto a resource that can create any kind of handle.AssetCommandssystem param that spawns an entity and creates a handle for it.AssetServerhold aRemoveAllocatorand remote-allocate an entity when loading assets.AssetsandAssetsMutsystem params to replicate the oldAssetsAPI.I've done my best to keep this PR focused on the bare minimum for assets as entities. This also means I've had to do some weird back-porting. For example, I've needed to create a type ID to "sender" map to be able to send the appropriate
AssetEvent::Unusedwhen despawning an asset. In the future, this should be replaced by just an event, and then we don't need the type ID at all.Some features we get for free:
Assets::get_strong_handlehas different behaviour to one fromAssetServer::load. #20651: there's now no difference between handles created from the asset server orAssets. This also simplifies our handle dropping stuff.AssetUuidMap! Maybe no one will use this, but it's cool we can do this now!Some concerns with this feature/implementation.
AssetServer::loadorAssets::get_strong_handlefor that asset in the same frame, the asset won't be dropped and you will now have new handles to that asset. Based on discussion in Fix handles being split byasset_server_managed. #22261 (comment), it seems we are ok with that. This could be something to bring back in the future.Commandsparams: oneCommandsand anotherAssetCommands. Unfortunately these are applied in param order, not the order that commands are enqueued. So if the order isCommandsthenAssetCommands, and if a user spawns an asset throughAssetCommands, then enqueue a command that uses that entity, the entity will not have been spawned yet! This is discussed more in Shared State for System Param #22885. It's probably not a big deal, but if we care about removing this footrake, we can solve Shared State for System Param #22885.AssetServer::loadreturns aHandle::Entitywhich is a remote-allocated entity. It only gets actually allocated duringhandle_internal_asset_eventsinPreUpdate. I'm not entirely sure what the behavior is here with every feature: I assume that trying to access this entity (e.g., throughWorld::get_entity_mut) before it's actually allocated will return an error (or for panicking APIs, panic). This could be future work: we could splitAssetServerintoAssetServerSystemParam (which would allow us to not remote-allocate the entity), andRemoteAssetServer(which would remote-allocate the entity).AssetEventand the implementation is kind of rough. UUID handles in particular are not the most reliable. Changing which asset entity a UUID points to may break things - however this API wasn't even possible before so it's unlikely people will use it. In addition, we expect to deleteAssetEventin the future and replace it with change detection / observers. So this fix is duct tape, but that's ok.impl Into<A>. I've done this since we now have untypedAssetCommands::spawn_assetandworld.spawn_asset: we can't deduce the type ofAfrom this. So in many cases, we'd need to explicitly specify the asset type which seems silly especially when you doasset_commands.spawn_asset::<StandardMaterial>(StandardMaterial { .. }). This has the effect that things likeCuboidneed to be converted into aMesh, either through.into()orMesh::from.Testing