Skip to content

Commit

Permalink
Merge branch 'main' into deprecate-dynamic-plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
BD103 authored May 17, 2024
2 parents 4e8e0a2 + 104dcf5 commit 53cf7de
Show file tree
Hide file tree
Showing 385 changed files with 13,716 additions and 4,250 deletions.
5 changes: 5 additions & 0 deletions .cargo/config_fast_builds.toml
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,8 @@ rustflags = [
# In most cases the gains are negligible, but if you are on macos and have slow compile times you should see significant gains.
# [profile.dev]
# debug = 1

# This is enables you to run the CI tool using `cargo ci`.
# This is not enabled by default, you need to copy this file to `config.toml`.
[alias]
ci = "run --package ci --"
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Check for typos
uses: crate-ci/typos@v1.20.10
uses: crate-ci/typos@v1.21.0
- name: Typos info
if: failure()
run: |
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ concurrency:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
# Only run this job when on the main Bevy repository. Without this, it would also run on forks
# where developers work on the main branch but have not enabled Github Pages.
if: ${{ github.repository == 'bevyengine/bevy' }}
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,3 @@ jobs:
title: "Preparing Next Release"
body: |
Preparing next release. This PR has been auto-generated.
UI tests have not been automatically bumped to the latest version, please fix them manually.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ crates/bevy_asset/imported_assets
imported_assets

example_showcase_config.ron
example-showcase-reports/
111 changes: 99 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ rust-version = "1.77.0"
[workspace]
exclude = [
"benches",
"crates/bevy_ecs_compile_fail_tests",
"crates/bevy_macros_compile_fail_tests",
"crates/bevy_reflect_compile_fail_tests",
"crates/bevy_compile_test_utils",
"crates/bevy_derive/compile_fail",
"crates/bevy_ecs/compile_fail",
"crates/bevy_reflect/compile_fail",
"tools/compile_fail_utils",
]
members = [
"crates/*",
Expand Down Expand Up @@ -55,6 +55,7 @@ workspace = true
default = [
"animation",
"bevy_asset",
"bevy_state",
"bevy_audio",
"bevy_color",
"bevy_gilrs",
Expand All @@ -67,7 +68,7 @@ default = [
"bevy_sprite",
"bevy_text",
"bevy_ui",
"multi-threaded",
"multi_threaded",
"png",
"hdr",
"vorbis",
Expand Down Expand Up @@ -252,7 +253,7 @@ symphonia-wav = ["bevy_internal/symphonia-wav"]
serialize = ["bevy_internal/serialize"]

# Enables multithreaded parallelism in the engine. Disabling it forces all engine tasks to run on a single thread.
multi-threaded = ["bevy_internal/multi-threaded"]
multi_threaded = ["bevy_internal/multi_threaded"]

# Use async-io's implementation of block_on instead of futures-lite's implementation. This is preferred if your application uses async-io.
async-io = ["bevy_internal/async-io"]
Expand Down Expand Up @@ -302,6 +303,11 @@ shader_format_spirv = ["bevy_internal/shader_format_spirv"]
# Enable support for transmission-related textures in the `StandardMaterial`, at the risk of blowing past the global, per-shader texture limit on older/lower-end GPUs
pbr_transmission_textures = ["bevy_internal/pbr_transmission_textures"]

# Enable support for multi-layer material textures in the `StandardMaterial`, at the risk of blowing past the global, per-shader texture limit on older/lower-end GPUs
pbr_multi_layer_material_textures = [
"bevy_internal/pbr_multi_layer_material_textures",
]

# Enable some limitations to be able to use WebGL2. Please refer to the [WebGL2 and WebGPU](https://github.com/bevyengine/bevy/tree/latest/examples#webgl2-and-webgpu) section of the examples README for more information on how to run Wasm builds with WebGPU.
webgl2 = ["bevy_internal/webgl"]

Expand Down Expand Up @@ -329,6 +335,9 @@ meshlet_processor = ["bevy_internal/meshlet_processor"]
# Enable support for the ios_simulator by downgrading some rendering capabilities
ios_simulator = ["bevy_internal/ios_simulator"]

# Enable built in global state machines
bevy_state = ["bevy_internal/bevy_state"]

[dependencies]
bevy_internal = { path = "crates/bevy_internal", version = "0.14.0-dev", default-features = false }

Expand Down Expand Up @@ -678,6 +687,17 @@ description = "A scene showcasing the distance fog effect"
category = "3D Rendering"
wasm = true

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

[package.metadata.example.auto_exposure]
name = "Auto Exposure"
description = "A scene showcasing auto exposure"
category = "3D Rendering"
wasm = false

[[example]]
name = "blend_modes"
path = "examples/3d/blend_modes.rs"
Expand Down Expand Up @@ -1258,6 +1278,17 @@ description = "An application that runs with default plugins and displays an emp
category = "Application"
wasm = false

[[example]]
name = "headless_renderer"
path = "examples/app/headless_renderer.rs"
doc-scrape-examples = true

[package.metadata.example.headless_renderer]
name = "Headless Renderer"
description = "An application that runs with no window, but renders into image file"
category = "Application"
wasm = false

[[example]]
name = "without_winit"
path = "examples/app/without_winit.rs"
Expand Down Expand Up @@ -1371,6 +1402,17 @@ description = "Demonstrates how to process and load custom assets"
category = "Assets"
wasm = false

[[example]]
name = "repeated_texture"
path = "examples/asset/repeated_texture.rs"
doc-scrape-examples = true

[package.metadata.example.repeated_texture]
name = "Repeated texture configuration"
description = "How to configure the texture to repeat instead of the default clamp to edges"
category = "Assets"
wasm = true

# Async Tasks
[[example]]
name = "async_compute"
Expand Down Expand Up @@ -1691,35 +1733,35 @@ wasm = false

[[example]]
name = "state"
path = "examples/ecs/state.rs"
path = "examples/state/state.rs"
doc-scrape-examples = true

[package.metadata.example.state]
name = "State"
description = "Illustrates how to use States to control transitioning from a Menu state to an InGame state"
category = "ECS (Entity Component System)"
category = "State"
wasm = false

[[example]]
name = "sub_states"
path = "examples/ecs/sub_states.rs"
path = "examples/state/sub_states.rs"
doc-scrape-examples = true

[package.metadata.example.sub_states]
name = "Sub States"
description = "Using Sub States for hierarchical state handling."
category = "ECS (Entity Component System)"
category = "State"
wasm = false

[[example]]
name = "computed_states"
path = "examples/ecs/computed_states.rs"
path = "examples/state/computed_states.rs"
doc-scrape-examples = true

[package.metadata.example.computed_states]
name = "Computed States"
description = "Advanced state patterns using Computed States"
category = "ECS (Entity Component System)"
category = "State"
wasm = false

[[example]]
Expand Down Expand Up @@ -2025,6 +2067,17 @@ description = "Demonstrates how reflection in Bevy provides a way to dynamically
category = "Reflection"
wasm = false

[[example]]
name = "dynamic_types"
path = "examples/reflection/dynamic_types.rs"
doc-scrape-examples = true

[package.metadata.example.dynamic_types]
name = "Dynamic Types"
description = "How dynamic types are used with reflection"
category = "Reflection"
wasm = false

[[example]]
name = "generic_reflection"
path = "examples/reflection/generic_reflection.rs"
Expand Down Expand Up @@ -2961,6 +3014,40 @@ description = "Demonstrates color grading"
category = "3D Rendering"
wasm = true

[[example]]
name = "clearcoat"
path = "examples/3d/clearcoat.rs"
doc-scrape-examples = true
required-features = ["pbr_multi_layer_material_textures"]

[package.metadata.example.clearcoat]
name = "Clearcoat"
description = "Demonstrates the clearcoat PBR feature"
category = "3D Rendering"
wasm = false

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

[package.metadata.example.depth_of_field]
name = "Depth of field"
description = "Demonstrates depth of field"
category = "3D Rendering"
wasm = false

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

[package.metadata.example.volumetric_fog]
name = "Volumetric fog"
description = "Demonstrates volumetric fog and lighting"
category = "3D Rendering"
wasm = true

[profile.wasm-release]
inherits = "release"
opt-level = "z"
Expand Down
Binary file not shown.
Binary file not shown.
Binary file added assets/models/GolfBall/GolfBall.glb
Binary file not shown.
Binary file not shown.
13 changes: 8 additions & 5 deletions assets/shaders/array_texture.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
mesh_view_bindings::view,
pbr_types::{STANDARD_MATERIAL_FLAGS_DOUBLE_SIDED_BIT, PbrInput, pbr_input_new},
pbr_functions as fns,
pbr_bindings,
}
#import bevy_core_pipeline::tonemapping::tone_mapping

Expand Down Expand Up @@ -37,19 +38,21 @@ fn fragment(

pbr_input.is_orthographic = view.projection[3].w == 1.0;

pbr_input.N = normalize(pbr_input.world_normal);

#ifdef VERTEX_TANGENTS
let Nt = textureSampleBias(pbr_bindings::normal_map_texture, pbr_bindings::normal_map_sampler, mesh.uv, view.mip_bias).rgb;
pbr_input.N = fns::apply_normal_mapping(
pbr_input.material.flags,
mesh.world_normal,
double_sided,
is_front,
#ifdef VERTEX_TANGENTS
#ifdef STANDARD_MATERIAL_NORMAL_MAP
mesh.world_tangent,
#endif
#endif
mesh.uv,
Nt,
view.mip_bias,
);
#endif

pbr_input.V = fns::calculate_view(mesh.world_position, pbr_input.is_orthographic);

return tone_mapping(fns::apply_pbr_lighting(pbr_input), view.color_grading);
Expand Down
3 changes: 2 additions & 1 deletion assets/shaders/tonemapping_test_patterns.wgsl
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#import bevy_pbr::{
mesh_view_bindings,
forward_io::VertexOutput,
utils::PI,
}

#import bevy_render::maths::PI

#ifdef TONEMAP_IN_SHADER
#import bevy_core_pipeline::tonemapping::tone_mapping
#endif
Expand Down
Binary file added assets/textures/BlueNoise-Normal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/textures/ScratchedGold-Normal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/textures/basic_metering_mask.png
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.
2 changes: 1 addition & 1 deletion benches/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ rand = "0.8"
rand_chacha = "0.3"
criterion = { version = "0.3", features = ["html_reports"] }
bevy_app = { path = "../crates/bevy_app" }
bevy_ecs = { path = "../crates/bevy_ecs", features = ["multi-threaded"] }
bevy_ecs = { path = "../crates/bevy_ecs", features = ["multi_threaded"] }
bevy_reflect = { path = "../crates/bevy_reflect" }
bevy_tasks = { path = "../crates/bevy_tasks" }
bevy_utils = { path = "../crates/bevy_utils" }
Expand Down
19 changes: 19 additions & 0 deletions benches/benches/bevy_render/render_layers.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
use criterion::{black_box, criterion_group, criterion_main, Criterion};

use bevy_render::view::RenderLayers;

fn render_layers(c: &mut Criterion) {
c.bench_function("layers_intersect", |b| {
let layer_a = RenderLayers::layer(1).with(2);
let layer_b = RenderLayers::layer(1);
b.iter(|| {
black_box(layer_a.intersects(&layer_b))
});
});
}

criterion_group!(
benches,
render_layers,
);
criterion_main!(benches);
6 changes: 3 additions & 3 deletions crates/bevy_animation/src/animatable.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::util;
use bevy_color::{ClampColor, Laba, LinearRgba, Oklaba, Srgba, Xyza};
use bevy_color::{Laba, LinearRgba, Oklaba, Srgba, Xyza};
use bevy_ecs::world::World;
use bevy_math::*;
use bevy_reflect::Reflect;
Expand Down Expand Up @@ -63,7 +63,7 @@ macro_rules! impl_color_animatable {
#[inline]
fn interpolate(a: &Self, b: &Self, t: f32) -> Self {
let value = *a * (1. - t) + *b * t;
value.clamped()
value
}

#[inline]
Expand All @@ -76,7 +76,7 @@ macro_rules! impl_color_animatable {
value = Self::interpolate(&value, &input.value, input.weight);
}
}
value.clamped()
value
}
}
};
Expand Down
4 changes: 3 additions & 1 deletion crates/bevy_app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ keywords = ["bevy"]
[features]
trace = []
bevy_debug_stepping = []
default = ["bevy_reflect"]
default = ["bevy_reflect", "bevy_state"]
bevy_reflect = ["dep:bevy_reflect", "bevy_ecs/bevy_reflect"]
serialize = ["bevy_ecs/serde"]
bevy_state = ["dep:bevy_state"]

[dependencies]
# bevy
Expand All @@ -22,6 +23,7 @@ bevy_ecs = { path = "../bevy_ecs", version = "0.14.0-dev", default-features = fa
bevy_reflect = { path = "../bevy_reflect", version = "0.14.0-dev", optional = true }
bevy_utils = { path = "../bevy_utils", version = "0.14.0-dev" }
bevy_tasks = { path = "../bevy_tasks", version = "0.14.0-dev" }
bevy_state = { path = "../bevy_state", optional = true, version = "0.14.0-dev" }

# other
serde = { version = "1.0", features = ["derive"], optional = true }
Expand Down
Loading

0 comments on commit 53cf7de

Please sign in to comment.