bevy/crates
ickshonpe 9afe666f6d
UI texture atlas slice shader (#14990)
Fixes https://github.com/bevyengine/bevy/issues/14183

Reimplement the UI texture atlas slicer using a shader.

The problems with #14183 could be fixed more simply by hacking around
with the coordinates and scaling but that way is very fragile and might
get broken again the next time we make changes to the layout
calculations. A shader based solution is more robust, it's impossible
for gaps to appear between the image slices with these changes as we're
only drawing a single quad.

I've not tried any benchmarks yet but it should much more efficient as
well, in the worst cases even hundreds or thousands of times faster.

Maybe could have used the UiMaterialPipeline. I wrote the shader first
and used fat vertices and then realised it wouldn't work that way with a
UiMaterial. If it's rewritten it so it puts all the slice geometry in
uniform buffer, then it might work? Adding the uniform buffer would
probably make the shader more complicated though, so don't know if it's
even worth it. Instancing is another alternative.

The examples are working and it seems to match the old API correctly but
I've not used the texture atlas slicing API for anything before, I
reviewed the PR but that was back in January.

Needs a review by someone who knows the rendering pipeline and wgsl
really well because I don't really have any idea what I'm doing.
2024-09-05 21:39:43 +02:00
..
bevy_a11y Release 0.14.1 2024-08-02 20:35:38 +02:00
bevy_animation Don't require going through bevy_animation::prelude to get to certain items in bevy_animation (#14979) 2024-09-05 21:35:40 +02:00
bevy_app Release 0.14.1 2024-08-02 20:35:38 +02:00
bevy_asset Release 0.14.1 2024-08-02 20:35:38 +02:00
bevy_audio Release 0.14.1 2024-08-02 20:35:38 +02:00
bevy_color Fix hue mixing for Lcha and Oklcha (#14468) 2024-09-05 21:34:05 +02:00
bevy_core Release 0.14.1 2024-08-02 20:35:38 +02:00
bevy_core_pipeline Fix TAA on camera with viewport (#14582) 2024-09-05 21:35:40 +02:00
bevy_derive Release 0.14.1 2024-08-02 20:35:38 +02:00
bevy_dev_tools Release 0.14.1 2024-08-02 20:35:38 +02:00
bevy_diagnostic Release 0.14.1 2024-08-02 20:35:38 +02:00
bevy_dylib Release 0.14.1 2024-08-02 20:35:38 +02:00
bevy_dynamic_plugin Release 0.14.1 2024-08-02 20:35:38 +02:00
bevy_ecs Fix commands not being Send / Sync in 0.14 (#14392) 2024-09-05 21:35:40 +02:00
bevy_encase_derive Release 0.14.1 2024-08-02 20:35:38 +02:00
bevy_gilrs Release 0.14.1 2024-08-02 20:35:38 +02:00
bevy_gizmos Fix Gizmo joint rendering in webgpu (#14721) 2024-09-05 21:35:40 +02:00
bevy_gltf Release 0.14.1 2024-08-02 20:35:38 +02:00
bevy_hierarchy Release 0.14.1 2024-08-02 20:35:38 +02:00
bevy_input Release 0.14.1 2024-08-02 20:35:38 +02:00
bevy_internal Release 0.14.1 2024-08-02 20:35:38 +02:00
bevy_log Release 0.14.1 2024-08-02 20:35:38 +02:00
bevy_macro_utils Release 0.14.1 2024-08-02 20:35:38 +02:00
bevy_math Release 0.14.1 2024-08-02 20:35:38 +02:00
bevy_mikktspace Release 0.14.1 2024-08-02 20:35:38 +02:00
bevy_pbr Don’t prepare lights (and shadow map textures) for 2D cameras (#14574) 2024-09-05 21:34:05 +02:00
bevy_ptr Release 0.14.1 2024-08-02 20:35:38 +02:00
bevy_reflect Making DynamicEnum::is_dynamic() return true (#14732) 2024-09-05 21:35:40 +02:00
bevy_render Release 0.14.1 2024-08-02 20:35:38 +02:00
bevy_scene Release 0.14.1 2024-08-02 20:35:38 +02:00
bevy_sprite Release 0.14.1 2024-08-02 20:35:38 +02:00
bevy_state Release 0.14.1 2024-08-02 20:35:38 +02:00
bevy_tasks Release 0.14.1 2024-08-02 20:35:38 +02:00
bevy_text Release 0.14.1 2024-08-02 20:35:38 +02:00
bevy_time Release 0.14.1 2024-08-02 20:35:38 +02:00
bevy_transform Release 0.14.1 2024-08-02 20:35:38 +02:00
bevy_ui UI texture atlas slice shader (#14990) 2024-09-05 21:39:43 +02:00
bevy_utils Release 0.14.1 2024-08-02 20:35:38 +02:00
bevy_window Release 0.14.1 2024-08-02 20:35:38 +02:00
bevy_winit Release 0.14.1 2024-08-02 20:35:38 +02:00