Skip to content

Commit

Permalink
Merge branch 'main' into fixed-update-cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
Lubba-64 authored Sep 3, 2024
2 parents 1b1c6a8 + 32f40f1 commit ad583e2
Show file tree
Hide file tree
Showing 136 changed files with 5,275 additions and 2,019 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Check for typos
uses: crate-ci/typos@v1.24.1
uses: crate-ci/typos@v1.24.3
- name: Typos info
if: failure()
run: |
Expand Down
28 changes: 26 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1407,7 +1407,8 @@ doc-scrape-examples = true
name = "Custom Asset IO"
description = "Implements a custom AssetReader"
category = "Assets"
wasm = true
# Incompatible with the asset path patching of the example-showcase tool
wasm = false

[[example]]
name = "embedded_asset"
Expand All @@ -1429,7 +1430,8 @@ doc-scrape-examples = true
name = "Extra asset source"
description = "Load an asset from a non-standard asset source"
category = "Assets"
wasm = true
# Uses non-standard asset path
wasm = false

[[example]]
name = "hot_asset_reloading"
Expand Down Expand Up @@ -2415,6 +2417,17 @@ description = "A shader that shows how to bind and sample multiple textures as a
category = "Shaders"
wasm = false

[[example]]
name = "storage_buffer"
path = "examples/shader/storage_buffer.rs"
doc-scrape-examples = true

[package.metadata.example.storage_buffer]
name = "Storage Buffer"
description = "A shader that shows how to bind a storage buffer using a custom material."
category = "Shaders"
wasm = true

[[example]]
name = "specialized_mesh_pipeline"
path = "examples/shader/specialized_mesh_pipeline.rs"
Expand Down Expand Up @@ -3395,6 +3408,17 @@ description = "Demonstrates picking sprites and sprite atlases"
category = "Picking"
wasm = true

[[example]]
name = "animation_masks"
path = "examples/animation/animation_masks.rs"
doc-scrape-examples = true

[package.metadata.example.animation_masks]
name = "Animation Masks"
description = "Demonstrates animation masks"
category = "Animation"
wasm = true

[profile.wasm-release]
inherits = "release"
opt-level = "z"
Expand Down
6 changes: 6 additions & 0 deletions assets/animation_graphs/Fox.animgraph.ron
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,27 @@
nodes: [
(
clip: None,
mask: 0,
weight: 1.0,
),
(
clip: None,
mask: 0,
weight: 0.5,
),
(
clip: Some(AssetPath("models/animated/Fox.glb#Animation0")),
mask: 0,
weight: 1.0,
),
(
clip: Some(AssetPath("models/animated/Fox.glb#Animation1")),
mask: 0,
weight: 1.0,
),
(
clip: Some(AssetPath("models/animated/Fox.glb#Animation2")),
mask: 0,
weight: 1.0,
),
],
Expand All @@ -32,4 +37,5 @@
],
),
root: 0,
mask_groups: {},
)
38 changes: 38 additions & 0 deletions assets/shaders/storage_buffer.wgsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#import bevy_pbr::{
mesh_functions,
view_transformations::position_world_to_clip
}

@group(2) @binding(0) var<storage, read> colors: array<vec4<f32>, 5>;

struct Vertex {
@builtin(instance_index) instance_index: u32,
@location(0) position: vec3<f32>,
};

struct VertexOutput {
@builtin(position) clip_position: vec4<f32>,
@location(0) world_position: vec4<f32>,
@location(1) color: vec4<f32>,
};

@vertex
fn vertex(vertex: Vertex) -> VertexOutput {
var out: VertexOutput;
var world_from_local = mesh_functions::get_world_from_local(vertex.instance_index);
out.world_position = mesh_functions::mesh_position_local_to_world(world_from_local, vec4(vertex.position, 1.0));
out.clip_position = position_world_to_clip(out.world_position.xyz);

// We have 5 colors in the storage buffer, but potentially many instances of the mesh, so
// we use the instance index to select a color from the storage buffer.
out.color = colors[vertex.instance_index % 5];

return out;
}

@fragment
fn fragment(
mesh: VertexOutput,
) -> @location(0) vec4<f32> {
return mesh.color;
}
2 changes: 2 additions & 0 deletions crates/bevy_animation/src/animatable.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Traits and type for interpolating between values.

use crate::util;
use bevy_color::{Laba, LinearRgba, Oklaba, Srgba, Xyza};
use bevy_ecs::world::World;
Expand Down
Loading

0 comments on commit ad583e2

Please sign in to comment.