Skip to content

Commit

Permalink
Merge branch 'main' into idiomatic-atlas-builder
Browse files Browse the repository at this point in the history
  • Loading branch information
s-puig authored May 30, 2024
2 parents 057d027 + a3e60d3 commit 1f068db
Show file tree
Hide file tree
Showing 393 changed files with 23,524 additions and 5,988 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.
151 changes: 143 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ exclude = [
"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 @@ -54,6 +55,7 @@ workspace = true
default = [
"animation",
"bevy_asset",
"bevy_state",
"bevy_audio",
"bevy_color",
"bevy_gilrs",
Expand All @@ -66,7 +68,7 @@ default = [
"bevy_sprite",
"bevy_text",
"bevy_ui",
"multi-threaded",
"multi_threaded",
"png",
"hdr",
"vorbis",
Expand Down Expand Up @@ -251,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 @@ -301,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 @@ -328,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 All @@ -347,6 +357,7 @@ futures-lite = "2.0.1"
crossbeam-channel = "0.5.0"
argh = "0.1.12"
thiserror = "1.0"
event-listener = "5.3.0"

[[example]]
name = "hello_world"
Expand Down Expand Up @@ -412,6 +423,17 @@ description = "Renders a 2d mesh"
category = "2D Rendering"
wasm = true

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

[package.metadata.example.mesh2d_arcs]
name = "Arc 2D Meshes"
description = "Demonstrates UV-mapping of the circular segment and sector primitives"
category = "2D Rendering"
wasm = true

[[example]]
name = "mesh2d_manual"
path = "examples/2d/mesh2d_manual.rs"
Expand Down Expand Up @@ -1268,6 +1290,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 @@ -1381,6 +1414,29 @@ 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

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

[package.metadata.example.multi_asset_sync]
name = "Mult-asset synchronization"
description = "Demonstrates how to wait for multiple assets to be loaded."
category = "Assets"
wasm = true

# Async Tasks
[[example]]
name = "async_compute"
Expand Down Expand Up @@ -1701,35 +1757,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 @@ -2035,6 +2091,17 @@ description = "Demonstrates how reflection in Bevy provides a way to dynamically
category = "Reflection"
wasm = false

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

[package.metadata.example.custom_attributes]
name = "Custom Attributes"
description = "Registering and accessing custom attributes on reflected types"
category = "Reflection"
wasm = false

[[example]]
name = "dynamic_types"
path = "examples/reflection/dynamic_types.rs"
Expand Down Expand Up @@ -2903,6 +2970,29 @@ description = "Shows off rendering for all math primitives as both Meshes and Gi
category = "Math"
wasm = true

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

[package.metadata.example.sampling_primitives]
name = "Sampling Primitives"
description = "Demonstrates all the primitives which can be sampled."
category = "Math"
wasm = true

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

[package.metadata.example.random_sampling]
name = "Random Sampling"
description = "Demonstrates how to sample random points from mathematical primitives"
category = "Math"
wasm = true

# Gizmos
[[example]]
name = "2d_gizmos"
Expand Down Expand Up @@ -2971,6 +3061,17 @@ description = "Demonstrates visibility ranges"
category = "3D Rendering"
wasm = true

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

[package.metadata.example.ssr]
name = "Screen Space Reflections"
description = "Demonstrates screen space reflections with water ripples"
category = "3D Rendering"
wasm = false

[[example]]
name = "color_grading"
path = "examples/3d/color_grading.rs"
Expand All @@ -2982,6 +3083,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
Loading

0 comments on commit 1f068db

Please sign in to comment.