bevy/crates
Robert Swain 05e5008624 Support array / cubemap / cubemap array textures in KTX2 (#5325)
# Objective

- Fix / support KTX2 array / cubemap / cubemap array textures
- Fixes #4495 . Supersedes #4514 .

## Solution

- Add `Option<TextureViewDescriptor>` to `Image` to enable configuration of the `TextureViewDimension` of a texture.
  - This allows users to set `D2Array`, `D3`, `Cube`, `CubeArray` or whatever they need
  - Automatically configure this when loading KTX2
- Transcode all layers and faces instead of just one
- Use the UASTC block size of 128 bits, and the number of blocks in x/y for a given mip level in order to determine the offset of the layer and face within the KTX2 mip level data
- `wgpu` wants data ordered as layer 0 mip 0..n, layer 1 mip 0..n, etc. See https://docs.rs/wgpu/latest/wgpu/util/trait.DeviceExt.html#tymethod.create_texture_with_data
- Reorder the data KTX2 mip X layer Y face Z to `wgpu` layer Y face Z mip X order
- Add a `skybox` example to demonstrate / test loading cubemaps from PNG and KTX2, including ASTC 4x4, BC7, and ETC2 compression for support everywhere. Note that you need to enable the `ktx2,zstd` features to be able to load the compressed textures.

---

## Changelog

- Fixed: KTX2 array / cubemap / cubemap array textures
- Fixes: Validation failure for compressed textures stored in KTX2 where the width/height are not a multiple of the block dimensions.
- Added: `Image` now has an `Option<TextureViewDescriptor>` field to enable configuration of the texture view. This is useful for configuring the `TextureViewDimension` when it is not just a plain 2D texture and the loader could/did not identify what it should be.

Co-authored-by: Carter Anderson <mcanders1@gmail.com>
2022-07-30 07:02:58 +00:00
..
bevy_animation Update codebase to use IntoIterator where possible. (#5269) 2022-07-11 15:28:50 +00:00
bevy_app remove blanket Serialize + Deserialize requirement for Reflect on generic types (#5197) 2022-07-21 14:57:37 +00:00
bevy_asset Fix various typos (#5417) 2022-07-21 20:46:54 +00:00
bevy_audio Fix various typos (#5417) 2022-07-21 20:46:54 +00:00
bevy_core Export and register Mat2. (#5324) 2022-07-15 22:37:06 +00:00
bevy_core_pipeline update wgpu to 0.13 (#5168) 2022-07-14 21:17:16 +00:00
bevy_derive Add attribute to ignore fields of derived labels (#5366) 2022-07-19 05:21:19 +00:00
bevy_diagnostic Cleanups in diagnostics (#3871) 2022-06-20 17:02:25 +00:00
bevy_dylib Bump Bevy to 0.8.0-dev (#4505) 2022-04-17 23:04:52 +00:00
bevy_dynamic_plugin Bump Bevy to 0.8.0-dev (#4505) 2022-04-17 23:04:52 +00:00
bevy_ecs Replace many_for_each_mut with iter_many_mut. (#5402) 2022-07-30 01:38:13 +00:00
bevy_ecs_compile_fail_tests Replace many_for_each_mut with iter_many_mut. (#5402) 2022-07-30 01:38:13 +00:00
bevy_encase_derive Updated glam to 0.21. (#5142) 2022-07-03 19:55:33 +00:00
bevy_gilrs Improve Gamepad DPad Button Detection (#5220) 2022-07-11 14:11:25 +00:00
bevy_gltf Fix comment typo (#5421) 2022-07-22 15:04:32 +00:00
bevy_hierarchy Update codebase to use IntoIterator where possible. (#5269) 2022-07-11 15:28:50 +00:00
bevy_input Fix various typos (#5417) 2022-07-21 20:46:54 +00:00
bevy_internal Lighter no default features (#5447) 2022-07-25 15:48:14 +00:00
bevy_log Remove the dependency cycles (#5171) 2022-07-04 13:04:18 +00:00
bevy_macro_utils Derive AsBindGroup Improvements: Better errors, more options, update examples (#5364) 2022-07-19 22:05:43 +00:00
bevy_math Export and register Mat2. (#5324) 2022-07-15 22:37:06 +00:00
bevy_mikktspace Minimally fix the known unsoundness in bevy_mikktspace (#5299) 2022-07-16 08:37:18 +00:00
bevy_pbr Spotlight shadow bugfix (#5451) 2022-07-25 16:24:54 +00:00
bevy_ptr Fix OwningPtr docs (#5391) 2022-07-20 13:16:28 +00:00
bevy_reflect fix bevy_reflect README (#5477) 2022-07-29 20:01:51 +00:00
bevy_render Support array / cubemap / cubemap array textures in KTX2 (#5325) 2022-07-30 07:02:58 +00:00
bevy_scene Add VisibilityBundle and use it to fix gltfs, scenes, and examples (#5335) 2022-07-16 02:47:23 +00:00
bevy_sprite removed duplicated doc line in material.rs (#5405) 2022-07-20 21:39:51 +00:00
bevy_tasks Very minor doc formatting changes (#5287) 2022-07-12 13:06:16 +00:00
bevy_text text rendering: convert colours only once per section (#5474) 2022-07-28 13:34:56 +00:00
bevy_time Fix various typos (#5417) 2022-07-21 20:46:54 +00:00
bevy_transform Fix various typos (#5417) 2022-07-21 20:46:54 +00:00
bevy_ui text rendering: convert colours only once per section (#5474) 2022-07-28 13:34:56 +00:00
bevy_utils improve documentation for macro-generated label types (#5367) 2022-07-20 19:39:42 +00:00
bevy_window Fix comment typo (#5421) 2022-07-22 15:04:32 +00:00
bevy_winit Change window position types from tuple to vec (#5276) 2022-07-11 14:36:23 +00:00