diff --git a/Cargo.lock b/Cargo.lock index c177fca24..34a9a26f8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -20,24 +20,24 @@ checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" [[package]] name = "accesskit" -version = "0.11.2" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76eb1adf08c5bcaa8490b9851fd53cca27fa9880076f178ea9d29f05196728a8" +checksum = "6cb10ed32c63247e4e39a8f42e8e30fb9442fbf7878c8e4a9849e7e381619bea" [[package]] name = "accesskit_consumer" -version = "0.15.2" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04bb4d9e4772fe0d47df57d0d5dbe5d85dd05e2f37ae1ddb6b105e76be58fb00" +checksum = "8c17cca53c09fbd7288667b22a201274b9becaa27f0b91bf52a526db95de45e6" dependencies = [ "accesskit", ] [[package]] name = "accesskit_macos" -version = "0.9.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134d0acf6acb667c89d3332999b1a5df4edbc8d6113910f392ebb73f2b03bb56" +checksum = "cd3b6ae1eabbfbced10e840fd3fce8a93ae84f174b3e4ba892ab7bcb42e477a7" dependencies = [ "accesskit", "accesskit_consumer", @@ -47,23 +47,23 @@ dependencies = [ [[package]] name = "accesskit_windows" -version = "0.14.3" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eac0a7f2d7cd7a93b938af401d3d8e8b7094217989a7c25c55a953023436e31" +checksum = "afcae27ec0974fc7c3b0b318783be89fd1b2e66dd702179fe600166a38ff4a0b" dependencies = [ "accesskit", "accesskit_consumer", - "arrayvec", "once_cell", "paste", + "static_assertions", "windows 0.48.0", ] [[package]] name = "accesskit_winit" -version = "0.14.4" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "825d23acee1bd6d25cbaa3ca6ed6e73faf24122a774ec33d52c5c86c6ab423c0" +checksum = "88e39fcec2e10971e188730b7a76bab60647dacc973d4591855ebebcadfaa738" dependencies = [ "accesskit", "accesskit_macos", @@ -470,6 +470,12 @@ dependencies = [ "num-traits", ] +[[package]] +name = "arrayref" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" + [[package]] name = "arrayvec" version = "0.7.4" @@ -510,6 +516,16 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "async-broadcast" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c48ccdbf6ca6b121e0f586cbc0e73ae440e56c67c30fa0873b4e110d9c26d2b" +dependencies = [ + "event-listener 2.5.3", + "futures-core", +] + [[package]] name = "async-channel" version = "1.9.0" @@ -561,6 +577,18 @@ dependencies = [ "slab", ] +[[package]] +name = "async-fs" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "279cf904654eeebfa37ac9bb1598880884924aab82e290aa65c9e77a0e142e06" +dependencies = [ + "async-lock 2.8.0", + "autocfg", + "blocking", + "futures-lite 1.13.0", +] + [[package]] name = "async-global-executor" version = "2.4.1" @@ -798,18 +826,18 @@ dependencies = [ [[package]] name = "bevy" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91c6d3ec4f89e85294dc97334c5b271ddc301fdf67ac9bb994fe44d9273e6ed7" +checksum = "e4bc7e09282a82a48d70ade0c4c1154b0fd7882a735a39c66766a5d0f4718ea9" dependencies = [ "bevy_internal", ] [[package]] name = "bevy_a11y" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "132c9e35a77c5395951f6d25fa2c52ee92296353426df4f961e60f3ff47e2e42" +checksum = "68080288c932634f6563d3a8299efe0ddc9ea6787539c4c771ba250d089a94f0" dependencies = [ "accesskit", "bevy_app", @@ -819,9 +847,9 @@ dependencies = [ [[package]] name = "bevy_animation" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f44eae3f1c35a87e38ad146f72317f19ce7616dad8bbdfb88ee752c1282d28c5" +checksum = "7aa37683b1281e1ba8cf285644e6e3f0704f14b3901c5ee282067ff7ff6f4a56" dependencies = [ "bevy_app", "bevy_asset", @@ -838,9 +866,9 @@ dependencies = [ [[package]] name = "bevy_app" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f557a7d59e1e16892d7544fc37316506ee598cb5310ef0365125a30783c11531" +checksum = "d41731817993f92e4363dd3335558e779e290bc71eefc0b5547052b85810907e" dependencies = [ "bevy_derive", "bevy_ecs", @@ -854,26 +882,29 @@ dependencies = [ [[package]] name = "bevy_asset" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9714af523da4cdf58c42a317e5ed40349708ad954a18533991fd64c8ae0a6f68" +checksum = "935984568f75867dd7357133b06f4b1502cd2be55e4642d483ce597e46e63bff" dependencies = [ - "anyhow", - "async-channel 1.9.0", + "async-broadcast", + "async-fs", + "async-lock 2.8.0", "bevy_app", - "bevy_diagnostic", + "bevy_asset_macros", "bevy_ecs", "bevy_log", "bevy_reflect", "bevy_tasks", "bevy_utils", "bevy_winit", + "blake3", "crossbeam-channel", "downcast-rs", - "fastrand 1.9.0", + "futures-io", + "futures-lite 1.13.0", "js-sys", - "notify", "parking_lot 0.12.1", + "ron", "serde", "thiserror", "wasm-bindgen", @@ -881,13 +912,24 @@ dependencies = [ "web-sys", ] +[[package]] +name = "bevy_asset_macros" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f48b9bbe4ec605e4910b5cd1e1a0acbfbe0b80af5f3bcc4489a9fdd1e80058c" +dependencies = [ + "bevy_macro_utils", + "proc-macro2", + "quote", + "syn 2.0.50", +] + [[package]] name = "bevy_audio" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4de308bd63a2f7a0b77ffeb7cf00cc185ec01393c5db2091fe03964f97152749" +checksum = "18a69889e1bfa4dbac4e641536b94f91c441da55796ad9832e77836b8264688b" dependencies = [ - "anyhow", "bevy_app", "bevy_asset", "bevy_derive", @@ -897,15 +939,14 @@ dependencies = [ "bevy_transform", "bevy_utils", "oboe", - "parking_lot 0.12.1", "rodio", ] [[package]] name = "bevy_core" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d5272321be5fcf5ce2fb16023bc825bb10dfcb71611117296537181ce950f48" +checksum = "3daa24502a14839509f02407bc7e48299fe84d260877de23b60662de0f4f4b6c" dependencies = [ "bevy_app", "bevy_ecs", @@ -918,15 +959,16 @@ dependencies = [ [[package]] name = "bevy_core_pipeline" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67382fa9c96ce4f4e5833ed7cedd9886844a8f3284b4a717bd4ac738dcdea0c3" +checksum = "b4b77c4fca6e90edbe2e72da7bc9aa7aed7dfdfded0920ae0a0c845f5e11084a" dependencies = [ "bevy_app", "bevy_asset", "bevy_core", "bevy_derive", "bevy_ecs", + "bevy_log", "bevy_math", "bevy_reflect", "bevy_render", @@ -939,9 +981,9 @@ dependencies = [ [[package]] name = "bevy_derive" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44e4e2784a81430199e4157e02903a987a32127c773985506f020e7d501b62e" +checksum = "f484318350462c58ba3942a45a656c1fd6b6e484a6b6b7abc3a787ad1a51e500" dependencies = [ "bevy_macro_utils", "quote", @@ -950,9 +992,9 @@ dependencies = [ [[package]] name = "bevy_diagnostic" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6babb230dc383c98fdfc9603e3a7a2a49e1e2879dbe8291059ef37dca897932e" +checksum = "fa38ca5967d335cc1006a0e0f1a86c350e2f15fd1878449f61d04cd57a7c4060" dependencies = [ "bevy_app", "bevy_core", @@ -965,9 +1007,9 @@ dependencies = [ [[package]] name = "bevy_ecs" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266144b36df7e834d5198049e037ecdf2a2310a76ce39ed937d1b0a6a2c4e8c6" +checksum = "7709fbd22f81fb681534cd913c41e1cd18b17143368743281195d7f024b61aea" dependencies = [ "async-channel 1.9.0", "bevy_ecs_macros", @@ -986,9 +1028,9 @@ dependencies = [ [[package]] name = "bevy_ecs_macros" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7157a9c3be038d5008ee3f114feb6cf6b39c1d3d32ee21a7cacb8f81fccdfa80" +checksum = "a8843aa489f159f25cdcd9fee75cd7d221a7098a71eaa72cb2d6b40ac4e3f1ba" dependencies = [ "bevy_macro_utils", "proc-macro2", @@ -998,9 +1040,9 @@ dependencies = [ [[package]] name = "bevy_encase_derive" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0ac0f55ad6bca1be7b0f35bbd5fc95ed3d31e4e9db158fee8e5327f59006001" +checksum = "5328a3715e933ebbff07d0e99528dc423c4f7a53590ed1ac19a120348b028990" dependencies = [ "bevy_macro_utils", "encase_derive_impl", @@ -1008,9 +1050,9 @@ dependencies = [ [[package]] name = "bevy_gilrs" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65f4d79c55829f8016014593a42453f61a564ffb06ef79460d25696ccdfac67b" +checksum = "9b81ca2ebf66cbc7f998f1f142b15038ffe3c4ae1d51f70adda26dcf51b0c4ca" dependencies = [ "bevy_app", "bevy_ecs", @@ -1024,9 +1066,9 @@ dependencies = [ [[package]] name = "bevy_gizmos" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e286a3e7276431963f4aa29165ea5429fa7dbbc6d5c5ba0c531e7dd44ecc88a2" +checksum = "db232274ddca2ae452eb2731b98267b795d133ddd14013121bc7daddde1c7491" dependencies = [ "bevy_app", "bevy_asset", @@ -1044,11 +1086,10 @@ dependencies = [ [[package]] name = "bevy_gltf" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f07494a733dca032e71a20f4b1f423de765da49cbff34406ae6cd813f9b50c41" +checksum = "85adc6b1fc86687bf67149e0bafaa4d6da432232fa956472d1b37f19121d3ace" dependencies = [ - "anyhow", "base64 0.13.1", "bevy_animation", "bevy_app", @@ -1075,9 +1116,9 @@ dependencies = [ [[package]] name = "bevy_hierarchy" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "103f8f58416ac6799b8c7f0b418f1fac9eba44fa924df3b0e16b09256b897e3d" +checksum = "06bd477152ce2ae1430f5e0a4f19216e5785c22fee1ab23788b5982dc59d1a55" dependencies = [ "bevy_app", "bevy_core", @@ -1090,9 +1131,9 @@ dependencies = [ [[package]] name = "bevy_input" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffbd935401101ac8003f3c3aea70788c65ad03f7a32716a10608bedda7a648bc" +checksum = "cab9a599189b2a694c182d60cd52219dd9364f9892ff542d87799b8e45d9e6dc" dependencies = [ "bevy_app", "bevy_ecs", @@ -1104,9 +1145,9 @@ dependencies = [ [[package]] name = "bevy_internal" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0e35a9b2bd29aa784b3cc416bcbf2a298f69f00ca51fd042ea39d9af7fad37e" +checksum = "f124bece9831afd80897815231072d51bfe3ac58c6bb58eca8880963b6d0487c" dependencies = [ "bevy_a11y", "bevy_animation", @@ -1143,22 +1184,23 @@ dependencies = [ [[package]] name = "bevy_kira_audio" -version = "0.16.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc50583e632d0173437cb618077f957c1eb7a9eef9bce107fbf9f90b22e4f84" +checksum = "9a9678086759e54871faab0829592423492e19f8de5076127315cf892ae56f33" dependencies = [ "anyhow", "bevy", "kira", "parking_lot 0.12.1", "thiserror", + "uuid", ] [[package]] name = "bevy_log" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07dcc615ff4f617b06c3f9522fca3c55d56f9644db293318f8ab68fcdea5d4fe" +checksum = "0dc10ba1d225a8477b9e80a1bf797d8a8b8274e83c9b24fb4d9351aec9229755" dependencies = [ "android_log-sys", "bevy_app", @@ -1172,21 +1214,22 @@ dependencies = [ [[package]] name = "bevy_macro_utils" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23ddc18d489b4e57832d4958cde7cd2f349f0ad91e5892ac9e2f2ee16546b981" +checksum = "e566640c6b6dced73d2006c764c2cffebe1a82be4809486c4a5d7b4b50efed4d" dependencies = [ + "proc-macro2", "quote", "rustc-hash", "syn 2.0.50", - "toml_edit", + "toml_edit 0.20.7", ] [[package]] name = "bevy_math" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78286a81fead796dc4b45ab14f4f02fe29a94423d3587bcfef872b2a8e0a474b" +checksum = "58ddc2b76783939c530178f88e5711a1b01044d7b02db4033e2eb8b43b6cf4ec" dependencies = [ "glam 0.24.2", "serde", @@ -1194,18 +1237,18 @@ dependencies = [ [[package]] name = "bevy_mikktspace" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cfc2a21ea47970a9b1f0f4735af3256a8f204815bd756110051d10f9d909497" +checksum = "8ec4962977a746d870170532fc92759e04d3dbcae8b7b82e7ca3bb83b1d75277" dependencies = [ "glam 0.24.2", ] [[package]] name = "bevy_pbr" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63ca796a619e61cd43a0a3b11fde54644f7f0732a1fba1eef5d406248c6eba85" +checksum = "520bfd2a898c74f84ea52cfb8eb061f37373ad15e623489d5f75d27ebd6138fe" dependencies = [ "bevy_app", "bevy_asset", @@ -1220,21 +1263,24 @@ dependencies = [ "bevy_window", "bitflags 2.4.2", "bytemuck", + "fixedbitset", "naga_oil", "radsort", + "smallvec", + "thread_local", ] [[package]] name = "bevy_ptr" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c7586401a46f7d8e436028225c1df5288f2e0082d066b247a82466fea155c6" +checksum = "c77ec20c8fafcdc196508ef5ccb4f0400a8d193cb61f7b14a36ed9a25ad423cf" [[package]] name = "bevy_reflect" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0778197a1eb3e095a71417c74b7152ede02975cdc95b5ea4ddc5251ed00a2eb5" +checksum = "d7921f15fc944c9c8ad01d7dbcea6505b8909c6655cd9382bab1407181556038" dependencies = [ "bevy_math", "bevy_ptr", @@ -1243,8 +1289,6 @@ dependencies = [ "downcast-rs", "erased-serde", "glam 0.24.2", - "once_cell", - "parking_lot 0.12.1", "serde", "smallvec", "smol_str", @@ -1253,12 +1297,11 @@ dependencies = [ [[package]] name = "bevy_reflect_derive" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "342a4b2d09db22c48607d23ad59a056aff1ee004549050a51d490d375ba29528" +checksum = "b4a8c5475f216e751ef4452a1306b00711f33d2d04d9f149e4c845dfeb6753a0" dependencies = [ "bevy_macro_utils", - "bit-set", "proc-macro2", "quote", "syn 2.0.50", @@ -1267,11 +1310,10 @@ dependencies = [ [[package]] name = "bevy_render" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39df4824b760928c27afc7b00fb649c7a63c9d76661ab014ff5c86537ee906cb" +checksum = "bdefdd3737125b0d94a6ff20bb70fa8cfe9d7d5dcd72ba4dfe6c5f1d30d9f6e4" dependencies = [ - "anyhow", "async-channel 1.9.0", "bevy_app", "bevy_asset", @@ -1302,8 +1344,6 @@ dependencies = [ "ktx2", "naga", "naga_oil", - "parking_lot 0.12.1", - "regex", "ruzstd", "serde", "smallvec", @@ -1312,14 +1352,13 @@ dependencies = [ "wasm-bindgen", "web-sys", "wgpu", - "wgpu-hal", ] [[package]] name = "bevy_render_macros" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bd08c740aac73363e32fb45af869b10cec65bcb76fe3e6cd0f8f7eebf4c36c9" +checksum = "64d86bfc5a1e7fbeeaec0c4ceab18155530f5506624670965db3415f75826bea" dependencies = [ "bevy_macro_utils", "proc-macro2", @@ -1329,11 +1368,10 @@ dependencies = [ [[package]] name = "bevy_scene" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd47e1263506153bef3a8be97fe2d856f206d315668c4f97510ca6cc181d9681" +checksum = "e7df078b5e406e37c8a1c6ba0d652bf105fde713ce3c3efda7263fe27467eee5" dependencies = [ - "anyhow", "bevy_app", "bevy_asset", "bevy_derive", @@ -1351,9 +1389,9 @@ dependencies = [ [[package]] name = "bevy_sprite" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a8ca824fad75c6ef74cfbbba0a4ce3ccc435fa23d6bf3f003f260548813397" +checksum = "c7cc0c9d946e17e3e0aaa202f182837bc796c4f862b2e5a805134f873f21cf7f" dependencies = [ "bevy_app", "bevy_asset", @@ -1370,15 +1408,16 @@ dependencies = [ "bytemuck", "fixedbitset", "guillotiere", + "radsort", "rectangle-pack", "thiserror", ] [[package]] name = "bevy_tasks" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c73bbb847c83990d3927005090df52f8ac49332e1643d2ad9aac3cd2974e66bf" +checksum = "f4fefa7fe0da8923525f7500e274f1bd60dbd79918a25cf7d0dfa0a6ba15c1cf" dependencies = [ "async-channel 1.9.0", "async-executor", @@ -1390,12 +1429,11 @@ dependencies = [ [[package]] name = "bevy_text" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692288ab7b0a9f8b38058964c52789fc6bcb63703b23de51cce90ec41bfca355" +checksum = "3a9a79d49ca06170d69149949b134c14e8b99ace1444c1ca2cd4743b19d5b055" dependencies = [ "ab_glyph", - "anyhow", "bevy_app", "bevy_asset", "bevy_ecs", @@ -1413,9 +1451,9 @@ dependencies = [ [[package]] name = "bevy_time" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d58d6dbae9c8225d8c0e0f04d2c5dbb71d22adc01ecd5ab3cebc364139e4a6d" +checksum = "e6250d76eed3077128b6a3d004f9f198b01107800b9824051e32bb658054e837" dependencies = [ "bevy_app", "bevy_ecs", @@ -1427,22 +1465,23 @@ dependencies = [ [[package]] name = "bevy_transform" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9b0ac0149a57cd846cb357a35fc99286f9848e53d4481954608ac9552ed2d4" +checksum = "d541e0c292edbd96afae816ee680e02247422423ccd5dc635c1e211a20ed64be" dependencies = [ "bevy_app", "bevy_ecs", "bevy_hierarchy", "bevy_math", "bevy_reflect", + "thiserror", ] [[package]] name = "bevy_ui" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b6d295a755e5b79e869a09e087029d72974562a521ec7ccfba7141fa948a32" +checksum = "d785e3b75dabcb2a8ad0d50933f8f3446d59e512cabc2d2a145e28c2bb8792ba" dependencies = [ "bevy_a11y", "bevy_app", @@ -1470,15 +1509,16 @@ dependencies = [ [[package]] name = "bevy_utils" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d9484e32434ea84dc548cff246ce0c6f756c1336f5ea03f24ac120a48595c7" +checksum = "7915222f4a08ccc782e08d10b751b42e5f9d786e697d0cb3fd09333cb7e8b6ea" dependencies = [ "ahash 0.8.9", "bevy_utils_proc_macros", "getrandom", "hashbrown 0.14.3", "instant", + "nonmax", "petgraph", "thiserror", "tracing", @@ -1487,9 +1527,9 @@ dependencies = [ [[package]] name = "bevy_utils_proc_macros" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5391b242c36f556db01d5891444730c83aa9dd648b6a8fd2b755d22cb3bddb57" +checksum = "7aafecc952b6b8eb1a93c12590bd867d25df2f4ae1033a01dfdfc3c35ebccfff" dependencies = [ "proc-macro2", "quote", @@ -1498,10 +1538,11 @@ dependencies = [ [[package]] name = "bevy_window" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd584c0da7c4ada6557b09f57f30fb7cff21ccedc641473fc391574b4c9b7944" +checksum = "41ee72bf7f974000e9b31bb971a89387f1432ba9413f35c4fef59fef49767260" dependencies = [ + "bevy_a11y", "bevy_app", "bevy_ecs", "bevy_input", @@ -1513,9 +1554,9 @@ dependencies = [ [[package]] name = "bevy_winit" -version = "0.11.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfdc044abdb95790c20053e6326760f0a2985f0dcd78613d397bf35f16039d53" +checksum = "1eb71f287eca9006dda998784c7b931e400ae2cc4c505da315882a8b082f21ad" dependencies = [ "accesskit_winit", "approx", @@ -1605,6 +1646,19 @@ dependencies = [ "serde", ] +[[package]] +name = "blake3" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", +] + [[package]] name = "block" version = "0.1.6" @@ -1950,6 +2004,12 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87ca1caa64ef4ed453e68bb3db612e51cf1b2f5b871337f0fcab1c8f87cc3dff" +[[package]] +name = "constant_time_eq" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" + [[package]] name = "constgebra" version = "0.1.3" @@ -2001,7 +2061,7 @@ dependencies = [ "bitflags 1.3.2", "core-foundation", "core-graphics-types", - "foreign-types", + "foreign-types 0.3.2", "libc", ] @@ -2197,12 +2257,12 @@ dependencies = [ [[package]] name = "d3d12" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8f0de2f5a8e7bd4a9eec0e3c781992a4ce1724f68aec7d7a3715344de8b39da" +checksum = "e16e44ab292b1dddfdaf7be62cfd8877df52f2f3fde5858d95bab606be259f20" dependencies = [ - "bitflags 1.3.2", - "libloading 0.7.4", + "bitflags 2.4.2", + "libloading 0.8.1", "winapi", ] @@ -2463,6 +2523,7 @@ dependencies = [ "de_types", "futures-lite 1.13.0", "iyes_progress", + "tracing", ] [[package]] @@ -2563,6 +2624,7 @@ dependencies = [ "de_types", "futures-lite 1.13.0", "thiserror", + "tracing", ] [[package]] @@ -2670,6 +2732,7 @@ dependencies = [ "rstar", "spade", "tinyvec", + "tracing", ] [[package]] @@ -3124,7 +3187,28 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" dependencies = [ - "foreign-types-shared", + "foreign-types-shared 0.1.1", +] + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared 0.3.1", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.50", ] [[package]] @@ -3133,6 +3217,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + [[package]] name = "form_urlencoded" version = "1.2.1" @@ -3142,15 +3232,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "fsevent-sys" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2" -dependencies = [ - "libc", -] - [[package]] name = "futures" version = "0.3.30" @@ -3322,7 +3403,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0af1827b7dd2f36d740ae804c1b3ea0d64c12533fb61ff91883005143a0e8c5a" dependencies = [ "core-foundation", - "inotify 0.10.2", + "inotify", "io-kit-sys", "js-sys", "libc", @@ -3443,21 +3524,21 @@ dependencies = [ [[package]] name = "gpu-alloc" -version = "0.5.4" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22beaafc29b38204457ea030f6fb7a84c9e4dd1b86e311ba0542533453d87f62" +checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.2", "gpu-alloc-types", ] [[package]] name = "gpu-alloc-types" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54804d0d6bc9d7f26db4eaec1ad10def69b599315f487d32c334a80d1efe67a5" +checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.2", ] [[package]] @@ -3797,17 +3878,6 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a257582fdcde896fd96463bf2d40eefea0580021c0712a0e2b028b60b47a837a" -[[package]] -name = "inotify" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff" -dependencies = [ - "bitflags 1.3.2", - "inotify-sys", - "libc", -] - [[package]] name = "inotify" version = "0.10.2" @@ -3913,9 +3983,9 @@ checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "iyes_progress" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3f093e3b8f18730767ecf5b60c455b4f6b806d3c79ae2a31ca89d285718d635" +checksum = "1ed260fda0df8ed859329f221a5eb24175d38fd7d10f586cf6468574e6385b79" dependencies = [ "bevy_app", "bevy_ecs", @@ -4020,26 +4090,6 @@ dependencies = [ "symphonia", ] -[[package]] -name = "kqueue" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7447f1ca1b7b563588a205fe93dea8df60fd981423a768bc1c0ded35ed147d0c" -dependencies = [ - "kqueue-sys", - "libc", -] - -[[package]] -name = "kqueue-sys" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed9625ffda8729b85e45cf04090035ac368927b8cebc34898e7c120f52e4838b" -dependencies = [ - "bitflags 1.3.2", - "libc", -] - [[package]] name = "ktx2" version = "0.3.0" @@ -4253,16 +4303,17 @@ dependencies = [ [[package]] name = "metal" -version = "0.24.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de11355d1f6781482d027a3b4d4de7825dcedb197bf573e0596d00008402d060" +checksum = "623b5e6cefd76e58f774bd3cc0c6f5c7615c58c03a97815245a25c3c9bdee318" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.2", "block", "core-graphics-types", - "foreign-types", + "foreign-types 0.5.0", "log", "objc", + "paste", ] [[package]] @@ -4307,12 +4358,12 @@ dependencies = [ [[package]] name = "naga" -version = "0.12.3" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbcc2e0513220fd2b598e6068608d4462db20322c0e77e47f6f488dfcfc279cb" +checksum = "c1ceaaa4eedaece7e4ec08c55c640ba03dbb73fb812a6570a59bcf1930d0f70e" dependencies = [ "bit-set", - "bitflags 1.3.2", + "bitflags 2.4.2", "codespan-reporting", "hexf-parse", "indexmap 1.9.3", @@ -4328,9 +4379,9 @@ dependencies = [ [[package]] name = "naga_oil" -version = "0.8.2" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8be942a5c21c58b9b0bf4d9b99db3634ddb7a916f8e1d1d0b71820cc4150e56b" +checksum = "4ac54c77b3529887f9668d3dd81e955e58f252b31a333f836e3548c06460b958" dependencies = [ "bit-set", "codespan-reporting", @@ -4339,7 +4390,7 @@ dependencies = [ "naga", "once_cell", "regex", - "regex-syntax 0.6.29", + "regex-syntax 0.7.5", "rustc-hash", "thiserror", "tracing", @@ -4467,23 +4518,10 @@ dependencies = [ ] [[package]] -name = "notify" -version = "6.1.1" +name = "nonmax" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" -dependencies = [ - "bitflags 2.4.2", - "crossbeam-channel", - "filetime", - "fsevent-sys", - "inotify 0.9.6", - "kqueue", - "libc", - "log", - "mio", - "walkdir", - "windows-sys 0.48.0", -] +checksum = "610a5acd306ec67f907abe5567859a3c693fb9886eb1f012ab8f2a47bef3db51" [[package]] name = "ntapi" @@ -4764,7 +4802,7 @@ checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" dependencies = [ "bitflags 2.4.2", "cfg-if", - "foreign-types", + "foreign-types 0.3.2", "libc", "once_cell", "openssl-macros", @@ -5165,7 +5203,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", - "toml_edit", + "toml_edit 0.19.15", ] [[package]] @@ -5348,6 +5386,12 @@ version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +[[package]] +name = "regex-syntax" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" + [[package]] name = "regex-syntax" version = "0.8.2" @@ -6389,6 +6433,17 @@ dependencies = [ "winnow", ] +[[package]] +name = "toml_edit" +version = "0.20.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" +dependencies = [ + "indexmap 2.2.3", + "toml_datetime", + "winnow", +] + [[package]] name = "tower-service" version = "0.3.2" @@ -6641,6 +6696,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" dependencies = [ "getrandom", + "rand", "serde", ] @@ -6828,9 +6884,9 @@ dependencies = [ [[package]] name = "wgpu" -version = "0.16.3" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "480c965c9306872eb6255fa55e4b4953be55a8b64d57e61d7ff840d3dcc051cd" +checksum = "752e44d3998ef35f71830dd1ad3da513e628e2e4d4aedb0ab580f850827a0b41" dependencies = [ "arrayvec", "cfg-if", @@ -6852,9 +6908,9 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "0.16.1" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f478237b4bf0d5b70a39898a66fa67ca3a007d79f2520485b8b0c3dfc46f8c2" +checksum = "0f8a44dd301a30ceeed3c27d8c0090433d3da04d7b2a4042738095a424d12ae7" dependencies = [ "arrayvec", "bit-vec", @@ -6875,9 +6931,9 @@ dependencies = [ [[package]] name = "wgpu-hal" -version = "0.16.2" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ecb3258078e936deee14fd4e0febe1cfe9bbb5ffef165cb60218d2ee5eb4448" +checksum = "9a80bf0e3c77399bb52850cb0830af9bad073d5cfcb9dd8253bef8125c42db17" dependencies = [ "android_system_properties", "arrayvec", @@ -6887,7 +6943,6 @@ dependencies = [ "block", "core-graphics-types", "d3d12", - "foreign-types", "glow", "gpu-alloc", "gpu-allocator", @@ -6917,9 +6972,9 @@ dependencies = [ [[package]] name = "wgpu-types" -version = "0.16.1" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c153280bb108c2979eb5c7391cb18c56642dd3c072e55f52065e13e2a1252a" +checksum = "ee64d7398d0c2f9ca48922c902ef69c42d000c759f3db41e355f4a570b052b67" dependencies = [ "bitflags 2.4.2", "js-sys", diff --git a/Cargo.toml b/Cargo.toml index 9f7123e13..0fd914e92 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -119,7 +119,7 @@ assert_cmd = "2.0.10" async-compat = "0.2.1" async-std = "1.11" async-tar = "0.4.2" -bevy_kira_audio = { version = "0.16.0", features = ["mp3"] } +bevy_kira_audio = { version = "0.18", features = ["mp3"] } bincode = "2.0.0-rc.3" chrono = "0.4.24" clap = { version = "4.0", features = ["derive"] } @@ -135,7 +135,7 @@ futures-lite = "1.13.0" glam = "0.24" gltf = "1.0" itertools = "0.11.0" -iyes_progress = "0.9.0" +iyes_progress = "0.10.0" log = "0.4.17" nalgebra = { version = "0.32.3", features = ["convert-glam024"] } nix = "0.26.2" @@ -164,7 +164,7 @@ url = { version = "2.3.1", features = ["serde"] } urlencoding = "2.1.2" [workspace.dependencies.bevy] -version = "0.11" +version = "0.12" default-features = false features = [ "animation", @@ -185,7 +185,6 @@ features = [ "ktx2", "zstd", "x11", - "filesystem_watcher", "bevy_gizmos", "android_shared_stdcxx", "tonemapping_luts", diff --git a/assets/shaders/bar.wgsl b/assets/shaders/bar.wgsl index 747f84bf6..9b81bcf7e 100644 --- a/assets/shaders/bar.wgsl +++ b/assets/shaders/bar.wgsl @@ -1,5 +1,7 @@ -#import bevy_pbr::mesh_bindings mesh -#import bevy_pbr::mesh_functions mesh_position_local_to_clip +#import bevy_pbr::{ + mesh_bindings::mesh, + mesh_functions::{get_model_matrix, mesh_position_local_to_clip}, +} const BACKGROUND_COLOR = vec4(0., 0., 0., 0.75); const FOREGROUND_COLOR = vec4(0.6, 1., 0.6, 0.75); @@ -8,6 +10,7 @@ const FOREGROUND_COLOR = vec4(0.6, 1., 0.6, 0.75); var value: f32; struct Vertex { + @builtin(instance_index) instance_index: u32, @location(0) position: vec2, @location(1) uv: vec2, }; @@ -25,7 +28,10 @@ struct FragmentInput { fn vertex(vertex: Vertex) -> VertexOutput { var out: VertexOutput; - out.clip_position = mesh_position_local_to_clip(mesh.model, vec4(0., 0., 0., 1.0)); + out.clip_position = mesh_position_local_to_clip( + get_model_matrix(vertex.instance_index), + vec4(0., 0., 0., 1.0), + ); let scale = max(1., out.clip_position.w / 40.); out.clip_position += vec4(scale * vertex.position, 0., 0.); diff --git a/assets/shaders/rally_point.wgsl b/assets/shaders/rally_point.wgsl index fccf56d43..1860f9a87 100644 --- a/assets/shaders/rally_point.wgsl +++ b/assets/shaders/rally_point.wgsl @@ -1,6 +1,8 @@ -#import bevy_pbr::mesh_view_bindings globals -#import bevy_pbr::mesh_bindings mesh -#import bevy_pbr::mesh_vertex_output MeshVertexOutput +#import bevy_pbr::{ + forward_io::VertexOutput, + mesh_bindings::mesh, + mesh_view_bindings::globals, +} struct CustomMaterial { color: vec4, @@ -23,9 +25,10 @@ const FADE: f32 = 3.; @fragment fn fragment( - in: MeshVertexOutput, + in: VertexOutput, ) -> @location(0) vec4 { - let world_space_length: f32 = length(mesh.model[0].xyz); + let model = mesh[in.instance_index].model; + let world_space_length: f32 = length(vec3(model[0][0], model[1][0], model[2][0])); let scaled_x: f32 = in.uv.x * world_space_length; let offset_y: f32 = abs(in.uv.y - 0.5) * POINTINESS; let scaled_time: f32 = globals.time * SPEED; diff --git a/assets/shaders/terrain.wgsl b/assets/shaders/terrain.wgsl index bf50ffdc2..71fe62a65 100644 --- a/assets/shaders/terrain.wgsl +++ b/assets/shaders/terrain.wgsl @@ -1,13 +1,13 @@ -#import bevy_pbr::mesh_vertex_output MeshVertexOutput -#import bevy_pbr::mesh_bindings mesh -#import bevy_pbr::mesh_view_bindings view -#import bevy_core_pipeline::tonemapping tone_mapping -#import bevy_pbr::pbr_functions PbrInput, pbr_input_new, prepare_world_normal, apply_normal_mapping, calculate_view, pbr -#import bevy_pbr::pbr_types as pbr_types - +#import bevy_pbr::{ + forward_io::{VertexOutput, FragmentOutput}, + pbr_fragment::pbr_input_from_standard_material, + pbr_functions::{ + alpha_discard, + apply_pbr_lighting, + main_pass_post_lighting_processing, + }, +} -// How large (in meters) is a texture. -const TEXTURE_SIZE = 16.; const SHAPE_COLOR = vec4(1., 1., 1., 0.75); const SHAPE_THICKNESS = 0.15; // Keep these array lengths in sync with /crates/terrain/src/shader.rs. @@ -34,15 +34,12 @@ struct Rectangles { count: u32, }; -@group(1) @binding(0) +@group(1) @binding(100) +var uv_scale: f32; +@group(1) @binding(101) var circles: KdTree; -@group(1) @binding(1) +@group(1) @binding(102) var rectangles: Rectangles; -@group(1) @binding(2) -var terrain_texture: texture_2d; -@group(1) @binding(3) -var terrain_sampler: sampler; - fn mix_colors(base: vec4, cover: vec4) -> vec4 { let alpha = base.a * cover.a; let rgb = base.rgb * cover.a + cover.rgb * (1. - cover.a); @@ -51,11 +48,11 @@ fn mix_colors(base: vec4, cover: vec4) -> vec4 { fn draw_circle( base: vec4, - uv: vec2, + location: vec2, center: vec2, radius: f32, ) -> vec4 { - let distance: f32 = distance(uv, center); + let distance: f32 = distance(location, center); if distance <= (radius + SHAPE_THICKNESS) && radius <= distance { return mix_colors(base, SHAPE_COLOR); } @@ -73,14 +70,14 @@ struct Next { potential: f32, } -fn nearest(uv: vec2) -> u32 { +fn nearest(location: vec2) -> u32 { if circles.count == 0u { return MAX_KD_TREE_SIZE; } var best: KdRecord; best.index = 0u; - best.distance = distance(circles.nodes[0].location, uv); + best.distance = distance(circles.nodes[0].location, location); var stack_size: u32 = 1u; // Make sure that the stack size is large enought to cover balanced three @@ -100,14 +97,14 @@ fn nearest(uv: vec2) -> u32 { let node = circles.nodes[next.index]; - let distance = distance(node.location, uv); + let distance = distance(node.location, location); if distance < best.distance { best.index = next.index; best.distance = distance; } let axis = next.depth % 2u; - let diff = uv[axis] - node.location[axis]; + let diff = location[axis] - node.location[axis]; var close = 2u * next.index + 2u; var away = 2u * next.index + 1u; @@ -135,25 +132,25 @@ fn nearest(uv: vec2) -> u32 { return best.index; } -fn draw_circles(base: vec4, uv: vec2) -> vec4 { +fn draw_circles(base: vec4, location: vec2) -> vec4 { var output_color = base; - let index = nearest(uv); + let index = nearest(location); if index < MAX_KD_TREE_SIZE { let node = circles.nodes[index]; let center = node.location; let radius = node.radius; - output_color = draw_circle(output_color, uv, center, radius); + output_color = draw_circle(output_color, location, center, radius); } return output_color; } -fn draw_rectangles(base: vec4, uv: vec2) -> vec4 { +fn draw_rectangles(base: vec4, location: vec2) -> vec4 { for (var i = 0u; i < rectangles.count; i++) { let rectangle = rectangles.items[i]; - let local_uv = (rectangle.inverse_transform * vec3(uv, 1.0)).xy; - if all(abs(local_uv) <= rectangle.half_size + SHAPE_THICKNESS) && any(rectangle.half_size <= abs(local_uv)) { + let local_location = (rectangle.inverse_transform * vec3(location, 1.0)).xy; + if all(abs(local_location) <= rectangle.half_size + SHAPE_THICKNESS) && any(rectangle.half_size <= abs(local_location)) { return mix_colors(base, SHAPE_COLOR); } } @@ -163,57 +160,20 @@ fn draw_rectangles(base: vec4, uv: vec2) -> vec4 { @fragment fn fragment( - in: MeshVertexOutput, + in: VertexOutput, @builtin(front_facing) is_front: bool, -) -> @location(0) vec4 { - var pbr_input: PbrInput = pbr_input_new(); - pbr_input.material.perceptual_roughness = 0.8; - pbr_input.material.metallic = 0.23; - pbr_input.material.reflectance = 0.06; - - pbr_input.material.base_color = textureSample( - terrain_texture, - terrain_sampler, - in.uv / TEXTURE_SIZE - ); - -#ifdef VERTEX_COLORS - pbr_input.material.base_color = pbr_input.material.base_color * in.color; -#endif - - pbr_input.frag_coord = in.position; - pbr_input.world_position = in.world_position; - pbr_input.world_normal = prepare_world_normal( - in.world_normal, - (pbr_input.material.flags & pbr_types::STANDARD_MATERIAL_FLAGS_DOUBLE_SIDED_BIT) != 0u, - is_front, - ); - - pbr_input.is_orthographic = view.projection[3].w == 1.0; - - pbr_input.N = apply_normal_mapping( - pbr_input.material.flags, - pbr_input.world_normal, -#ifdef VERTEX_TANGENTS -#ifdef STANDARDMATERIAL_NORMAL_MAP - in.world_tangent, -#endif -#endif -#ifdef VERTEX_UVS - in.uv, -#endif - view.mip_bias, - ); - pbr_input.V = calculate_view(in.world_position, pbr_input.is_orthographic); - pbr_input.flags = mesh.flags; - - var output_color = pbr(pbr_input); - -#ifdef TONEMAP_IN_SHADER - output_color = tone_mapping(output_color, view.color_grading); -#endif - - output_color = draw_circles(output_color, in.uv); - output_color = draw_rectangles(output_color, in.uv); - return output_color; +) -> FragmentOutput { + var pbr_input = pbr_input_from_standard_material(in, is_front); + pbr_input.material.base_color = alpha_discard(pbr_input.material, pbr_input.material.base_color); + + var out: FragmentOutput; + out.color = apply_pbr_lighting(pbr_input); + + let location = uv_scale * in.uv; + out.color = draw_circles(out.color, location); + out.color = draw_rectangles(out.color, location); + + out.color = main_pass_post_lighting_processing(pbr_input, out.color); + + return out; } diff --git a/assets/shaders/trail.wgsl b/assets/shaders/trail.wgsl index a068ca163..d0e29c83a 100644 --- a/assets/shaders/trail.wgsl +++ b/assets/shaders/trail.wgsl @@ -1,5 +1,7 @@ -#import bevy_pbr::mesh_view_bindings globals -#import bevy_pbr::mesh_vertex_output MeshVertexOutput +#import bevy_pbr::{ + forward_io::VertexOutput, + mesh_view_bindings::globals, +} const COLOR = vec4(1., 0.85, 0.1, 0.7); @@ -8,7 +10,7 @@ var start_time: f32; @fragment fn fragment( - in: MeshVertexOutput, + in: VertexOutput, ) -> @location(0) vec4 { var color = COLOR; // Use max(0., ...) because the times are wrapping. diff --git a/crates/audio/src/music.rs b/crates/audio/src/music.rs index 021079843..24324d22c 100644 --- a/crates/audio/src/music.rs +++ b/crates/audio/src/music.rs @@ -29,8 +29,8 @@ fn setup(mut commands: Commands, server: Res) { fn load(server: Res, tracks: Res) -> Progress { match server.get_load_state(&tracks.0) { - LoadState::Loaded => true.into(), - LoadState::NotLoaded | LoadState::Loading => false.into(), + Some(LoadState::Loaded) => true.into(), + Some(LoadState::NotLoaded) | Some(LoadState::Loading) => false.into(), _ => panic!("Unexpected loading state."), } } diff --git a/crates/audio/src/spatial.rs b/crates/audio/src/spatial.rs index 26c60b473..f27f1e38b 100644 --- a/crates/audio/src/spatial.rs +++ b/crates/audio/src/spatial.rs @@ -78,8 +78,8 @@ fn load(server: Res, sounds: Res) -> Progress { .0 .values() .map(|handle| match server.get_load_state(handle) { - LoadState::Loaded => 1, - LoadState::NotLoaded | LoadState::Loading => 0, + Some(LoadState::Loaded) => 1, + Some(LoadState::NotLoaded) | Some(LoadState::Loading) => 0, _ => panic!("Unexpected loading state."), }) .sum(), @@ -146,7 +146,7 @@ fn play( let camera = camera.single(); let sound_volume = config.audio().sound_volume() as f64; - for PlaySpatialAudioEvent { sound, position } in &mut play_events { + for PlaySpatialAudioEvent { sound, position } in play_events.read() { let (volume, pan) = calculate_volume_and_pan(camera, &focus, *position); let handle = audio .play(sounds.0[*sound].clone()) diff --git a/crates/behaviour/src/chase.rs b/crates/behaviour/src/chase.rs index a6a911cfe..f404a29ea 100644 --- a/crates/behaviour/src/chase.rs +++ b/crates/behaviour/src/chase.rs @@ -114,7 +114,7 @@ impl ChaseTarget { } fn handle_chase_events(mut commands: Commands, mut events: EventReader) { - for event in events.iter() { + for event in events.read() { let mut entity_commands = commands.entity(event.entity()); match event.target() { Some(target) => entity_commands.insert(ChaseTargetComponent::new(target.clone())), diff --git a/crates/camera/src/camera.rs b/crates/camera/src/camera.rs index 086d344a6..ccfd2613b 100644 --- a/crates/camera/src/camera.rs +++ b/crates/camera/src/camera.rs @@ -1,7 +1,6 @@ use std::f32::consts::FRAC_PI_2; use bevy::{ - ecs::query::Has, pbr::{CascadeShadowConfig, CascadeShadowConfigBuilder, DirectionalLightShadowMap}, prelude::*, }; @@ -391,7 +390,7 @@ fn process_move_focus_events( terrain: TerrainCollider, mut out_events: EventWriter, ) { - let event = match in_events.iter().last() { + let event = match in_events.read().last() { Some(event) => event, None => return, }; @@ -516,7 +515,7 @@ fn handle_horizontal_events( mut movement: ResMut, mut events: EventReader, ) { - if let Some(event) = events.iter().last() { + if let Some(event) = events.read().last() { movement.set(event.direction()); } } @@ -526,7 +525,7 @@ fn handle_zoom_events( mut events: EventReader, mut desired: ResMut, ) { - for event in events.iter() { + for event in events.read() { desired.zoom_clamped(conf.camera(), event.factor()); } } @@ -535,7 +534,7 @@ fn handle_tilt_events( mut events: EventReader, mut desired: ResMut, ) { - for event in events.iter() { + for event in events.read() { desired.tilt_clamped(Radian::ONE * event.delta()); } } @@ -544,7 +543,7 @@ fn handle_rotate_events( mut events: EventReader, mut desired: ResMut, ) { - for event in events.iter() { + for event in events.read() { desired.rotate(Radian::ONE * event.delta()); } } diff --git a/crates/camera/src/skybox.rs b/crates/camera/src/skybox.rs index 39d7f9524..c6c5b5af6 100644 --- a/crates/camera/src/skybox.rs +++ b/crates/camera/src/skybox.rs @@ -1,7 +1,6 @@ use bevy::{ asset::LoadState, core_pipeline::Skybox, - ecs::query::Has, prelude::*, render::render_resource::{TextureViewDescriptor, TextureViewDimension}, }; @@ -48,8 +47,8 @@ fn configure_cubemap( } match server.get_load_state(&source.handle) { - LoadState::Loaded => (), - LoadState::NotLoaded | LoadState::Loading => return false.into(), + Some(LoadState::Loaded) => (), + Some(LoadState::NotLoaded) | Some(LoadState::Loading) => return false.into(), _ => panic!("Unexpected loading state."), } diff --git a/crates/combat/src/attack.rs b/crates/combat/src/attack.rs index 0ca6a8bb4..cca10aa98 100644 --- a/crates/combat/src/attack.rs +++ b/crates/combat/src/attack.rs @@ -105,7 +105,7 @@ fn attack( cannons: Query<&LaserCannon>, mut chase_events: EventWriter, ) { - for event in attack_events.iter() { + for event in attack_events.read() { if let Ok(cannon) = cannons.get(event.attacker()) { commands .entity(event.attacker()) diff --git a/crates/combat/src/health.rs b/crates/combat/src/health.rs index 3d9cc51c4..16a2df9fa 100644 --- a/crates/combat/src/health.rs +++ b/crates/combat/src/health.rs @@ -81,7 +81,7 @@ fn update_local_health( mut out_events: EventWriter, mut net_events: EventWriter, ) { - for event in in_events.iter() { + for event in in_events.read() { out_events.send(UpdateHealthEvent::new(event.entity, event.delta)); if config.multiplayer() { @@ -97,7 +97,7 @@ fn update_remote_health( mut in_events: EventReader, mut out_events: EventWriter, ) { - for event in in_events.iter() { + for event in in_events.read() { out_events.send(UpdateHealthEvent::new(event.entity(), event.delta())); } } @@ -107,7 +107,7 @@ fn update_health( mut health_events: EventReader, mut bar_events: EventWriter, ) { - for event in health_events.iter() { + for event in health_events.read() { let Ok(mut health) = healths.get_mut(event.entity) else { continue; }; diff --git a/crates/combat/src/laser.rs b/crates/combat/src/laser.rs index 7fb86bcef..64b3fbf9c 100644 --- a/crates/combat/src/laser.rs +++ b/crates/combat/src/laser.rs @@ -81,7 +81,7 @@ fn fire( mut health: EventWriter, mut trail: EventWriter, ) { - for fire in fires.iter() { + for fire in fires.read() { let observation = sightline.sight(fire.ray(), fire.max_toi(), fire.attacker()); trail.send(LocalLaserTrailEvent::new(Ray::new( diff --git a/crates/combat/src/trail.rs b/crates/combat/src/trail.rs index 5d3af1f82..8dc1121e5 100644 --- a/crates/combat/src/trail.rs +++ b/crates/combat/src/trail.rs @@ -3,7 +3,7 @@ use std::time::Duration; use bevy::{ pbr::{MaterialPipeline, MaterialPipelineKey, NotShadowCaster, NotShadowReceiver}, prelude::*, - reflect::{TypePath, TypeUuid}, + reflect::TypePath, render::{ mesh::{Indices, MeshVertexBufferLayout, PrimitiveTopology}, render_resource::{ @@ -87,8 +87,7 @@ impl Trail { } } -#[derive(AsBindGroup, TypeUuid, TypePath, Debug, Clone)] -#[uuid = "560ab431-1a54-48b3-87ea-8de8d94ceafb"] +#[derive(Asset, AsBindGroup, TypePath, Debug, Clone)] struct TrailMaterial { #[uniform(0)] start_time: f32, @@ -129,7 +128,7 @@ fn local_laser_trail( mut out_events: EventWriter, mut net_events: EventWriter, ) { - for event in in_events.iter() { + for event in in_events.read() { out_events.send(LaserTrailEvent(event.0)); if config.multiplayer() { @@ -147,7 +146,7 @@ fn remote_laser_trail( mut in_events: EventReader, mut out_events: EventWriter, ) { - for event in in_events.iter() { + for event in in_events.read() { match **event { NetProjectile::Laser { origin, direction } => { out_events.send(LaserTrailEvent(Ray::new(origin.into(), direction.into()))); @@ -163,7 +162,7 @@ fn laser_trail( mesh: Res, mut events: EventReader, ) { - for event in events.iter() { + for event in events.read() { let material = materials.add(TrailMaterial::new(time.elapsed_seconds_wrapped())); commands.spawn(( @@ -189,7 +188,7 @@ fn laser_sound( mut events: EventReader, mut sound_events: EventWriter, ) { - for event in events.iter() { + for event in events.read() { sound_events.send(PlaySpatialAudioEvent::new( Sound::LaserFire, event.0.origin.into(), diff --git a/crates/conf/src/io.rs b/crates/conf/src/io.rs index 9456747a2..5f73a6604 100644 --- a/crates/conf/src/io.rs +++ b/crates/conf/src/io.rs @@ -1,6 +1,6 @@ use anyhow::{Context, Result}; use async_std::{fs, path::Path}; -use bevy::prelude::info; +use tracing::info; /// Loads configuration file to a string. Returns Ok(None) if the configuration /// file does not exist. diff --git a/crates/construction/src/manufacturing.rs b/crates/construction/src/manufacturing.rs index 5404e14bd..7a2d2c26f 100644 --- a/crates/construction/src/manufacturing.rs +++ b/crates/construction/src/manufacturing.rs @@ -321,7 +321,7 @@ fn change_locations( mut pole_events: EventWriter, mut line_events: EventWriter, ) { - for event in events.iter() { + for event in events.read() { if let Ok(mut location) = locations.get_mut(event.factory()) { let owner = event.factory(); location.0 = event.position(); @@ -337,7 +337,7 @@ fn enqueue( mut events: EventReader, mut lines: Query<&mut AssemblyLine>, ) { - for event in events.iter() { + for event in events.read() { let Ok(mut line) = lines.get_mut(event.factory()) else { continue; }; @@ -415,7 +415,7 @@ fn deliver( &DeliveryLocation, )>, ) { - for delivery in deliver_events.iter() { + for delivery in deliver_events.read() { info!( "Manufacturing of {} in {:?} just finished.", delivery.unit(), diff --git a/crates/controller/src/commands/executor.rs b/crates/controller/src/commands/executor.rs index 595cdc6c6..f6554e5ac 100644 --- a/crates/controller/src/commands/executor.rs +++ b/crates/controller/src/commands/executor.rs @@ -85,7 +85,7 @@ fn send_selected_system( mut path_events: EventWriter, mut chase_events: EventWriter, ) { - if let Some(send) = send_events.iter().last() { + if let Some(send) = send_events.read().last() { for entity in selected.iter() { chase_events.send(ChaseTargetEvent::new(entity, None)); path_events.send(UpdateEntityPathEvent::new( @@ -103,7 +103,7 @@ fn delivery_location_system( selected: Query, mut out_events: EventWriter, ) { - if let Some(event) = in_events.iter().last() { + if let Some(event) = in_events.read().last() { for entity in selected.iter() { out_events.send(ChangeDeliveryLocationEvent::new(entity, event.target())); } @@ -115,7 +115,7 @@ fn attack_system( selected: Query, mut individual_events: EventWriter, ) { - if let Some(group_event) = group_events.iter().last() { + if let Some(group_event) = group_events.read().last() { for attacker in selected.iter() { individual_events.send(AttackEvent::new(attacker, group_event.target())); } diff --git a/crates/controller/src/commands/handlers.rs b/crates/controller/src/commands/handlers.rs index 1026a4b96..541f789e3 100644 --- a/crates/controller/src/commands/handlers.rs +++ b/crates/controller/src/commands/handlers.rs @@ -138,7 +138,7 @@ fn on_click(button: MouseButton) -> impl Fn(EventReader) -> b move |mut events: EventReader| { // It is desirable to exhaust the iterator, thus .filter().count() is // used instead of .any() - events.iter().filter(|e| e.button() == button).count() > 0 + events.read().filter(|e| e.button() == button).count() > 0 } } @@ -146,7 +146,7 @@ fn on_double_click(button: MouseButton) -> impl Fn(EventReader| { // It is desirable to exhaust the iterator, thus .filter().count() is // used instead of .any() - events.iter().filter(|e| e.button() == button).count() > 0 + events.read().filter(|e| e.button() == button).count() > 0 } } @@ -210,7 +210,7 @@ fn move_camera_arrows_system( mut key_events: EventReader, mut move_events: EventWriter, ) { - for key_event in key_events.iter() { + for key_event in key_events.read() { let Some(key_code) = key_event.key_code else { continue; }; @@ -277,7 +277,7 @@ fn zoom_camera( ) { let conf = conf.camera(); let factor = wheel_events - .iter() + .read() .fold(1.0, |factor, event| match event.unit { MouseScrollUnit::Line => factor * conf.wheel_zoom_sensitivity().powf(event.y), MouseScrollUnit::Pixel => factor * conf.touchpad_zoom_sensitivity().powf(event.y), @@ -297,7 +297,7 @@ fn pivot_camera( return; } - let delta = mouse_event.iter().fold(Vec2::ZERO, |sum, e| sum + e.delta); + let delta = mouse_event.read().fold(Vec2::ZERO, |sum, e| sum + e.delta); let sensitivity = conf.camera().rotation_sensitivity(); if delta.x != 0. { rotate_event.send(RotateCameraEvent::new(sensitivity * delta.x)); @@ -390,7 +390,7 @@ fn update_drags( mut ui_events: EventWriter, mut select_events: EventWriter, ) { - for drag_event in drag_events.iter() { + for drag_event in drag_events.read() { if drag_event.button() != MouseButton::Left { continue; } diff --git a/crates/controller/src/commands/keyboard.rs b/crates/controller/src/commands/keyboard.rs index 2c67be9c3..1b5d4b524 100644 --- a/crates/controller/src/commands/keyboard.rs +++ b/crates/controller/src/commands/keyboard.rs @@ -36,7 +36,7 @@ impl KeyCondition { pub(super) fn build(self) -> impl Fn(Res>, EventReader) -> bool { move |keys: Res>, mut events: EventReader| { let proper_key = events - .iter() + .read() .filter(|k| { k.state == ButtonState::Pressed && k.key_code.map_or(false, |c| c == self.key) }) diff --git a/crates/controller/src/draft.rs b/crates/controller/src/draft.rs index 671d721a5..36aa2f5da 100644 --- a/crates/controller/src/draft.rs +++ b/crates/controller/src/draft.rs @@ -99,7 +99,7 @@ fn new_drafts( mut events: EventReader, drafts: Query>, ) { - let event = match events.iter().last() { + let event = match events.read().last() { Some(event) => event, None => return, }; diff --git a/crates/controller/src/hud/interaction.rs b/crates/controller/src/hud/interaction.rs index 17ffa08ab..4411f0b77 100644 --- a/crates/controller/src/hud/interaction.rs +++ b/crates/controller/src/hud/interaction.rs @@ -2,7 +2,6 @@ use bevy::{ ecs::{query::ReadOnlyWorldQuery, system::SystemParam}, prelude::*, }; -use glam::Vec3Swizzles; /// Top-level non-transparent or otherwise interaction blocking Node. All such /// nodes are marked with this component and no descendants have it attached. @@ -23,7 +22,7 @@ where 's, ( &'static GlobalTransform, - &'static ComputedVisibility, + &'static ViewVisibility, &'static Node, ), F, @@ -34,6 +33,7 @@ impl<'w, 's, F> HudNodes<'w, 's, F> where F: ReadOnlyWorldQuery + Sync + Send + 'static, { + /// See [`Self::relative_position`]. pub(crate) fn contains_point(&self, point: Vec2) -> bool { self.relative_position(point).is_some() } @@ -43,11 +43,16 @@ where /// /// The returned point is between (0, 0) (top-left corner) and (1, 1) /// (bottom-right corner). + /// + /// The method relies on [`ViewVisibility`], therefore the results are + /// accurate with respect to the last rendered frame only iff called before + /// [`bevy::render::view::VisibilitySystems::VisibilityPropagate`] (during + /// `PostUpdate` schedule). pub(crate) fn relative_position(&self, point: Vec2) -> Option { self.hud .iter() .filter_map(|(box_transform, visibility, node)| { - if !visibility.is_visible() { + if !visibility.get() { return None; } diff --git a/crates/controller/src/hud/menu.rs b/crates/controller/src/hud/menu.rs index a901566c5..a9bc27ab1 100644 --- a/crates/controller/src/hud/menu.rs +++ b/crates/controller/src/hud/menu.rs @@ -116,7 +116,7 @@ fn toggle_system( mut events: EventReader, mut query: Query<&mut Visibility, With>, ) { - if events.iter().count() % 2 == 0 { + if events.read().count() % 2 == 0 { return; } diff --git a/crates/controller/src/hud/minimap/interaction.rs b/crates/controller/src/hud/minimap/interaction.rs index 441f838ed..2967d0d1b 100644 --- a/crates/controller/src/hud/minimap/interaction.rs +++ b/crates/controller/src/hud/minimap/interaction.rs @@ -119,7 +119,7 @@ fn press_handler( ) { let cursor = window_query.single().cursor_position(); - for event in input_events.iter() { + for event in input_events.read() { match event.state { ButtonState::Released => { dragging.retain(|b| *b != event.button); @@ -173,7 +173,7 @@ fn move_camera_system( mut drag_events: EventReader, mut camera_events: EventWriter, ) { - for press in press_events.iter() { + for press in press_events.read() { if press.button() != MouseButton::Left { continue; } @@ -182,7 +182,7 @@ fn move_camera_system( camera_events.send(event); } - for drag in drag_events.iter() { + for drag in drag_events.read() { if drag.button() != MouseButton::Left { continue; } @@ -196,7 +196,7 @@ fn send_units_system( mut press_events: EventReader, mut send_events: EventWriter, ) { - for press in press_events.iter() { + for press in press_events.read() { if press.button() != MouseButton::Right { continue; } @@ -208,7 +208,7 @@ fn delivery_location_system( mut press_events: EventReader, mut location_events: EventWriter, ) { - for press in press_events.iter() { + for press in press_events.read() { if press.button() != MouseButton::Right { continue; } diff --git a/crates/controller/src/hud/selection.rs b/crates/controller/src/hud/selection.rs index f9780970c..32611c423 100644 --- a/crates/controller/src/hud/selection.rs +++ b/crates/controller/src/hud/selection.rs @@ -35,7 +35,7 @@ fn process_events( mut boxes: Query<(Entity, &mut Style), With>, mut events: EventReader, ) { - if let Some(event) = events.iter().last() { + if let Some(event) = events.read().last() { match event.0 { Some(rect) => { let size = rect.size(); diff --git a/crates/controller/src/mouse/input.rs b/crates/controller/src/mouse/input.rs index 9bdab4dca..0ac9d63f5 100644 --- a/crates/controller/src/mouse/input.rs +++ b/crates/controller/src/mouse/input.rs @@ -273,7 +273,7 @@ fn update_buttons( mut clicks: EventWriter, mut drags: EventWriter, ) { - for event in input_events.iter() { + for event in input_events.read() { match event.state { ButtonState::Released => { if let Some(drag_resolution) = mouse_state.resolve(event.button) { @@ -305,7 +305,7 @@ fn check_double_click( mut last_click_time: Local, time: Res