From 5e700da3e80f98650f5124dc853f9bce9a1686e4 Mon Sep 17 00:00:00 2001 From: Brian Merchant Date: Wed, 5 Oct 2022 17:49:15 -0700 Subject: [PATCH 1/4] Add texture container support (ktx2 and dds). --- assets/hex-tiles.ktx2 | Bin 0 -> 31380 bytes examples/texture_container.rs | 92 ++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 assets/hex-tiles.ktx2 create mode 100644 examples/texture_container.rs diff --git a/assets/hex-tiles.ktx2 b/assets/hex-tiles.ktx2 new file mode 100644 index 0000000000000000000000000000000000000000..bfe71b9b0994db3c6eebe9396e673b28b6fe4003 GIT binary patch literal 31380 zcmeI52ar_7^T!WRK@deuh!V`05CJph0OqWiC<7=MKoJEqn9H1Vj)*yD3_o)$F~>7e z#=oegq6FvPpJBhRdgu0JkKJ2ttC*_3d9Pp3OwYWTp6;IBcXw{ROaHDtdpy~;b;s5# z*VNQBGw5NkrU9vi0XTp(*kEsi7YueVNYlbO!qLafc%qy#q~cVE4Gk5z{s(CftBU03UR=#c#rY)@+=gtCLN(#PO2gULDI zx=&-YRn9t%$Ib?04gNJ?xIKX5S?6-LS&q7lr`85z4E{0*ty{MaC!KUs_~n;hB5)0k zXE_>ZTbHBlQtB`snESgLd}$E*+h&_>LTzoWRhyr_{r20i&p!KvX3d(Z9}}(20E1>m zS@tq~ZVRLS{rBH+1cvM-3w1-MV!Pk38~7aZJqu)%fw_L-+38^)ATA z8+31IKdcPff#Js=e{2{NWuRv77&&rem}j1O)Q?HV(@2AP3iZSA{R}=di1dB? z_6;9=@Ie_kDXoh4-+w=BvBehZ1NjFAebooMW)Hg5Akr+q{PN+!2Oli0(MBl!zylA2 z<(6B{_XD2ceK5SwJMX;V?6c1f|NQe$BeY(gD&Y+t;Wanj@cu5>x8Htyc^aueE%2J- zAKs&k`TOs`E6{Rznt<0F|B-jDt1adDS3jza{fuw*quM$kzLn46zp^8saaUg1)=O_q zd@C=##>&vPqe-xcUbqn@8~7Q5@NyLz8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){RBJU=?R3O+r5CV0aQH>e(bZ}{M%Jj8~?M<;y;{Ns;59&KUYF2DWoYZE&!^*dl| z`hAb}o~|wC{!KUCBwk{Uk72jncFS7d{{I?#R51QfyfD|j++aT> zdEXrCCiOqD$4Qr@E@UD}`YJfimb^~}TaAQYN$sPTNDk!oLC7bl)=14 zQipesGa9~s_<%u-jYc<=UW2S5d7T2EaJp~fPxJe>{Kq~%jUl`WkA$Ok|g0*uMPq#bu$A>8`~Q8?i47O`E_jm-0*?3L z^<`{dlI#^|kZssjPGA1p@S_dN`v3c^+3bB--HJbCUdHi4M?$vCzT`cSyiSBHC3%_Z z)-v$}uNZVRlB})9ytcOZ{$Z^_>;pQS>{{#@lGn5F$CBiWQ#s3tbE;VUhOv-0KGt?# z{2_el9NX)?$k^onhyHG~0}N)%{}1*3FdkYP5WhrhQe4N(Yp?e@{e}1s{D<`+WjWu8+&U=SV?cR9oV?fNF;`f;2eHw$${|9gYkO}|* literal 0 HcmV?d00001 diff --git a/examples/texture_container.rs b/examples/texture_container.rs new file mode 100644 index 00000000..ea27e957 --- /dev/null +++ b/examples/texture_container.rs @@ -0,0 +1,92 @@ +use bevy::{prelude::*, render::texture::ImageSettings}; +use bevy_ecs_tilemap::helpers::hex_grid::axial::AxialPos; +use bevy_ecs_tilemap::prelude::*; +use rand::prelude::SliceRandom; +use rand::thread_rng; +mod helpers; + +const MAP_RADIUS: u32 = 10; +const MAP_DIAMETER: u32 = 2 * MAP_RADIUS + 1; +const MAP_CENTER: TilePos = TilePos { + x: MAP_RADIUS + 1, + y: MAP_RADIUS + 1, +}; +const TILE_SIZE: TilemapTileSize = TilemapTileSize { x: 48.0, y: 54.0 }; +const COORD_SYS: HexCoordSystem = HexCoordSystem::Row; + +fn startup(mut commands: Commands, asset_server: Res) { + commands.spawn_bundle(Camera2dBundle::default()); + + let texture_vec = TilemapTexture::TextureContainer(asset_server.load("hex-tiles.ktx2")); + + let map_size = TilemapSize { + x: MAP_DIAMETER, + y: MAP_DIAMETER, + }; + + let mut tile_storage = TileStorage::empty(map_size); + let tilemap_entity = commands.spawn().id(); + let tilemap_id = TilemapId(tilemap_entity); + + let tile_positions = generate_hexagon( + AxialPos::from_tile_pos_given_coord_system(&MAP_CENTER, COORD_SYS), + MAP_RADIUS, + ) + .into_iter() + .map(|axial_pos| axial_pos.as_tile_pos_given_coord_system(COORD_SYS)); + + let mut rng = thread_rng(); + let weighted_tile_choices = [ + (TileTexture(0), 0.8), + (TileTexture(1), 0.1), + (TileTexture(2), 0.1), + ]; + for position in tile_positions { + let texture = weighted_tile_choices + .choose_weighted(&mut rng, |choice| choice.1) + .unwrap() + .0; + let tile_entity = commands + .spawn() + .insert_bundle(TileBundle { + position, + tilemap_id, + texture, + ..Default::default() + }) + .id(); + tile_storage.set(&position, tile_entity); + } + + let tile_size = TILE_SIZE; + let grid_size = TILE_SIZE.into(); + + commands + .entity(tilemap_entity) + .insert_bundle(TilemapBundle { + grid_size, + tile_size, + size: map_size, + storage: tile_storage, + texture: texture_vec, + map_type: TilemapType::Hexagon(COORD_SYS), + transform: get_tilemap_center_transform(&map_size, &grid_size, 0.0), + ..Default::default() + }); +} + +fn main() { + App::new() + .insert_resource(WindowDescriptor { + width: 1270.0, + height: 720.0, + title: String::from("Using TilemapTexture::Vector instead of TilemapTexture::Single"), + ..Default::default() + }) + .insert_resource(ImageSettings::default_nearest()) + .add_plugins(DefaultPlugins) + .add_plugin(TilemapPlugin) + .add_startup_system(startup) + .add_system(helpers::camera::movement) + .run(); +} From ed7b3f24a0b0c0b7082040f2bfc8da79311cfa32 Mon Sep 17 00:00:00 2001 From: Brian Merchant Date: Wed, 5 Oct 2022 17:52:33 -0700 Subject: [PATCH 2/4] Texture container (ktx2 and dds) support. --- Cargo.toml | 4 +-- examples/texture_container.rs | 5 ++- examples/texture_vec.rs | 2 +- src/map/mod.rs | 13 ++++++++ src/render/extract.rs | 12 ++++++++ src/render/texture_array_cache.rs | 51 +++++++++++++++++++++++++++++++ 6 files changed, 83 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d937429d..20d4c8b2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,12 +30,12 @@ tiled = { version = "0.9", default-features = false } [dev-dependencies.bevy] version = "0.8" default-features = false -features=["bevy_core_pipeline", "bevy_render", "bevy_asset", "png", "bevy_winit", "bevy_text", "bevy_sprite", "filesystem_watcher"] +features=["bevy_core_pipeline", "bevy_render", "bevy_asset", "png", "ktx2", "bevy_winit", "bevy_text", "bevy_sprite", "filesystem_watcher"] [target.'cfg(unix)'.dev-dependencies.bevy] version = "0.8" default-features = false -features=["bevy_core_pipeline", "bevy_render", "bevy_asset", "png", "bevy_winit", "x11", "bevy_text", "bevy_sprite"] +features=["bevy_core_pipeline", "bevy_render", "bevy_asset", "png", "ktx2", "bevy_winit", "x11", "bevy_text", "bevy_sprite"] [target.wasm32-unknown-unknown] runner = "wasm-server-runner" diff --git a/examples/texture_container.rs b/examples/texture_container.rs index ea27e957..152a4ecd 100644 --- a/examples/texture_container.rs +++ b/examples/texture_container.rs @@ -17,6 +17,9 @@ const COORD_SYS: HexCoordSystem = HexCoordSystem::Row; fn startup(mut commands: Commands, asset_server: Res) { commands.spawn_bundle(Camera2dBundle::default()); + // Most of the work is happening bevy side. In this case, using the `ktx2` feature. If this + // feature is not turned on, that the image won't properly be interpreted as a texture + // container. The other alternative is `dds`. let texture_vec = TilemapTexture::TextureContainer(asset_server.load("hex-tiles.ktx2")); let map_size = TilemapSize { @@ -80,7 +83,7 @@ fn main() { .insert_resource(WindowDescriptor { width: 1270.0, height: 720.0, - title: String::from("Using TilemapTexture::Vector instead of TilemapTexture::Single"), + title: String::from("Using TilemapTexture::TextureContainer"), ..Default::default() }) .insert_resource(ImageSettings::default_nearest()) diff --git a/examples/texture_vec.rs b/examples/texture_vec.rs index be82169d..7839db96 100644 --- a/examples/texture_vec.rs +++ b/examples/texture_vec.rs @@ -85,7 +85,7 @@ fn main() { .insert_resource(WindowDescriptor { width: 1270.0, height: 720.0, - title: String::from("Using TilemapTexture::Vector instead of TilemapTexture::Single"), + title: String::from("Using TilemapTexture::Vector"), ..Default::default() }) .insert_resource(ImageSettings::default_nearest()) diff --git a/src/map/mod.rs b/src/map/mod.rs index 45f7295a..deca6e9c 100644 --- a/src/map/mod.rs +++ b/src/map/mod.rs @@ -89,6 +89,13 @@ pub enum TilemapTexture { /// available when `"atlas"` is not enabled. #[cfg(not(feature = "atlas"))] Vector(Vec>), + /// The tiles are provided as array layers inside a KTX2 or DDS container. + /// + /// This only makes sense to use when the `"atlas"` feature is NOT enabled, as texture arrays + /// are required to handle storing an array of textures. Therefore, this variant is only + /// available when `"atlas"` is not enabled. + #[cfg(not(feature = "atlas"))] + TextureContainer(Handle), } impl Default for TilemapTexture { @@ -110,6 +117,8 @@ impl TilemapTexture { TilemapTexture::Single(handle) => vec![handle], #[cfg(not(feature = "atlas"))] TilemapTexture::Vector(handles) => handles.iter().collect(), + #[cfg(not(feature = "atlas"))] + TilemapTexture::TextureContainer(handle) => vec![handle], } } @@ -156,6 +165,10 @@ impl TilemapTexture { TilemapTexture::Vector(handles) => { TilemapTexture::Vector(handles.iter().map(|h| h.clone_weak()).collect()) } + #[cfg(not(feature = "atlas"))] + TilemapTexture::TextureContainer(handle) => { + TilemapTexture::TextureContainer(handle.clone_weak()) + } } } } diff --git a/src/render/extract.rs b/src/render/extract.rs index e44763d8..7b33b47b 100644 --- a/src/render/extract.rs +++ b/src/render/extract.rs @@ -120,6 +120,18 @@ impl ExtractedTilemapTexture { } (handles.len() as u32, tile_size.into()) } + #[cfg(not(feature = "atlas"))] + TilemapTexture::TextureContainer(image_handle) => { + let image = image_assets.get(image_handle).expect( + "Expected image to have finished loading if \ + it is being extracted as a texture!", + ); + let tile_size: TilemapTileSize = image.size().into(); + ( + image.texture_descriptor.array_layer_count(), + tile_size.into(), + ) + } }; ExtractedTilemapTexture { diff --git a/src/render/texture_array_cache.rs b/src/render/texture_array_cache.rs index e5036a05..0e276fee 100644 --- a/src/render/texture_array_cache.rs +++ b/src/render/texture_array_cache.rs @@ -96,6 +96,17 @@ impl TextureArrayCache { } (handles.len() as u32, tile_size.into()) } + TilemapTexture::TextureContainer(handle) => { + let image = image_assets.get(handle).expect( + "Expected image to have finished loading if \ + it is being extracted as a texture!", + ); + let tile_size: TilemapTileSize = image.size().into(); + ( + image.texture_descriptor.array_layer_count(), + tile_size.into(), + ) + } }; if !self.meta_data.contains_key(&texture) { @@ -291,6 +302,46 @@ impl TextureArrayCache { ); } + let command_buffer = command_encoder.finish(); + render_queue.submit(vec![command_buffer]); + } + TilemapTexture::TextureContainer(handle) => { + let gpu_image = if let Some(gpu_image) = render_images.get(handle) { + gpu_image + } else { + self.prepare_queue.insert(texture.clone_weak()); + continue; + }; + + let (count, tile_size, _, _, _) = self.meta_data.get(texture).unwrap(); + let array_gpu_image = self.textures.get(texture).unwrap(); + let count = *count; + + let mut command_encoder = + render_device.create_command_encoder(&CommandEncoderDescriptor { + label: Some("create_texture_array_from_atlas"), + }); + + command_encoder.copy_texture_to_texture( + ImageCopyTexture { + texture: &gpu_image.texture, + mip_level: 0, + origin: Origin3d { x: 0, y: 0, z: 0 }, + aspect: TextureAspect::All, + }, + ImageCopyTexture { + texture: &array_gpu_image.texture, + mip_level: 0, + origin: Origin3d { x: 0, y: 0, z: 0 }, + aspect: TextureAspect::All, + }, + Extent3d { + width: tile_size.x as u32, + height: tile_size.y as u32, + depth_or_array_layers: count, + }, + ); + let command_buffer = command_encoder.finish(); render_queue.submit(vec![command_buffer]); } From 7ee65a5b7d5cf39e9b8c80f4c86bc75b07e1058a Mon Sep 17 00:00:00 2001 From: Brian Merchant Date: Wed, 5 Oct 2022 22:55:06 -0700 Subject: [PATCH 3/4] No need to copy_texture_to_texture; the texture container is already prepared for the GPU in the way we require. --- src/render/mod.rs | 4 +- src/render/texture_array_cache.rs | 159 +++++++++++++----------------- 2 files changed, 72 insertions(+), 91 deletions(-) diff --git a/src/render/mod.rs b/src/render/mod.rs index 65c278a9..5290f9cd 100644 --- a/src/render/mod.rs +++ b/src/render/mod.rs @@ -1,5 +1,6 @@ use std::marker::PhantomData; +use bevy::render::render_asset::RenderAssets; use bevy::{ asset::load_internal_asset, core_pipeline::core_2d::Transparent2d, @@ -309,10 +310,11 @@ fn prepare_textures( render_device: Res, mut texture_array_cache: ResMut, extracted_tilemap_textures: Query<&ExtractedTilemapTexture>, + render_images: Res>, ) { for extracted_texture in extracted_tilemap_textures.iter() { texture_array_cache.add_extracted_texture(extracted_texture); } - texture_array_cache.prepare(&render_device); + texture_array_cache.prepare(&render_device, &render_images); } diff --git a/src/render/texture_array_cache.rs b/src/render/texture_array_cache.rs index 0e276fee..8a9aaf83 100644 --- a/src/render/texture_array_cache.rs +++ b/src/render/texture_array_cache.rs @@ -127,64 +127,80 @@ impl TextureArrayCache { } /// Prepares each texture array texture - pub fn prepare(&mut self, render_device: &RenderDevice) { + pub fn prepare( + &mut self, + render_device: &RenderDevice, + render_images: &Res>, + ) { let prepare_queue = self.prepare_queue.drain().collect::>(); - for texture in prepare_queue { - let (count, tile_size, _, _, filter) = self.meta_data.get(&texture).unwrap(); + for texture in prepare_queue.iter() { + match texture { + TilemapTexture::Single(_) | TilemapTexture::Vector(_) => { + let (count, tile_size, _, _, filter) = self.meta_data.get(texture).unwrap(); - // Fixes weird cubemap bug. - let count = if *count == 6 { count + 1 } else { *count }; + // Fixes weird cubemap bug. + let count = if *count == 6 { count + 1 } else { *count }; - let gpu_texture = render_device.create_texture(&TextureDescriptor { - label: Some("texture_array"), - size: Extent3d { - width: tile_size.x as u32, - height: tile_size.y as u32, - depth_or_array_layers: count, - }, - mip_level_count: 1, - sample_count: 1, - dimension: TextureDimension::D2, - format: TextureFormat::Rgba8UnormSrgb, - usage: TextureUsages::COPY_DST | TextureUsages::TEXTURE_BINDING, - }); + let gpu_texture = render_device.create_texture(&TextureDescriptor { + label: Some("texture_array"), + size: Extent3d { + width: tile_size.x as u32, + height: tile_size.y as u32, + depth_or_array_layers: count, + }, + mip_level_count: 1, + sample_count: 1, + dimension: TextureDimension::D2, + format: TextureFormat::Rgba8UnormSrgb, + usage: TextureUsages::COPY_DST | TextureUsages::TEXTURE_BINDING, + }); - let sampler = render_device.create_sampler(&SamplerDescriptor { - label: Some("texture_array_sampler"), - address_mode_u: AddressMode::ClampToEdge, - address_mode_v: AddressMode::ClampToEdge, - address_mode_w: AddressMode::ClampToEdge, - mag_filter: *filter, - min_filter: *filter, - mipmap_filter: *filter, - lod_min_clamp: 0.0, - lod_max_clamp: f32::MAX, - compare: None, - anisotropy_clamp: None, - border_color: None, - }); + let sampler = render_device.create_sampler(&SamplerDescriptor { + label: Some("texture_array_sampler"), + address_mode_u: AddressMode::ClampToEdge, + address_mode_v: AddressMode::ClampToEdge, + address_mode_w: AddressMode::ClampToEdge, + mag_filter: *filter, + min_filter: *filter, + mipmap_filter: *filter, + lod_min_clamp: 0.0, + lod_max_clamp: f32::MAX, + compare: None, + anisotropy_clamp: None, + border_color: None, + }); - let texture_view = gpu_texture.create_view(&TextureViewDescriptor { - label: Some("texture_array_view"), - format: None, - dimension: Some(TextureViewDimension::D2Array), - aspect: TextureAspect::All, - base_mip_level: 0, - mip_level_count: None, - base_array_layer: 0, - array_layer_count: NonZeroU32::new(count), - }); + let texture_view = gpu_texture.create_view(&TextureViewDescriptor { + label: Some("texture_array_view"), + format: None, + dimension: Some(TextureViewDimension::D2Array), + aspect: TextureAspect::All, + base_mip_level: 0, + mip_level_count: None, + base_array_layer: 0, + array_layer_count: NonZeroU32::new(count), + }); - let gpu_image = GpuImage { - texture_format: TextureFormat::bevy_default(), - texture: gpu_texture, - sampler, - texture_view, - size: tile_size.into(), - }; + let gpu_image = GpuImage { + texture_format: TextureFormat::bevy_default(), + texture: gpu_texture, + sampler, + texture_view, + size: tile_size.into(), + }; - self.textures.insert(texture.clone_weak(), gpu_image); - self.queue_queue.insert(texture.clone_weak()); + self.textures.insert(texture.clone_weak(), gpu_image); + self.queue_queue.insert(texture.clone_weak()); + } + TilemapTexture::TextureContainer(handle) => { + if let Some(gpu_image) = render_images.get(handle) { + self.textures + .insert(texture.clone_weak(), gpu_image.clone()); + } else { + self.prepare_queue.insert(texture.clone_weak()); + } + } + } } } @@ -305,45 +321,8 @@ impl TextureArrayCache { let command_buffer = command_encoder.finish(); render_queue.submit(vec![command_buffer]); } - TilemapTexture::TextureContainer(handle) => { - let gpu_image = if let Some(gpu_image) = render_images.get(handle) { - gpu_image - } else { - self.prepare_queue.insert(texture.clone_weak()); - continue; - }; - - let (count, tile_size, _, _, _) = self.meta_data.get(texture).unwrap(); - let array_gpu_image = self.textures.get(texture).unwrap(); - let count = *count; - - let mut command_encoder = - render_device.create_command_encoder(&CommandEncoderDescriptor { - label: Some("create_texture_array_from_atlas"), - }); - - command_encoder.copy_texture_to_texture( - ImageCopyTexture { - texture: &gpu_image.texture, - mip_level: 0, - origin: Origin3d { x: 0, y: 0, z: 0 }, - aspect: TextureAspect::All, - }, - ImageCopyTexture { - texture: &array_gpu_image.texture, - mip_level: 0, - origin: Origin3d { x: 0, y: 0, z: 0 }, - aspect: TextureAspect::All, - }, - Extent3d { - width: tile_size.x as u32, - height: tile_size.y as u32, - depth_or_array_layers: count, - }, - ); - - let command_buffer = command_encoder.finish(); - render_queue.submit(vec![command_buffer]); + TilemapTexture::TextureContainer(_) => { + // do nothing, we already have the necessary GPU image } } } From 4627478869d28c8dc7dc9eaf4cae0f24f7feae50 Mon Sep 17 00:00:00 2001 From: StarToaster Date: Thu, 6 Oct 2022 11:15:33 -0400 Subject: [PATCH 4/4] Added mipmaps to hex-tiles.ktx2. --- assets/hex-tiles.ktx2 | Bin 31380 -> 11280 bytes examples/texture_container.rs | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/hex-tiles.ktx2 b/assets/hex-tiles.ktx2 index bfe71b9b0994db3c6eebe9396e673b28b6fe4003..44e00e7ce5f5ca3b82dab52743c37ea2337ccb89 100644 GIT binary patch literal 11280 zcmeI23w#vSxx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{fnA^4_V|Xp|A6;K?5Wx$$9|Je#69~EzpL{!%>8t1 ze){RBJU=?R3O+r5CV0aQH>e(bZ}{M%Jj8~?M<;y;{Ns;59&KUYF2DWoYZE&!^*dl| z`hAb}o~|wC{!KUCBwk{Uk72jncFS7d{{I?#R51QfyfD|j++aT> zdEXrCCiOqD$4Qr@E@UD}`YJfimb^~}TaAQYN$sPTNDk!oLC7bl)=14 zQipesGa9~s_<%u-jYc<=UW2S5d7T2EaJp~fPxJe>{Kq~%jUl`WkA$Ok|g0*uMPq#bu$A>8`~Q8?i47O`E_jm-0*?3L z^<`{dlI#^|kZssjPGA1p@S_dN`v3c^+3bB--HJbCUdHi4M?$vCzT`cSyiSBHC3%_Z z)-v$}uNZVRlB})9ytcOZ{$Z^_>;pQS>{{#@lGn5F$CBiWQ#s3tbE;VUhOv-0KGt?# z{2_el9NX)?$k^onhyHG~0}N)%{}1*3FdkYP5WhrhQe4N(Yp?e@{e}1s{D<`+WjWu8+&U=SV?cR9oV?fNF;`f;2eHw$${|9gYkO}|* diff --git a/examples/texture_container.rs b/examples/texture_container.rs index 152a4ecd..37e51723 100644 --- a/examples/texture_container.rs +++ b/examples/texture_container.rs @@ -86,7 +86,7 @@ fn main() { title: String::from("Using TilemapTexture::TextureContainer"), ..Default::default() }) - .insert_resource(ImageSettings::default_nearest()) + .insert_resource(ImageSettings::default_linear()) .add_plugins(DefaultPlugins) .add_plugin(TilemapPlugin) .add_startup_system(startup)