Replaces the CPU pixel-baking quilter system (QuiltCache, TerrainSprite, pixel_buffers) with Bevy's native TilemapChunk GPU-index-lookup API. Architecture: - TilemapChunk entities replace TerrainSprite entities per (chunk, z, layer) - Tileset PNG stacked vertically as texture_2d_array (11 rows: 6 floor + 5 fixture) - populate_chunk_tiles reads TileMap HashMap directly; no ECS FloorTile entities - Chunk spawn deferred to apply_terrain_blobs (after TileMap data exists) - Dirty key system triggers repopulate on occlusion/camera-z changes Bug fixes: - populate_chunk_tiles: add chunk_pos offset to world tile lookups (was always (0,0)) - spawn_tilemap_chunks: offset Transform by -TILE_SIZE/2 (tile-centre vs bottom-left) - spawn_tilemap_chunks: AlphaMode2d::Blend (was Opaque, blocking DF fade) - update_tilemap_chunk_visibility: actually mutate Visibility (was read-only) - handle_tile_occlusion_updates: mark dirty keys inline (was double-reading events) - TilemapChunkSpawner: deduplicate pending queue and guard stale registry Performance: - ~115K FloorTile ECS entities eliminated - GPU memory: O(tile_data) instead of O(CHUNK_TILES² × z_levels × pixel_bytes) - Z-scroll: only TilemapChunkTileData repopulates (no entity re-spawn) - Benchmarks via TilemapBenchmark resource (F9 to report)
39 lines
775 B
TOML
39 lines
775 B
TOML
[package]
|
|
name = "dorf"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
|
|
[dependencies]
|
|
bevy = { version = "0.18.1", features = ["wayland"] }
|
|
noise = "0.9.0"
|
|
rand = "0.10.0"
|
|
bevy_rand = { version = "0.14.2", features = ["wyrand"] }
|
|
image = "0.25.10"
|
|
bevy_platform = "0.18.1"
|
|
serde = { version = "1.0", features = ["derive"] }
|
|
toml = "0.9.8"
|
|
rayon = "1.11.0"
|
|
rustc-hash = "2.1.1"
|
|
ahash = "0.8.12"
|
|
nohash-hasher = "0.2.0"
|
|
futures-lite = "2.6.1"
|
|
|
|
[build-dependencies]
|
|
image = "0.25.10"
|
|
|
|
# Enable max optimizations for dependencies, but not for our code:
|
|
[profile.dev.package."*"]
|
|
opt-level = 3
|
|
|
|
# Enable only a small amount of optimization in debug mode
|
|
[profile.dev]
|
|
opt-level = 1
|
|
debug = true
|
|
|
|
[profile.release]
|
|
lto = true
|
|
opt-level = 3
|
|
codegen-units = 1
|
|
incremental = false
|
|
debug = false
|