Skip to content

Commit

Permalink
Merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
james-j-obrien committed Feb 20, 2024
2 parents 277d301 + 9091800 commit c8df047
Show file tree
Hide file tree
Showing 387 changed files with 11,101 additions and 6,033 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/post-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
--exclude build-wasm-example
- name: Create PR
uses: peter-evans/create-pull-request@v5
uses: peter-evans/create-pull-request@v6
with:
delete-branch: true
base: "main"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
--exclude build-wasm-example
- name: Create PR
uses: peter-evans/create-pull-request@v5
uses: peter-evans/create-pull-request@v6
with:
delete-branch: true
base: "main"
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ dxil.dll
# Generated by "examples/scene/scene.rs"
assets/scenes/load_scene_example-new.scn.ron

# Generated by "examples/window/screenshot.rs"
**/screenshot-*.png

assets/**/*.meta
crates/bevy_asset/imported_assets
imported_assets
Expand Down
1,397 changes: 1,396 additions & 1 deletion CHANGELOG.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* Ground tile from [Kenney's Tower Defense Kit](https://www.kenney.nl/assets/tower-defense-kit) (CC0 1.0 Universal)
* Game icons from [Kenney's Game Icons](https://www.kenney.nl/assets/game-icons) (CC0 1.0 Universal)
* Space ships from [Kenny's Simple Space Kit](https://www.kenney.nl/assets/simple-space) (CC0 1.0 Universal)
* UI borders from [Kenny's Fantasy UI Borders Kit](https://kenney.nl/assets/fantasy-ui-borders) (CC0 1.0 Universal)
* glTF animated fox from [glTF Sample Models][fox]
* Low poly fox [by PixelMannen] (CC0 1.0 Universal)
* Rigging and animation [by @tomkranis on Sketchfab] ([CC-BY 4.0])
Expand Down
47 changes: 42 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bevy"
version = "0.12.0"
version = "0.13.0"
edition = "2021"
categories = ["game-engines", "graphics", "gui", "rendering"]
description = "A refreshingly simple data-driven game engine and app framework"
Expand All @@ -11,7 +11,7 @@ license = "MIT OR Apache-2.0"
readme = "README.md"
repository = "https://github.com/bevyengine/bevy"
documentation = "https://docs.rs/bevy"
rust-version = "1.74.0"
rust-version = "1.76.0"

[workspace]
exclude = [
Expand All @@ -38,7 +38,11 @@ undocumented_unsafe_blocks = "warn"
redundant_else = "warn"
match_same_arms = "warn"
semicolon_if_nothing_returned = "warn"
map_flatten = "warn"

ptr_as_ptr = "warn"
ptr_cast_constness = "warn"
#TODO(rust 1.77): enable `ref_as_ptr`
# ref_as_ptr = "warn"

[workspace.lints.rust]
unsafe_op_in_unsafe_fn = "warn"
Expand Down Expand Up @@ -301,8 +305,8 @@ embedded_watcher = ["bevy_internal/embedded_watcher"]
bevy_debug_stepping = ["bevy_internal/bevy_debug_stepping"]

[dependencies]
bevy_dylib = { path = "crates/bevy_dylib", version = "0.12.0", default-features = false, optional = true }
bevy_internal = { path = "crates/bevy_internal", version = "0.12.0", default-features = false }
bevy_dylib = { path = "crates/bevy_dylib", version = "0.13.0", default-features = false, optional = true }
bevy_internal = { path = "crates/bevy_internal", version = "0.13.0", default-features = false }

[dev-dependencies]
rand = "0.8.0"
Expand Down Expand Up @@ -935,6 +939,17 @@ description = "Showcases wireframe rendering"
category = "3D Rendering"
wasm = false

[[example]]
name = "irradiance_volumes"
path = "examples/3d/irradiance_volumes.rs"
doc-scrape-examples = true

[package.metadata.example.irradiance_volumes]
name = "Irradiance Volumes"
description = "Demonstrates irradiance volumes"
category = "3D Rendering"
wasm = false

[[example]]
name = "lightmaps"
path = "examples/3d/lightmaps.rs"
Expand Down Expand Up @@ -2493,6 +2508,17 @@ description = "Illustrates how to use TextureAtlases in UI"
category = "UI (User Interface)"
wasm = true

[[example]]
name = "ui_texture_slice"
path = "examples/ui/ui_texture_slice.rs"
doc-scrape-examples = true

[package.metadata.example.ui_texture_slice]
name = "UI Texture Slice"
description = "Illustrates how to use 9 Slicing in UI"
category = "UI (User Interface)"
wasm = true

[[example]]
name = "viewport_debug"
path = "examples/ui/viewport_debug.rs"
Expand Down Expand Up @@ -2639,6 +2665,17 @@ description = "Demonstrates creating and using custom Ui materials"
category = "UI (User Interface)"
wasm = true

[[example]]
name = "render_primitives"
path = "examples/math/render_primitives.rs"
doc-scrape-examples = true

[package.metadata.example.render_primitives]
name = "Rendering Primitives"
description = "Shows off rendering for all math primitives as both Meshes and Gizmos"
category = "Math"
wasm = true

[profile.wasm-release]
inherits = "release"
opt-level = "z"
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Bevy is a refreshingly simple data-driven game engine built in Rust. It is free

## WARNING

Bevy is still in the early stages of development. Important features are missing. Documentation is sparse. A new version of Bevy containing breaking changes to the API is released [approximately once every 3 months](https://bevyengine.org/news/bevy-0-6/#the-train-release-schedule). We provide [migration guides](https://bevyengine.org/learn/book/migration-guides/), but we can't guarantee migrations will always be easy. Use only if you are willing to work in this environment.
Bevy is still in the early stages of development. Important features are missing. Documentation is sparse. A new version of Bevy containing breaking changes to the API is released [approximately once every 3 months](https://bevyengine.org/news/bevy-0-6/#the-train-release-schedule). We provide [migration guides](https://bevyengine.org/learn/migration-guides/), but we can't guarantee migrations will always be easy. Use only if you are willing to work in this environment.

**MSRV:** Bevy relies heavily on improvements in the Rust language and compiler.
As a result, the Minimum Supported Rust Version (MSRV) is generally close to "the latest stable release" of Rust.
Expand All @@ -34,7 +34,7 @@ As a result, the Minimum Supported Rust Version (MSRV) is generally close to "th

## Docs

* **[The Bevy Book](https://bevyengine.org/learn/book/introduction):** Bevy's official documentation. The best place to start learning Bevy.
* **[Quick Start Guide](https://bevyengine.org/learn/quick-start/introduction):** Bevy's official Quick Start Guide. The best place to start learning Bevy.
* **[Bevy Rust API Docs](https://docs.rs/bevy):** Bevy's Rust API docs, which are automatically generated from the doc comments in this repo.
* **[Official Examples](https://github.com/bevyengine/bevy/tree/latest/examples):** Bevy's dedicated, runnable examples, which are great for digging into specific concepts.
* **[Community-Made Learning Resources](https://bevyengine.org/assets/#learning)**: More tutorials, documentation, and examples made by the Bevy community.
Expand All @@ -58,9 +58,9 @@ For more complex architecture decisions and experimental mad science, please ope

## Getting Started

We recommend checking out [The Bevy Book](https://bevyengine.org/learn/book/introduction) for a full tutorial.
We recommend checking out the [Quick Start Guide](https://bevyengine.org/learn/quick-start/introduction) for a brief introduction.

Follow the [Setup guide](https://bevyengine.org/learn/book/getting-started/setup/) to ensure your development environment is set up correctly.
Follow the [Setup guide](https://bevyengine.org/learn/quick-start/getting-started/setup) to ensure your development environment is set up correctly.
Once set up, you can quickly try out the [examples](https://github.com/bevyengine/bevy/tree/latest/examples) by cloning this repo and running the following commands:

```sh
Expand All @@ -84,7 +84,7 @@ fn main(){

### Fast Compiles

Bevy can be built just fine using default configuration on stable Rust. However for really fast iterative compiles, you should enable the "fast compiles" setup by [following the instructions here](http://bevyengine.org/learn/book/getting-started/setup/).
Bevy can be built just fine using default configuration on stable Rust. However for really fast iterative compiles, you should enable the "fast compiles" setup by [following the instructions here](https://bevyengine.org/learn/quick-start/getting-started/setup).

## [Bevy Cargo Features][cargo_features]

Expand Down
Binary file added assets/irradiance_volumes/Example.vxgi.ktx2
Binary file not shown.
Binary file not shown.
35 changes: 35 additions & 0 deletions assets/shaders/irradiance_volume_voxel_visualization.wgsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#import bevy_pbr::forward_io::VertexOutput
#import bevy_pbr::irradiance_volume
#import bevy_pbr::mesh_view_bindings

struct VoxelVisualizationIrradianceVolumeInfo {
transform: mat4x4<f32>,
inverse_transform: mat4x4<f32>,
resolution: vec3<u32>,
// A scale factor that's applied to the diffuse and specular light from the
// light probe. This is in units of cd/m² (candela per square meter).
intensity: f32,
}

@group(2) @binding(100)
var<uniform> irradiance_volume_info: VoxelVisualizationIrradianceVolumeInfo;

@fragment
fn fragment(mesh: VertexOutput) -> @location(0) vec4<f32> {
// Snap the world position we provide to `irradiance_volume_light()` to the
// middle of the nearest texel.
var unit_pos = (irradiance_volume_info.inverse_transform *
vec4(mesh.world_position.xyz, 1.0f)).xyz;
let resolution = vec3<f32>(irradiance_volume_info.resolution);
let stp = clamp((unit_pos + 0.5) * resolution, vec3(0.5f), resolution - vec3(0.5f));
let stp_rounded = round(stp - 0.5f) + 0.5f;
let rounded_world_pos = (irradiance_volume_info.transform * vec4(stp_rounded, 1.0f)).xyz;

// `irradiance_volume_light()` multiplies by intensity, so cancel it out.
// If we take intensity into account, the cubes will be way too bright.
let rgb = irradiance_volume::irradiance_volume_light(
mesh.world_position.xyz,
mesh.world_normal) / irradiance_volume_info.intensity;

return vec4<f32>(rgb, 1.0f);
}
30 changes: 30 additions & 0 deletions assets/textures/fantasy_ui_borders/License.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@


Fantasy UI Borders (1.0)

Created/distributed by Kenney (www.kenney.nl)
Creation date: 03-12-2023

For the sample image the font 'Aoboshi One' was used, OPL (Open Font License)

------------------------------

License: (Creative Commons Zero, CC0)
http://creativecommons.org/publicdomain/zero/1.0/

You can use this content for personal, educational, and commercial purposes.

Support by crediting 'Kenney' or 'www.kenney.nl' (this is not a requirement)

------------------------------

• Website : www.kenney.nl
• Donate : www.kenney.nl/donate

• Patreon : patreon.com/kenney

Follow on social media for updates:

• Twitter: twitter.com/KenneyNL
• Instagram: instagram.com/kenney_nl
• Mastodon: mastodon.gamedev.place/@kenney
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions benches/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ path = "benches/bevy_math/bezier.rs"
harness = false

[[bench]]
name = "utils"
path = "benches/bevy_utils/entity_hash.rs"
name = "entity_hash"
path = "benches/bevy_ecs/world/entity_hash.rs"
harness = false
1 change: 1 addition & 0 deletions benches/benches/bevy_ecs/scheduling/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ criterion_group!(
contrived,
schedule,
build_schedule,
empty_schedule_run,
);
25 changes: 25 additions & 0 deletions benches/benches/bevy_ecs/scheduling/schedule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,28 @@ pub fn build_schedule(criterion: &mut Criterion) {

group.finish();
}

pub fn empty_schedule_run(criterion: &mut Criterion) {
let mut app = bevy_app::App::default();

let mut group = criterion.benchmark_group("run_empty_schedule");

let mut schedule = Schedule::default();
schedule.set_executor_kind(bevy_ecs::schedule::ExecutorKind::SingleThreaded);
group.bench_function("SingleThreaded", |bencher| {
bencher.iter(|| schedule.run(&mut app.world));
});

let mut schedule = Schedule::default();
schedule.set_executor_kind(bevy_ecs::schedule::ExecutorKind::MultiThreaded);
group.bench_function("MultiThreaded", |bencher| {
bencher.iter(|| schedule.run(&mut app.world));
});

let mut schedule = Schedule::default();
schedule.set_executor_kind(bevy_ecs::schedule::ExecutorKind::Simple);
group.bench_function("Simple", |bencher| {
bencher.iter(|| schedule.run(&mut app.world));
});
group.finish();
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use bevy_ecs::entity::Entity;
use bevy_utils::EntityHashSet;
use bevy_ecs::entity::{Entity, EntityHashSet};
use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion, Throughput};
use rand::{Rng, SeedableRng};
use rand_chacha::ChaCha8Rng;
Expand Down Expand Up @@ -28,7 +27,7 @@ fn make_entity(rng: &mut impl Rng, size: usize) -> Entity {
e
}

fn entity_set_build_and_lookup(c: &mut Criterion) {
pub fn entity_set_build_and_lookup(c: &mut Criterion) {
let mut group = c.benchmark_group("entity_hash");
for size in SIZES {
// Get some random-but-consistent entities to use for all the benches below.
Expand Down
13 changes: 8 additions & 5 deletions benches/benches/bevy_ecs/world/mod.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
use criterion::criterion_group;

mod commands;
mod spawn;
mod world_get;

use commands::*;

mod spawn;
use spawn::*;

mod world_get;
use world_get::*;

mod entity_hash;
use entity_hash::*;

criterion_group!(
world_benches,
empty_commands,
Expand All @@ -24,10 +28,9 @@ criterion_group!(
world_query_iter,
world_query_for_each,
world_spawn,
query_get_component_simple,
query_get_component,
query_get,
query_get_many::<2>,
query_get_many::<5>,
query_get_many::<10>,
entity_set_build_and_lookup
);
Loading

0 comments on commit c8df047

Please sign in to comment.