-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Comparing changes
Open a pull request
base repository: bevyengine/bevy
base: 1f6984d664ee6514f06534de8e06ee829b5b4507
head repository: bevyengine/bevy
compare: 70b9cc4068e1a33a57d89be3064277446c440302
- 19 commits
- 72 files changed
- 14 contributors
Commits on May 4, 2022
-
Make
RunOnce
a non-manualSystem
impl (#3922)# Objective - `RunOnce` was a manual `System` implementation. - Adding run criteria to stages was yet to be systemyoten ## Solution - Make it a normal function - yeet ## Changelog - Replaced `RunOnce` with `ShouldRun::once` ## Migration guide The run criterion `RunOnce`, which would make the controlled systems run only once, has been replaced with a new run criterion function `ShouldRun::once`. Replace all instances of `RunOnce` with `ShouldRun::once`.
Configuration menu - View commit details
-
Copy full SHA for 9d440fb - Browse repository at this point
Copy the full SHA 9d440fbView commit details -
bevy_ptr
standalone crate (#4653)# Objective The pointer types introduced in #3001 are useful not just in `bevy_ecs`, but also in crates like `bevy_reflect` (#4475) or even outside of bevy. ## Solution Extract `Ptr<'a>`, `PtrMut<'a>`, `OwnedPtr<'a>`, `ThinSlicePtr<'a, T>` and `UnsafeCellDeref` from `bevy_ecs::ptr` into `bevy_ptr`. **Note:** `bevy_ecs` still reexports the `bevy_ptr` as `bevy_ecs::ptr` so that crates like `bevy_transform` can use the `Bundle` derive without needing to depend on `bevy_ptr` themselves.
Configuration menu - View commit details
-
Copy full SHA for 1e322d9 - Browse repository at this point
Copy the full SHA 1e322d9View commit details -
set alpha_mode based on alpha value (#4658)
# Objective - When spawning a sprite the alpha is used for transparency, but when using the `Color::into()` implementation to spawn a `StandardMaterial`, the alpha is ignored. - Pretty much everytime I want to make something transparent I started with a `Color::rgb().into()` and I'm always surprised that it doesn't work when changing it to `Color::rgba().into()` - It's possible there's an issue with this approach I am not thinking of, but I'm not sure what's the point of setting an alpha value without the goal of making a color transparent. ## Solution - Set the alpha_mode to AlphaMode::Blend when the alpha is not the default value. --- ## Migration Guide This is not a breaking change, but it can easily be migrated to reduce boilerplate ```rust commands.spawn_bundle(PbrBundle { mesh: meshes.add(shape::Cube::default().into()), material: materials.add(StandardMaterial { base_color: Color::rgba(1.0, 0.0, 0.0, 0.75), alpha_mode: AlphaMode::Blend, ..default() }), ..default() }); // becomes commands.spawn_bundle(PbrBundle { mesh: meshes.add(shape::Cube::default().into()), material: materials.add(Color::rgba(1.0, 0.0, 0.0, 0.75).into()), ..default() }); ``` Co-authored-by: Charles <IceSentry@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 3f4ac65 - Browse repository at this point
Copy the full SHA 3f4ac65View commit details -
Make Wireframe respect visible entities (#4660)
# Objective - Make meshes with a Wireframe component not render if they are not in the VisibleEntities list of a given camera - See [discussion](https://discord.com/channels/691052431525675048/742884593551802431/971392761972527144) on the Bevy Engine Discord - Fixes this kind of issues: ![image](https://user-images.githubusercontent.com/1733200/166746303-39003d57-8b07-4ae2-9ddf-bacdb04e7d84.png) Camera for the RenderTexture in the bottom left is set to only see layer 1 entities. The three colored lines are on the render layer 1, but not the sphere (which has a Wireframe component). ## Solution - Mimick what is done in [bevy_pbr/src/material.rs#L307](https://github.com/bevyengine/bevy/blob/479f43bbf34834ad2d4667de43351b6fa51f22d1/crates/bevy_pbr/src/material.rs#L307) for [bevy_pbr/src/wireframe.rs#L106](https://github.com/bevyengine/bevy/blob/2b6e67f4cb441f658cad17486eea9e3485e56709/crates/bevy_pbr/src/wireframe.rs#L106) - Credits to beep for finding this out!
Configuration menu - View commit details
-
Copy full SHA for f02bea5 - Browse repository at this point
Copy the full SHA f02bea5View commit details
Commits on May 5, 2022
-
Add RegularPolygon and Circle meshes (#3730)
# Objective Bevy users often want to create circles and other simple shapes. All the machinery is in place to accomplish this, and there are external crates that help. But when writing code for e.g. a new bevy example, it's not really possible to draw a circle without bringing in a new asset, writing a bunch of scary looking mesh code, or adding a dependency. In particular, this PR was inspired by this interaction in another PR: #3721 (comment) ## Solution This PR adds `shape::RegularPolygon` and `shape::Circle` (which is just a `RegularPolygon` that defaults to a large number of sides) ## Discussion There's a lot of ongoing discussion about shapes in <bevyengine/rfcs#12> and at least one other lingering shape PR (although it seems incomplete). That RFC currently includes `RegularPolygon` and `Circle` shapes, so I don't think that having working mesh generation code in the engine for those shapes would add much burden to an author of an implementation. But if we'd prefer not to add additional shapes until after that's sorted out, I'm happy to close this for now. ## Alternatives for users For any users stumbling on this issue, here are some plugins that will help if you need more shapes. https://github.com/Nilirad/bevy_prototype_lyon https://github.com/johanhelsing/bevy_smud https://github.com/Weasy666/bevy_svg https://github.com/redpandamonium/bevy_more_shapes https://github.com/ForesightMiningSoftwareCorporation/bevy_polyline
Configuration menu - View commit details
-
Copy full SHA for f8e0fc1 - Browse repository at this point
Copy the full SHA f8e0fc1View commit details -
Add support for vertex colors (#4528)
# Objective Add support for vertex colors ## Solution This change is modeled after how vertex tangents are handled, so the shader is conditionally compiled with vertex color support if the mesh has the corresponding attribute set. Vertex colors are multiplied by the base color. I'm not sure if this is the best for all cases, but may be useful for modifying vertex colors without creating a new mesh. I chose `VertexFormat::Float32x4`, but I'd prefer 16-bit floats if/when support is added. ## Changelog ### Added - Vertex colors can be specified using the `Mesh::ATTRIBUTE_COLOR` mesh attribute.
Configuration menu - View commit details
-
Copy full SHA for 82d849d - Browse repository at this point
Copy the full SHA 82d849dView commit details -
StorageBuffer uses wrong type to calculate the buffer size. (#4557)
# Objective Fixes #4556 ## Solution StorageBuffer must use the Size of the std430 representation to calculate the buffer size, as the std430 representation is the data that will be written to it.
Configuration menu - View commit details
-
Copy full SHA for 5585308 - Browse repository at this point
Copy the full SHA 5585308View commit details -
Allow closing windows at runtime (#3575)
# Objective Fixes #3180, builds from #2898 ## Solution Support requesting a window to be closed and closing a window in `bevy_window`, and handle this in `bevy_winit`. This is a stopgap until we move to windows as entites, which I'm sure I'll get around to eventually. ## Changelog ### Added - `Window::close` to allow closing windows. - `WindowClosed` to allow reacting to windows being closed. ### Changed Replaced `bevy::system::exit_on_esc_system` with `bevy::window::close_on_esc`. ## Fixed The app no longer exits when any window is closed. This difference is only observable when there are multiple windows. ## Migration Guide `bevy::input::system::exit_on_esc_system` has been removed. Use `bevy::window::close_on_esc` instead. `CloseWindow` has been removed. Use `Window::close` instead. The `Close` variant has been added to `WindowCommand`. Handle this by closing the relevant window.
Configuration menu - View commit details
-
Copy full SHA for b731eba - Browse repository at this point
Copy the full SHA b731ebaView commit details
Commits on May 6, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 96b4956 - Browse repository at this point
Copy the full SHA 96b4956View commit details -
Configuration menu - View commit details
-
Copy full SHA for ec805e9 - Browse repository at this point
Copy the full SHA ec805e9View commit details -
some cleanup for
bevy_ptr
(#4668)1. change `PtrMut::as_ptr(self)` and `OwnedPtr::as_ptr(self)` to take `&self`, otherwise printing the pointer will prevent doing anything else afterwards 2. make all `as_ptr` methods safe. There's nothing unsafe about obtaining a pointer, these kinds of methods are safe in std as well [str::as_ptr](https://doc.rust-lang.org/stable/std/primitive.str.html#method.as_ptr), [Rc::as_ptr](https://doc.rust-lang.org/stable/std/rc/struct.Rc.html#method.as_ptr) 3. rename `offset`/`add` to `byte_offset`/`byte_add`. The unprefixed methods in std add in increments of `std::mem::size_of::<T>`, not in bytes. There's a PR for rust to add these byte_ methods rust-lang/rust#95643 and at the call site it makes it much more clear that you need to do `.byte_add(i * layout_size)` instead of `.add(i)`
Configuration menu - View commit details
-
Copy full SHA for d63b7e9 - Browse repository at this point
Copy the full SHA d63b7e9View commit details -
Add the license for the FiraMono font (#3589)
I copied the license from https://github.com/mozilla/Fira/blob/master/LICENSE. The fact that the license file was missing came up in a discussion on [discord](https://discord.com/channels/691052431525675048/695741366520512563/929332683149017119).
Configuration menu - View commit details
-
Copy full SHA for d46cf69 - Browse repository at this point
Copy the full SHA d46cf69View commit details -
simple tool to compare traces between executions (#4628)
# Objective - Have an easy way to compare spans between executions ## Solution - Add a tool to compare spans from chrome traces ```bash > cargo run --release -p spancmp -- --help Compiling spancmp v0.1.0 Finished release [optimized] target(s) in 1.10s Running `target/release/spancmp --help` spancmp USAGE: spancmp [OPTIONS] <TRACE> [SECOND_TRACE] ARGS: <TRACE> <SECOND_TRACE> OPTIONS: -h, --help Print help information -p, --pattern <PATTERN> Filter spans by name matching the pattern -t, --threshold <THRESHOLD> Filter spans that have an average shorther than the threshold [default: 0] ``` for each span, it will display the count, minimum duration, average duration and max duration. It can be filtered by a pattern on the span name or by a minimum average duration. just displaying a trace ![Screenshot 2022-04-28 at 21 56 21](https://user-images.githubusercontent.com/8672791/165835310-f465c6f2-9e6b-4808-803e-884b06e49292.png) comparing two traces ![Screenshot 2022-04-28 at 21 56 55](https://user-images.githubusercontent.com/8672791/165835353-097d266b-a70c-41b8-a8c1-27804011dc97.png) Co-authored-by: Robert Swain <robert.swain@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 068e9ea - Browse repository at this point
Copy the full SHA 068e9eaView commit details -
Make public macros more robust with $crate (#4655)
# Objective We have some macros that are public but only used internally for now. They fail on user's code due to the use of crate names like `bevy_utils`, while the user only has `bevy::utils`. There are two affected macros. - `bevy_utils::define_label`: it may be useful in user's code for defining custom kinds of label traits (this is why I made this PR). - `bevy_asset::load_internal_asset`: not useful currently due to limitations of the debug asset server, but this may change in the future. ## Solution We can make them work by using `$crate` instead of names of their own crates, which can refer to the macro's defining crate regardless of the user's setup. Even though our objective is rather low-priority here, the solution adds no maintenance cost so it is still worthwhile.
Configuration menu - View commit details
-
Copy full SHA for aabc47f - Browse repository at this point
Copy the full SHA aabc47fView commit details -
use const Vec2 in lights cluster and bounding box when possible (#4602)
# Objective - noticed a few Vec3 and Vec2 that could be const ## Solution - Declared them as const - It seems to make a tiny improvement in example `many_light`, but given that the change is not complex at all it could still be worth it
Configuration menu - View commit details
-
Copy full SHA for 743bd30 - Browse repository at this point
Copy the full SHA 743bd30View commit details
Commits on May 7, 2022
-
Stop labeling PRs with Needs-Triage (#4686)
# Objective - New PRs are labeled with Needs-Triage, but this is unhelpful and creates busy work: it's just as easy to check for unlabelled PRs, especially now that we no longer have an unlabelled backlog. Note: this is not true for issues. Issues start with at least one label based on which template they use, and so there's no good way to filter for issues that need attention from the triage team. ## Solution - Remove responsible CI tasks.
Configuration menu - View commit details
-
Copy full SHA for d867b61 - Browse repository at this point
Copy the full SHA d867b61View commit details
Commits on May 8, 2022
-
Add a fun skinned mesh stress test based on the animated_fox example (#…
…4674) # Objective - Add a stress test for skinned meshes https://user-images.githubusercontent.com/302146/167111578-55a7d58a-0ec8-4735-a043-f084f0ff3939.mp4
Configuration menu - View commit details
-
Copy full SHA for 76829f9 - Browse repository at this point
Copy the full SHA 76829f9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7b89a01 - Browse repository at this point
Copy the full SHA 7b89a01View commit details -
Configuration menu - View commit details
-
Copy full SHA for 70b9cc4 - Browse repository at this point
Copy the full SHA 70b9cc4View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff 1f6984d664ee6514f06534de8e06ee829b5b4507...70b9cc4068e1a33a57d89be3064277446c440302