mirror of
https://github.com/bevyengine/bevy.git
synced 2026-07-03 09:13:55 -04:00
create-pull-request/patch
10 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
77aa53b74e |
Fix large scene mip map generator material change detection trigger (#24532)
https://github.com/bevyengine/bevy/pull/22460 broke the material change detection trigger in the large scenes mip map generator plugin. ## Testing Ran the test_image example in mipmap_generator and the bistro scene and textures with mip maps were shown as expected after this fix. |
||
|
|
a2e47d0793 |
Update intel_tex_2 requirement from 0.4.0 to 0.5.0 (#22447)
Updates the requirements on [intel_tex_2](https://github.com/Traverse-Research/intel-tex-rs-2) to permit the latest version. <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/Traverse-Research/intel-tex-rs-2/commit/9a05fb8926d635014fddfcadb02ffd5c84822688"><code>9a05fb8</code></a> Release 0.5.0 (<a href="https://redirect.github.com/Traverse-Research/intel-tex-rs-2/issues/37">#37</a>)</li> <li><a href="https://github.com/Traverse-Research/intel-tex-rs-2/commit/f622631ac87056ef2bafd6468f6a7d703bea13dc"><code>f622631</code></a> Add <code>ispc_texcomp_astc</code> compiled against static Windows/MSVC CRT (<a href="https://redirect.github.com/Traverse-Research/intel-tex-rs-2/issues/35">#35</a>)</li> <li><a href="https://github.com/Traverse-Research/intel-tex-rs-2/commit/31619c18a5438293600a3f5b6d6d89a92707cff7"><code>31619c1</code></a> CI: Sync up <code>generate-binaries</code> with <code>ispc-downsampler</code> slightly to include `...</li> <li><a href="https://github.com/Traverse-Research/intel-tex-rs-2/commit/446eb43d5fd21a1da3646f6cc4b7361b82277689"><code>446eb43</code></a> 🔖 Fix typo (<a href="https://redirect.github.com/Traverse-Research/intel-tex-rs-2/issues/33">#33</a>)</li> <li><a href="https://github.com/Traverse-Research/intel-tex-rs-2/commit/7a262278c8a54014bb54f321430c7574713cf7b6"><code>7a26227</code></a> 🎍 Consistent encode settings referencing (<a href="https://redirect.github.com/Traverse-Research/intel-tex-rs-2/issues/32">#32</a>)</li> <li>See full diff in <a href="https://github.com/Traverse-Research/intel-tex-rs-2/compare/0.4.0...0.5.0">compare view</a></li> </ul> </details> <br /> You can trigger a rebase of this PR by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> > **Note** > Automatic rebases have been disabled on this pull request as it has been open for over 30 days. Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Carter Anderson <mcanders1@gmail.com> |
||
|
|
535cf401cc |
Reframe old "scene" terminology as "world serialization" (#23630)
Part 2 of #23619 In **Bevy 0.19** we are landing a subset of Bevy's Next Generation Scene system (often known as BSN), which now lives in the `bevy_scene` / `bevy::scene` crate. However the old `bevy_scene` system still needs to stick around for a bit longer, as it provides some features that Bevy's Next Generation Scene system doesn't (yet!): 1. It is not _yet_ possible to write a World _to_ BSN, so the old system is still necessary for "round trip World serialization". 2. The GLTF scene loader has not yet been ported to BSN, so the old system is still necessary to spawn GLTF scenes in Bevy. For this reason, we have renamed the old `bevy_scene` crate to `bevy_world_serialization`. If you were referencing `bevy_scene::*` or `bevy::scene::*` types, rename those paths to `bevy_world_serialization::*` and `bevy::world_serialization::*` respectively. Additionally, to avoid confusion / conflicts with the new scene system, all "scene" terminology / types have been reframed as "world serialization": - `Scene` -> `WorldAsset` (as this was always just a World wrapper) - `SceneRoot` -> `WorldAssetRoot` - `DynamicScene` -> `DynamicWorld` - `DynamicScene::from_scene` -> `DynamicWorld::from_world_asset` - `DynamicSceneBuilder` -> `DynamicWorldBuilder` - `DynamicSceneRoot` -> `DynamicWorldRoot` - `SceneInstanceReady` -> `WorldInstanceReady` - `SceneLoader` -> `WorldAssetLoader` - `ScenePlugin` -> `WorldSerializationPlugin` - `SceneRootTemplate` -> `WorldAssetRootTemplate` - `SceneSpawner` -> `WorldInstanceSpawner` - `SceneFilter` -> `WorldFilter` - `SceneLoaderError` -> `WorldAssetLoaderError` - `SceneSpawnError` -> `WorldInstanceSpawnError` Note that I went with `bevy_world_serialization` over `bevy_ecs_serialization`, as that is what all of the internal features described themselves as. I think it is both more specific and does a better job of making itself decoupled from `bevy_ecs` proper. |
||
|
|
45e454a83b |
Rename bevy_scene to bevy_ecs_serialization (#23619)
# Objective The first part of #23606. ## Solution Rename `bevy_scene` to `bevy_ecs_serialization`. No other changes were made. ## Testing The `scene` example still works as expected. |
||
|
|
9fd2637846 |
Add tools to avoid unnecessary AssetEvent::Modified events that lead to rendering performance costs (#16751) (#22460)
# Objective - Fixes #16751 ## Solution - `Assets::get_mut` now returns a wrapper `AssetMut` type instead of `&mut impl Asset`. - `AssetMut` implements `Deref` and `DerefMut`. - `DerefMut` marks assets as changed. - when dropped `AssetMut` will add `AssetEvent::Modified` event to a queue only in case asset was marked as changed. ## Testing - Did you test these changes? If so, how? - No unit tests were added, change is pretty straightforward. - Test project: https://github.com/MatrixDev/bevy-feature-16751-test. - With change: ~100 fps. - Without change: ~15 fps. - Are there any parts that need more testing? - I don't really see how this can break anything or add a measurable overhead. - `AssetEvent::Modified` will now be sent after the asset was modified instead of before. It should not affect anything but still worth noting. - How can other people (reviewers) test your changes? Is there anything specific they need to know? - Have a big amount of entities that constantly update their materials. - Properties of those materials should be animated in a stepped maned (like changing color every 0.1 seconds). - Update material only if value has actually changed: ```rust if material.base_color != new_color { material.base_color = new_color; } ``` - If relevant, what platforms did you test these changes on, and are there any important ones you can't test? - tested on macos (Mackbook M1) - not a platform-specific issue PS: This is my first PR, so please don’t judge. |
||
|
|
d1dc09ae19 |
Use the shorthand functions to construct Vals and UiRects in examples (#22765)
# Objective - Fixes #22753 ## Solution - Replace `Val::Px` and `Val::Auto` with `px()` and `auto()` in examples ## Testing - None |
||
|
|
6ca4769128 |
Minimal responsive FontSize support (#22614)
# Objective
Add responsive font sizes supporting rem and viewport units to
`bevy_text` with minimal changes to the APIs and systems.
## Solution
Introduce a new `FontSize` enum:
```rust
pub enum FontSize {
/// Font Size in logical pixels.
Px(f32),
/// Font size as a percentage of the viewport width.
Vw(f32),
/// Font size as a percentage of the viewport height.
Vh(f32),
/// Font size as a percentage of the smaller of the viewport width and height.
VMin(f32),
/// Font size as a percentage of the larger of the viewport width and height.
VMax(f32),
/// Font Size relative to the value of the `RemSize` resource.
Rem(f32),
}
```
This replaces the `f32` value of `TextFont`'s `font_size` field.
The viewport variants work the same way as their respective `Val`
counterparts.
`Rem` values are multiplied by the value of the `RemSize` resource
(which newtypes an `f32`).
`FontSize` provides an `eval` method that takes a logical viewport size
and rem base size and returns an `f32` logical font size. The resolved
logical font size is then written into the `Attributes` passed to Cosmic
Text by `TextPipeline::update_buffer`.
Any text implementation using `bevy_text` must now provide viewport and
rem base values when calling `TextPipeline::update_buffer` or
`create_measure`.
`Text2d` uses the size of the primary window to resolve viewport values
(or `Vec2::splat(1000)` if no primary window is found). This is a
deliberate compromise, a single `Text2d` can be rendered to multiple
viewports using `RenderLayers`, so it's difficult to find a rule for
which viewport size should be chosen.
### Change detection
`ComputedTextBlock` has two new fields: `uses_viewport_sizes` and
`uses_rem_sizes`, which are set to true in `TextPipeline::update_buffer`
iff any text section in the block uses viewport or rem font sizes,
respectively.
The `ComputedTextBlock::needs_rerender` method has been modified to take
take two bool parameters:
```rust
pub fn needs_rerender(
&self,
is_viewport_size_changed: bool,
is_rem_size_changed: bool,
) -> bool {
self.needs_rerender
|| (is_viewport_size_changed && self.uses_viewport_sizes)
|| (is_rem_size_changed && self.uses_rem_sizes)
}
```
This ensures that text reupdates will also be scheduled if one of the text section's uses a viewport font size and the local viewport size changed, or if one of the text section's uses a rem font size and the rem size changed.
#### Limitations
There are some limitations because we don't have any sort of font style inheritance yet:
* "rem" units aren't proper rem units, and just based on the value of a resource.
* "em" units are resolved based on inherited font size, so can't be implemented without inheritance support.
#### Notes
* This PR is quite small and not very technical. Reviewers don't need to be especially familiar with `bevy_text`. Most of the changes are to the examples.
* We could consider using `Val` instead of `FontSize`, then we could use `Val`'s constructor functions which would be much nicer, but some variants might not have sensible interpretations in both UI and Text2d contexts. Also we'd have to make `Val` accessible to `bevy_text`.
## Testing
The changes to the text systems are relatively trivial and easy to understand. I already added a minor change to the `text` example to use `Vh` font size for the "hello bevy" text in the bottom right corner. If you change the size of the window, you should see the text change size in response. The text initially flickers before it updates because of some unrelated asset/image changes that mean that font textures aren't ready until the frame after the text update that changes the font size.
Most of the example migrations were automated using regular expressions, and there are bound to be mistakes in those changes. It's infeasible to check every single example thoroughly, but it's early enough in the release cycle that I don't think we should be too worried if a few bugs slip in.
---------
Co-authored-by: Kevin Chen <chen.kevin.f@gmail.com>
|
||
|
|
14816e0500 |
Update fast_image_resize requirement from 5.4 to 6.0 (#22514)
Updates the requirements on [fast_image_resize](https://github.com/cykooz/fast_image_resize) to permit the latest version. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/cykooz/fast_image_resize/releases">fast_image_resize's releases</a>.</em></p> <blockquote> <h2>[6.0.0] - 2026-01-13</h2> <h3>Added</h3> <ul> <li> <p><strong>BREAKING</strong>: Added support of <code>no_std</code> environment (<a href="https://redirect.github.com/Cykooz/fast_image_resize/issues/58">#58</a>). To use the crate in a such environment, you must disable default features and enabled the <code>no_std</code> feature.</p> <p>If you already have default features disabled and want to continue using the crate in <code>std</code> environment, you have to enable the <code>std</code> feature.</p> </li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/Cykooz/fast_image_resize/blob/main/CHANGELOG.md">fast_image_resize's changelog</a>.</em></p> <blockquote> <h2>[6.0.0] - 2026-01-13</h2> <h3>Added</h3> <ul> <li> <p><strong>BREAKING</strong>: Added support of <code>no_std</code> environment (<a href="https://redirect.github.com/Cykooz/fast_image_resize/issues/58">#58</a>). To use the crate in a such environment, you must disable default features and enabled the <code>no_std</code> feature.</p> <p>If you already have default features disabled and want to continue using the crate in <code>std</code> environment, you have to enable the <code>std</code> feature.</p> </li> </ul> <h2>[5.6.0] - 2026-01-07 (yanked)</h2> <p>This version was yanked due to a backwards compatibility break - a new feature <code>std</code> was added to the list of default features.</p> <h2>[5.5.0] - 2026-01-02</h2> <h3>Added</h3> <ul> <li>Added support of some variants of <code>ImageBuffer</code> type form the <code>image</code> crate (<a href="https://redirect.github.com/Cykooz/fast_image_resize/issues/57">#57</a>).</li> </ul> <h2>[5.4.0] - 2025-11-28</h2> <h3>Added</h3> <ul> <li>Added <code>bytemuck</code> feature and implemented some <code>bytemuck</code> traits for the <code>Pixel</code> type (<a href="https://redirect.github.com/Cykooz/fast_image_resize/pull/56">#56</a>).</li> </ul> <h2>[5.3.0] - 2025-09-02</h2> <h3>Added</h3> <ul> <li>Added support for multi-thread image resizing using the <code>ResizeAlg::Nearest</code> algorithm. (<a href="https://redirect.github.com/Cykooz/fast_image_resize/issues/54">#54</a>).</li> </ul> <h2>[5.2.2] - 2025-08-29</h2> <h3>Fixed</h3> <ul> <li>Fixed a "divide by zero" error in case of using multithreading to resize images with particular sizes (<a href="https://redirect.github.com/Cykooz/fast_image_resize/issues/55">#55</a>).</li> </ul> <h2>[5.2.1] - 2025-07-27</h2> <h3>Changed</h3> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/Cykooz/fast_image_resize/commit/a563fb6226009171143d81d250db4a823a034895"><code>a563fb6</code></a> chore: Release</li> <li><a href="https://github.com/Cykooz/fast_image_resize/commit/dbcef13f9c454db5fd80ad2ae412415d5edd1a8f"><code>dbcef13</code></a> Improved the note in the changelog.</li> <li><a href="https://github.com/Cykooz/fast_image_resize/commit/482c7503ab199e01b8a198ca67b6de9ba4739544"><code>482c750</code></a> Improved the note in the changelog.</li> <li><a href="https://github.com/Cykooz/fast_image_resize/commit/b075157b74aa733eec2634f23a5544dab8d45348"><code>b075157</code></a> Improved the note in the changelog.</li> <li><a href="https://github.com/Cykooz/fast_image_resize/commit/2772f93ace38ef14dd197207d4cdc6452810f2c4"><code>2772f93</code></a> Release 5.6 was yanked. Prepare to release 6.0.</li> <li><a href="https://github.com/Cykooz/fast_image_resize/commit/01889ecd0dc2b0dfee674253cbb9ad5a60377d2c"><code>01889ec</code></a> chore: Release</li> <li><a href="https://github.com/Cykooz/fast_image_resize/commit/fd203b6a7adeb86b582e739657f8de0d7f473f4f"><code>fd203b6</code></a> Corrected position of <code>document-features</code> dependency in Cargo.toml.</li> <li><a href="https://github.com/Cykooz/fast_image_resize/commit/abf8d8a1e26036e1045f0b897627f84c536398ec"><code>abf8d8a</code></a> Added <code>no_std</code> keyword to Cargo.toml</li> <li><a href="https://github.com/Cykooz/fast_image_resize/commit/b2dda5ef3852052f3cd327c39b153e2f9b80d1aa"><code>b2dda5e</code></a> Added GitHub Action to test of building documentation for docs.rs</li> <li><a href="https://github.com/Cykooz/fast_image_resize/commit/8b25261b42d94957778dd15d1b49d3009e52c5db"><code>8b25261</code></a> Fixed <code>compat</code> module.</li> <li>Additional commits viewable in <a href="https://github.com/cykooz/fast_image_resize/compare/v5.4.0...v6.0.0">compare view</a></li> </ul> </details> <br /> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
|
|
a88af65738 |
Contact Shadows (#22382)
# Objective - Implement contact shadows to add fine shadow detail where shadow cascades cannot. ## Solution - Extend our existing pbr implementation using our existing raymarching functions. --- ## Showcase <img width="1824" height="1180" alt="image" src="https://github.com/user-attachments/assets/e93b79c5-c596-4a9e-b94d-20bdde1d863b" /> <img width="1824" height="1180" alt="image" src="https://github.com/user-attachments/assets/0fd7dffa-60b8-4b92-8fad-7f993d4d89dd" /> https://github.com/user-attachments/assets/e74b190d-9ae3-4aaf-97f0-b520930a0667 https://github.com/user-attachments/assets/e80ccb26-bbaa-4d25-a823-8ea12354c5b9 https://github.com/user-attachments/assets/b04f4b00-92bd-4a2f-b7dd-5157d8fbe0ab <img width="1073" height="685" alt="image" src="https://github.com/user-attachments/assets/b7629908-dd32-48db-8ee7-a4d2dd8f66c2" /> <img width="1073" height="685" alt="image" src="https://github.com/user-attachments/assets/3de0258e-9191-4180-ac57-41b32e1205bd" /> <img width="1073" height="685" alt="image" src="https://github.com/user-attachments/assets/951477f9-e9a9-426f-ae8d-18ae50cc7b85" /> <img width="1073" height="685" alt="image" src="https://github.com/user-attachments/assets/2291453c-da57-4fcc-a6b0-f60f6eac6cbb" /> <img width="1073" height="685" alt="image" src="https://github.com/user-attachments/assets/5820cdff-ea54-4294-b520-2a8d8dc24996" /> <img width="1073" height="685" alt="image" src="https://github.com/user-attachments/assets/3ea16481-7689-4e99-87e2-1589f1532e4c" /> --------- Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com> Co-authored-by: charlotte 🌸 <charlotte.c.mcelwain@gmail.com> |
||
|
|
61dab1013a |
Large scenes (#22409)
# Objective Move https://github.com/DGriffin91/bevy_bistro_scene and https://github.com/DGriffin91/bevy_caldera_scene into the bevy repo for allow for easier testing. This also adds https://github.com/DGriffin91/bevy_mod_mipmap_generator in the new `large_scene` folder because GPU texture fetch cache locality is important. This could be eventually available more generally as a part of bevy. But wanted to get something quick and basic in for now. Not totally sure what these readme's should look like. I mostly just copied them over and made a few tweaks. This PR is meant to just be an initial starting point, it does not address automatically acquiring the required assets. --------- Co-authored-by: François Mockers <francois.mockers@vleue.com> |