Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
69637b5
Bump super-linter/super-linter from 8.2.1 to 8.3.0 (#21992)
dependabot[bot] Dec 1, 2025
1285ccf
Bump crate-ci/typos from 1.39.2 to 1.40.0 (#21993)
dependabot[bot] Dec 1, 2025
c378b7a
Update criterion requirement from 0.7.0 to 0.8.0 (#21994)
dependabot[bot] Dec 1, 2025
5fbc9f1
`PointerbuttonState::clear` (#21997)
ickshonpe Dec 1, 2025
1f97c83
Fix crash on exit due to destroyed surface texture (#21976)
SarthakSingh31 Dec 2, 2025
f9d59f8
Fix cargo features lint (#22008)
Zeophlite Dec 2, 2025
243d562
remove unnecessary clone from `load_font_to_fontdb` (#22009)
ickshonpe Dec 2, 2025
71114e1
Add debug_group to render graph (#22003)
IceSentry Dec 2, 2025
a06de1f
UI text module refactor (#21630)
ickshonpe Dec 2, 2025
8c78e46
#21980 Fix Component/Relationship derive using non fully qualified pa…
HeartofPhos Dec 3, 2025
8978b47
Fix dragging-over panic (#21999)
ickshonpe Dec 3, 2025
aa14ada
Fix extended_material_bindless example wgpu validation error on MacOS…
NicoZweifel Dec 3, 2025
41f59f1
TypeData dependencies (#22016)
cart Dec 3, 2025
540d585
Add Clone derive to ViewTarget (#22024)
tychedelia Dec 3, 2025
1720e5b
Ignore text buffer metrics (#22022)
ickshonpe Dec 4, 2025
6cbc4b2
Remove redundant `shape_until_scroll` (#22020)
ickshonpe Dec 4, 2025
e8520c1
Added required features data to docs export (#21975)
Sigma-dev Dec 4, 2025
6e88ae2
Inline register_type_data to cut down on binary size (#22030)
cart Dec 5, 2025
700ee46
Fix some lints from rust 1.89 bump (#22034)
hymm Dec 5, 2025
ecbb562
Clarify docs for `ExtractSchedule` (#22012)
bilsen Dec 5, 2025
dba7c74
Don't update the text buffer in `text_system` (#21966)
ickshonpe Dec 6, 2025
008ca5d
Remove `getrandom` dependency from `bevy_platform`. (#21971)
kpreid Dec 7, 2025
ad1c38a
Fix the doc test for WebAssetPlugin (#21968)
andriyDev Dec 7, 2025
25d4ced
enable easier modification of image samplers in image loaders (#22042)
ChristopherBiscardi Dec 7, 2025
89e4193
add missing `Iterator::size_hint` overrides, most of which cause `Exa…
JonasJebing Dec 7, 2025
84e1278
Update size and metrics after `set_rich_text` in `TextPipeline::updat…
ickshonpe Dec 7, 2025
9f4b18d
Release the asset infos lock before acquiring the file transaction lo…
andriyDev Dec 7, 2025
149cbab
compute the text buffer size during layout updates (#22010)
ickshonpe Dec 7, 2025
49d4433
`TextLayoutInfo::clear` (#22006)
ickshonpe Dec 7, 2025
ad15fda
Fix unsound `&EntityMutExcept` to `FilteredEntityMut` conversion (#21…
ItsDoot Dec 7, 2025
7a7fe9f
remove newline between `CursorIcon` struct and its attributes (#22002)
databasedav Dec 7, 2025
cb719be
Update meshlet asset URL (#22058)
JMS55 Dec 7, 2025
0235bdb
Replace `BTreeMap` with `IndexMap` for stored `ScheduleBuildPass`es (…
ItsDoot Dec 7, 2025
d9c8330
Add `Observer::with_components` (#21857)
Shatur Dec 7, 2025
258a175
Fix comment in `pointer_events` (#21996)
ickshonpe Dec 7, 2025
d597657
Slightly improve the window settings example (#21862)
rmsthebest Dec 7, 2025
e44d659
Solari: Misc improvements (#21953)
JMS55 Dec 7, 2025
6c22c9b
Solari: Improve specular GI (#21907)
JMS55 Dec 7, 2025
61e7b9a
Increase the number of supported clustered decals if the `PARTIALLY_B…
pcwalton Dec 8, 2025
2403c41
Fix flaky asset test, adds todo for a real fix (#22061)
kfc35 Dec 8, 2025
9ad7df9
Update ron requirement from 0.11 to 0.12 (#22063)
dependabot[bot] Dec 8, 2025
2144c03
Prevent WebGL builds from crashing on startup when using FpsOverlayPl…
it-me-joda Dec 8, 2025
d6ae071
anchor layout example (#21225)
ChristopherBiscardi Dec 8, 2025
d13f607
Fix macOS panic when exiting from exclusive fullscreen (#22060)
natepiano Dec 8, 2025
d5dfab9
UI material z-offset override (#20279)
ickshonpe Dec 8, 2025
0d13444
clear animation evaluator stack (#21118)
robtfm Dec 8, 2025
0af6fc1
Implement world.trigger_event remote method (#21798)
Lancelotbronner Dec 8, 2025
d44b9f8
Adds UIDebug Overlay centered scene to examples/testbed/ui (#22052)
kfc35 Dec 8, 2025
d76c3aa
get_components_mut (#21780)
hymm Dec 8, 2025
41bf46d
:bug: Fixes PropagateStop and PropagateOver (#21622)
ekwoka Dec 8, 2025
80e17cc
Add optimized is_in_half_space_identity, contains_aabb_identity, and …
Saratii Dec 8, 2025
8ca07c4
Add flag to force MSAA writeback (#22066)
tychedelia Dec 8, 2025
fca4596
DespawnOnExit / DespawnOnEnter fix log spam (#21864)
Lyndon-Mackay Dec 9, 2025
8c6e490
Remove `bevy_ptr::dangling_with_align()` and inline it (#21822)
BD103 Dec 9, 2025
8a0367e
Add vertical slider support to bevy_ui_widgets slider (#21827)
DuckyBlender Dec 9, 2025
1a9fee0
Fix shader compilation fail when using visibility range (#21879)
newDINO Dec 9, 2025
ad48f39
Skip picking for UI nodes if there is no pointer (#22074)
ickshonpe Dec 9, 2025
6684682
remove empty_bind_group_layout (#22068)
ecoskey Dec 9, 2025
5ffc1d6
Fix undefined behavior in screenshots on WASM (#22077)
kristoff3r Dec 9, 2025
617828c
Simplify `ui_picking`'s camera search (#22075)
ickshonpe Dec 9, 2025
695d9d4
Implement `Clone` and `Copy` for bevy_ptr's `ConstNonNull` for parity…
panpanpro888 Dec 9, 2025
185712f
Add support for normal maps, metallic-roughness maps, and emissive ma…
pcwalton Dec 9, 2025
f860ee7
Solari: More accurate ReSTIR DI resampling (#22033)
JMS55 Dec 9, 2025
000ddca
Support non-sRGB image formats for `RenderTarget::Image` (#22031)
bonsairobo Dec 9, 2025
3d700c4
Make default state change trigger self state transitions (#21792)
janhohenheim Dec 9, 2025
953a1cd
Use insert_debug_marker instead of debug_group (#22079)
IceSentry Dec 9, 2025
00f6eb7
Implement the infrastructure needed to support portals and mirrors. (…
pcwalton Dec 9, 2025
fe6e04f
Use RayMap and RenderLayers in bevy_sprite/picking_backend (#21959)
bloopyboop Dec 9, 2025
863a27e
Change a function system to be exclusive (#21742)
hymm Dec 9, 2025
b7fc4d4
Fix immediate nested loaded assets not loading their dependencies. (#…
andriyDev Dec 9, 2025
2dbed92
Fix skybox example crashing in WASM by skipping unsupported TAA (#21887)
it-me-joda Dec 9, 2025
e269839
Avoid reading the entire asset into memory during asset processing. (…
andriyDev Dec 9, 2025
4618f0c
Add `MeshPipelineKey::LIGHTMAPPED` as applicable during the wireframe…
mgi388 Dec 9, 2025
d60a1b8
Add MeshTag to array_texture example to demonstrate layer selection i…
mgi388 Dec 9, 2025
98d4adb
Make the ui_surface module public. (#22056)
IQuick143 Dec 9, 2025
f664896
Fix scene viewer animation switching (#21871)
greeble-dev Dec 9, 2025
e610c53
Feathers: add override cursor (#21824)
rudderbucky Dec 9, 2025
0c815db
Upgrade to wgpu 27 and associated crates (#21746)
JMS55 Dec 10, 2025
a647a47
Add a new `almost_finish` method for `Timer` with immediate first `ti…
Rajveer100 Dec 10, 2025
3eb3f47
:bug: Fixes Warning regression in Propagate (#22084)
ekwoka Dec 10, 2025
176d5a3
Remove queue text (#22051)
ickshonpe Dec 10, 2025
f198bd6
increase morph targets to 256 (#21421)
robtfm Dec 10, 2025
e4bf6dc
fix gltf path texture usages (#22086)
robtfm Dec 11, 2025
bcdb844
More flexible SystemInput (#21917)
ecoskey Dec 11, 2025
c7b752a
Make Gizmos::rect_2d and primitive_2d draw the joint of the first cor…
uckelman Dec 11, 2025
2d4e140
UI per text section picking (#22047)
ickshonpe Dec 11, 2025
16409b8
Fix lints after Rust 1.92 (#22092)
kristoff3r Dec 12, 2025
9491405
Fix incorrect blake3 version bound (#22091)
kristoff3r Dec 12, 2025
53aea52
text2d change detection fix (#22098)
ickshonpe Dec 12, 2025
5eba4eb
Fix wrong termination for asset hash reads. (#22100)
andriyDev Dec 12, 2025
9c58976
Revert "Support non-sRGB image formats for `RenderTarget::Image`" (#2…
beicause Dec 12, 2025
f2592b0
make example clustered_decal_maps deterministic (#22109)
mockersf Dec 14, 2025
bd2a6dd
Bump tracy-client version (#22110)
Lampan-git Dec 14, 2025
c342e25
Add PresentMode fallbacks (#22108)
atlv24 Dec 14, 2025
d042f8d
Make it possible to statically construct gizmo buffers (#22105)
atlv24 Dec 14, 2025
e7b64b6
Add support for arbitrary/third party glTF Extension processing via G…
ChristopherBiscardi Dec 14, 2025
3ed80d3
Solari: Double buffer prepass textures (#22102)
JMS55 Dec 14, 2025
b58ecf2
Add sprite slicing scene to testbed_2d example (#22089)
snk-git-hub Dec 14, 2025
1e916e0
`spec_v2`: migrate line gizmos (#22072)
ecoskey Dec 14, 2025
160b3e5
Use mesh bounds center for transparent/transmissive sorting (#22041)
venhelhardt Dec 14, 2025
920e77b
Replace path canonicalize with our own version. (#22026)
andriyDev Dec 14, 2025
ae48687
Support MainPassResolutionOverride for Atmosphere (#22013)
jannik4 Dec 14, 2025
63af390
scrollbar helper functions (#21937)
ickshonpe Dec 14, 2025
67633b3
Convert RenderTarget to `Component` (#20917)
tychedelia Dec 14, 2025
e3ebf3a
Recompute AABBs (#18742)
aevyrie Dec 14, 2025
2e9ef69
Fix non-srgb `RenderTarget::Image` (#22090)
beicause Dec 14, 2025
5f7e43c
Retain asset without data for RENDER_WORLD-only assets (#21732)
robtfm Dec 14, 2025
be4f4e7
Fix shadow caster/receiver toggle not working (#22004)
momoluna444 Dec 14, 2025
fa12668
system combinators short circuiting with system failure (#20671)
janis-bhm Dec 14, 2025
6817516
Add FullscreenMaterial (#20414)
IceSentry Dec 14, 2025
ac7ee14
bug: Fix stackoverflow on asset reload. (#21619)
shanecelis Dec 14, 2025
18c2b56
`spec_v2`: migrate TAA (#22070)
ecoskey Dec 15, 2025
48efe26
UI scrollbars clipping fix (#21910)
ickshonpe Dec 15, 2025
4eed4d0
Easy screenrecording plugin (#21237)
mockersf Dec 15, 2025
9abb623
single query per node in UI picking backend (#22049)
ickshonpe Dec 15, 2025
c18838f
`ComputedNode` box model helper functions (#21903)
ickshonpe Dec 15, 2025
ec072d8
reflect rendertarget (#22113)
ChristopherBiscardi Dec 15, 2025
6ee5067
Make BRP builtins utilities `parse` and `parse_some` public (#22005)
Nilirad Dec 15, 2025
030657a
Doc trivial ecs unsafe (#22014)
hymm Dec 15, 2025
86224b5
Refactor GltfExtensionHandler Hooks (#22114)
ChristopherBiscardi Dec 15, 2025
82acdfd
derive `Clone` and `Copy` for newer `interaction_states` unit structs…
databasedav Dec 15, 2025
45955c7
Use slice `last` instead of iter `last. (#22116)
andriyDev Dec 15, 2025
2765ba8
Fix compilation errors and warnings when running bevy_gltf with no fe…
andriyDev Dec 15, 2025
545a97d
Fix: Clears directional navigation map between rebuilds (#22124)
kfc35 Dec 15, 2025
5971710
Global Gizmos (#22107)
atlv24 Dec 15, 2025
0303bd6
disable screenrecording on windows (#22130)
mockersf Dec 15, 2025
5ac16eb
Fix: Ignores nodes that are hidden via their parents in directional n…
kfc35 Dec 15, 2025
3ab5c2c
GltfExtensionHandler::on_texture: pass Texture references (#22131)
ChristopherBiscardi Dec 15, 2025
0558f32
InfallibleMesh
robtfm Nov 30, 2025
fe6bf7f
fix doctest
robtfm Nov 30, 2025
8c6e6bb
clean up From<Primitives> for Mesh
robtfm Nov 30, 2025
ab9a52a
remove Asset derive
robtfm Dec 7, 2025
7d6aae4
fix new example
robtfm Dec 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .github/actions/install-linux-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ inputs:
description: Install xkb (libxkbcommon-dev)
required: false
default: "false"
x264:
description: Install x264 (libx264-dev)
required: false
default: "false"
runs:
using: composite
steps:
Expand All @@ -47,3 +51,4 @@ runs:
${{ fromJSON(inputs.udev) && 'libudev-dev' || '' }}
${{ fromJSON(inputs.wayland) && 'libwayland-dev' || '' }}
${{ fromJSON(inputs.xkb) && 'libxkbcommon-dev' || '' }}
${{ fromJSON(inputs.x264) && 'libx264-164 libx264-dev' || '' }}
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ jobs:
with:
wayland: true
xkb: true
x264: true
- name: CI job
# See tools/ci/src/main.rs for the commands this runs
run: cargo run -p ci -- lints
Expand Down Expand Up @@ -304,7 +305,7 @@ jobs:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
- name: Run Markdown Lint
uses: super-linter/super-linter/slim@v8.2.1
uses: super-linter/super-linter/slim@v8.3.0
env:
MULTI_STATUS: false
VALIDATE_ALL_CODEBASE: false
Expand Down Expand Up @@ -336,7 +337,7 @@ jobs:
steps:
- uses: actions/checkout@v6
- name: Check for typos
uses: crate-ci/typos@v1.39.2
uses: crate-ci/typos@v1.40.0
- name: Typos info
if: failure()
run: |
Expand Down Expand Up @@ -371,6 +372,7 @@ jobs:
with:
wayland: true
xkb: true
x264: true
- name: Build and check doc
# See tools/ci/src/main.rs for the commands this runs
run: cargo run -p ci -- doc
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/example-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
example_name=`basename $example .ron`
echo -n $example_name > last_example_run
echo "running $example_name - "`date`
time TRACE_CHROME=trace-$example_name.json CI_TESTING_CONFIG=$example cargo run --example $example_name --features "bevy_ci_testing,trace,trace_chrome"
time TRACE_CHROME=trace-$example_name.json CI_TESTING_CONFIG=$example cargo run --example $example_name --features "bevy_ci_testing,trace,trace_chrome,bevy_ui_debug"
sleep 10
if [ `find ./ -maxdepth 1 -name 'screenshot-*.png' -print -quit` ]; then
mkdir screenshots-$example_name
Expand Down Expand Up @@ -123,7 +123,7 @@ jobs:
example_name=`basename $example .ron`
echo -n $example_name > last_example_run
echo "running $example_name - "`date`
time TRACE_CHROME=trace-$example_name.json CI_TESTING_CONFIG=$example xvfb-run cargo run --example $example_name --features "bevy_ci_testing,trace,trace_chrome"
time TRACE_CHROME=trace-$example_name.json CI_TESTING_CONFIG=$example xvfb-run cargo run --example $example_name --features "bevy_ci_testing,trace,trace_chrome,bevy_ui_debug"
sleep 10
if [ `find ./ -maxdepth 1 -name 'screenshot-*.png' -print -quit` ]; then
mkdir screenshots-$example_name
Expand Down Expand Up @@ -187,7 +187,7 @@ jobs:
example_name=`basename $example .ron`
echo -n $example_name > last_example_run
echo "running $example_name - "`date`
time WGPU_BACKEND=dx12 TRACE_CHROME=trace-$example_name.json CI_TESTING_CONFIG=$example cargo run --example $example_name --features "statically-linked-dxc,bevy_ci_testing,trace,trace_chrome"
time WGPU_BACKEND=dx12 TRACE_CHROME=trace-$example_name.json CI_TESTING_CONFIG=$example cargo run --example $example_name --features "statically-linked-dxc,bevy_ci_testing,trace,trace_chrome,bevy_ui_debug"
sleep 10
if [ `find ./ -maxdepth 1 -name 'screenshot-*.png' -print -quit` ]; then
mkdir screenshots-$example_name
Expand Down
96 changes: 88 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ keywords = ["game", "engine", "gamedev", "graphics", "bevy"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/bevyengine/bevy"
documentation = "https://docs.rs/bevy"
rust-version = "1.88.0"
rust-version = "1.89.0"

[workspace]
resolver = "2"
Expand Down Expand Up @@ -222,7 +222,7 @@ common_api = [
# COLLECTION: Features used to build 2D Bevy apps (does not include a render backend). You generally don't need to worry about this unless you are using a custom renderer.
2d_api = ["common_api", "bevy_sprite"]

# COLLECTION: Bevy's built-in 2D renderer, built on top of `bevy_render`
# COLLECTION: Bevy's built-in 2D renderer, built on top of `bevy_render`.
2d_bevy_render = [
"2d_api",
"bevy_render",
Expand All @@ -245,7 +245,7 @@ common_api = [
"zstd_rust",
]

# COLLECTION: Bevy's built-in 3D renderer, built on top of `bevy_render`
# COLLECTION: Bevy's built-in 3D renderer, built on top of `bevy_render`.
3d_bevy_render = [
"3d_api",
"bevy_render",
Expand All @@ -261,7 +261,7 @@ common_api = [
# COLLECTION: Features used to build UI Bevy apps (does not include a render backend). You generally don't need to worry about this unless you are using a custom renderer.
ui_api = ["default_app", "common_api", "bevy_ui"]

# COLLECTION: Bevy's built-in UI renderer, built on top of `bevy_render`
# COLLECTION: Bevy's built-in UI renderer, built on top of `bevy_render`.
ui_bevy_render = [
"ui_api",
"bevy_render",
Expand Down Expand Up @@ -708,7 +708,7 @@ bevy_dylib = { path = "crates/bevy_dylib", version = "0.18.0-dev", default-featu
[dev-dependencies]
rand = "0.9.0"
rand_chacha = "0.9.0"
ron = "0.11"
ron = "0.12"
flate2 = "1.0"
serde = { version = "1", features = ["derive"] }
serde_json = "1.0.140"
Expand All @@ -732,6 +732,7 @@ event-listener = "5.3.0"
anyhow = "1"
accesskit = "0.21"
nonmax = "0.5"
gltf = "1.4"

[target.'cfg(not(target_family = "wasm"))'.dev-dependencies]
ureq = { version = "3.0.8", features = ["json"] }
Expand Down Expand Up @@ -3112,6 +3113,17 @@ description = "Demonstrates how to write a specialized mesh pipeline"
category = "Shaders"
wasm = true

[[example]]
name = "fullscreen_material"
path = "examples/shader_advanced/fullscreen_material.rs"
doc-scrape-examples = true

[package.metadata.example.fullscreen_material]
name = "Fullscreen Material"
description = "Demonstrates how to write a fullscreen material"
category = "Shaders Advanced"
wasm = true

# Stress tests
[[package.metadata.example_category]]
name = "Stress Tests"
Expand Down Expand Up @@ -3414,6 +3426,17 @@ category = "Transforms"
wasm = true

# UI (User Interface)
[[example]]
name = "anchor_layout"
path = "examples/ui/anchor_layout.rs"
doc-scrape-examples = true

[package.metadata.example.anchor_layout]
name = "Anchor Layout"
description = "Shows an 'anchor layout' style of ui layout"
category = "UI (User Interface)"
wasm = true

[[example]]
name = "borders"
path = "examples/ui/borders.rs"
Expand Down Expand Up @@ -3480,6 +3503,18 @@ description = "Illustrates how to access `winit::window::Window`'s `hittest` fun
category = "UI (User Interface)"
wasm = false

[[example]]
name = "vertical_slider"
path = "examples/ui/vertical_slider.rs"
doc-scrape-examples = true
required-features = ["experimental_bevy_ui_widgets"]

[package.metadata.example.vertical_slider]
name = "Vertical Slider"
description = "Simple example showing vertical and horizontal slider widgets with snap behavior and value labels"
category = "UI (User Interface)"
wasm = true

[[example]]
name = "font_atlas_debug"
path = "examples/ui/font_atlas_debug.rs"
Expand Down Expand Up @@ -3968,6 +4003,9 @@ name = "fallback_image"
path = "examples/shader/fallback_image.rs"
doc-scrape-examples = true

[package.metadata.example.fallback_image]
hidden = true

[[example]]
name = "reflection_probes"
path = "examples/3d/reflection_probes.rs"
Expand All @@ -3979,9 +4017,6 @@ description = "Demonstrates reflection probes"
category = "3D Rendering"
wasm = false

[package.metadata.example.fallback_image]
hidden = true

[package.metadata.example.window_resizing]
name = "Window Resizing"
description = "Demonstrates resizing and responding to resizing a window"
Expand Down Expand Up @@ -4178,6 +4213,28 @@ description = "Loads and renders a glTF file as a scene, including the gltf extr
category = "glTF"
wasm = true

[[example]]
name = "gltf_extension_animation_graph"
path = "examples/gltf/gltf_extension_animation_graph.rs"
doc-scrape-examples = true

[package.metadata.example.gltf_extension_animation_graph]
name = "glTF extension AnimationGraph"
description = "Uses glTF data to build an AnimationGraph via extension processing"
category = "glTF"
wasm = true

[[example]]
name = "gltf_extension_mesh_2d"
path = "examples/gltf/gltf_extension_mesh_2d.rs"
doc-scrape-examples = true

[package.metadata.example.gltf_extension_mesh_2d]
name = "glTF extension processing to build Mesh2ds from glTF data"
description = "Uses glTF extension data to convert incoming Mesh3d/MeshMaterial3d assets to 2d"
category = "glTF"
wasm = true

[[example]]
name = "query_gltf_primitives"
path = "examples/gltf/query_gltf_primitives.rs"
Expand Down Expand Up @@ -4877,3 +4934,26 @@ name = "Pan Camera"
description = "Example Pan-Camera Styled Camera Controller for 2D scenes"
category = "Camera"
wasm = true

[[example]]
name = "clustered_decal_maps"
path = "examples/3d/clustered_decal_maps.rs"
doc-scrape-examples = true
required-features = ["pbr_clustered_decals", "https"]

[package.metadata.example.clustered_decal_maps]
name = "Clustered Decal Maps"
description = "Demonstrates normal and metallic-roughness maps of decals"
category = "3D Rendering"
wasm = false

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

[package.metadata.example.mirror]
name = "Mirror"
description = "Demonstrates how to create a mirror with a second camera"
category = "3D Rendering"
wasm = true
14 changes: 14 additions & 0 deletions assets/models/barycentric/barycentric.gltf
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
{
"scene": 0,
"scenes": [
{
"nodes": [
0
]
}
],
"nodes": [
{
"name": "box",
"mesh": 0
}
],
"accessors": [
{
"bufferView": 0,
Expand Down
5 changes: 4 additions & 1 deletion assets/shaders/array_texture.wgsl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#import bevy_pbr::{
forward_io::VertexOutput,
mesh_functions,
mesh_view_bindings::view,
pbr_types::{STANDARD_MATERIAL_FLAGS_DOUBLE_SIDED_BIT, PbrInput, pbr_input_new},
pbr_functions as fns,
Expand All @@ -15,7 +16,9 @@ fn fragment(
@builtin(front_facing) is_front: bool,
mesh: VertexOutput,
) -> @location(0) vec4<f32> {
let layer = i32(mesh.world_position.x) & 0x3;
// Determine which layer of the array texture to sample from based on the
// mesh tag which originates from the MeshTag component on the entity.
let layer = mesh_functions::get_tag(mesh.instance_index);

// Prepare a 'processed' StandardMaterial by sampling all textures to resolve
// the material members
Expand Down
8 changes: 2 additions & 6 deletions assets/shaders/custom_clustered_decal.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ fn fragment(
pbr_input.material.base_color = alpha_discard(pbr_input.material, pbr_input.material.base_color);

// Apply the normal decals.
pbr_input.material.base_color = clustered::apply_decal_base_color(
in.world_position.xyz,
in.position.xy,
pbr_input.material.base_color
);
clustered::apply_decals(&pbr_input);

// Here we tint the color based on the tag of the decal.
// We could optionally do other things, such as adjust the normal based on a normal map.
Expand All @@ -42,7 +38,7 @@ fn fragment(
);
while (clustered::clustered_decal_iterator_next(&decal_iterator)) {
var decal_base_color = textureSampleLevel(
mesh_view_bindings::clustered_decal_textures[decal_iterator.texture_index],
mesh_view_bindings::clustered_decal_textures[decal_iterator.base_color_texture_index],
mesh_view_bindings::clustered_decal_sampler,
decal_iterator.uv,
0.0
Expand Down
50 changes: 50 additions & 0 deletions assets/shaders/fullscreen_effect.wgsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// This shader computes the chromatic aberration effect

// Since post processing is a fullscreen effect, we use the fullscreen vertex shader provided by bevy.
// This will import a vertex shader that renders a single fullscreen triangle.
//
// A fullscreen triangle is a single triangle that covers the entire screen.
// The box in the top left in that diagram is the screen. The 4 x are the corner of the screen
//
// Y axis
// 1 | x-----x......
// 0 | | s | . ´
// -1 | x_____x´
// -2 | : .´
// -3 | :´
// +--------------- X axis
// -1 0 1 2 3
//
// As you can see, the triangle ends up bigger than the screen.
//
// You don't need to worry about this too much since bevy will compute the correct UVs for you.
#import bevy_core_pipeline::fullscreen_vertex_shader::FullscreenVertexOutput

@group(0) @binding(0) var screen_texture: texture_2d<f32>;
@group(0) @binding(1) var texture_sampler: sampler;

struct FullScreenEffect {
intensity: f32,
#ifdef SIXTEEN_BYTE_ALIGNMENT
// WebGL2 structs must be 16 byte aligned.
_webgl2_padding: vec3<f32>
#endif
}

@group(0) @binding(2) var<uniform> settings: FullScreenEffect;

@fragment
fn fragment(in: FullscreenVertexOutput) -> @location(0) vec4<f32> {
// Chromatic aberration strength
let offset_strength = settings.intensity;

// Sample each color channel with an arbitrary shift
return vec4<f32>(
textureSample(screen_texture, texture_sampler, in.uv + vec2<f32>(offset_strength, -offset_strength)).r,
textureSample(screen_texture, texture_sampler, in.uv + vec2<f32>(-offset_strength, 0.0)).g,
textureSample(screen_texture, texture_sampler, in.uv + vec2<f32>(0.0, offset_strength)).b,
1.0
);
}


Loading