diff --git a/examples/3d/wireframe.rs b/examples/3d/wireframe.rs
index 74376ab0b..9482692e4 100644
--- a/examples/3d/wireframe.rs
+++ b/examples/3d/wireframe.rs
@@ -45,7 +45,7 @@ fn main() {
..default()
})
.add_systems(Startup, setup)
- .add_systems(Update, update_colors)
+ .add_systems(Update, (update_colors, toggle_msaa))
.run();
}
@@ -113,6 +113,7 @@ fn setup(
// camera
commands.spawn((
Camera3d::default(),
+ Msaa::Sample4,
Transform::from_xyz(-2.0, 2.5, 5.0).looking_at(Vec3::ZERO, Vec3::Y),
));
@@ -150,6 +151,7 @@ X - Change global color
C - Change color of the green cube wireframe
V - Line width (current: {current_width:.1}px)
B - Toggle topology (current: {:?})
+ Space - Toggle Msaa
WireframeConfig
-------------
@@ -201,3 +203,15 @@ Color: {:?}",
};
}
}
+
+fn toggle_msaa(
+ keyboard_input: Res<ButtonInput<KeyCode>>,
+ mut camera_msaa: Single<&mut Msaa, With<Camera3d>>,
+) {
+ if keyboard_input.just_pressed(KeyCode::Space) {
+ **camera_msaa = match **camera_msaa {
+ Msaa::Off => Msaa::Sample4,
+ _ => Msaa::Off,
+ };
+ }
+}
Bevy version and features
What you did
WireframePluginCamera3dwithMsaa:Sample4Msaa::OffRepro diff
applies to
860f0c93e804833f557fe9e91ed7eeeb4668a0faWhat went wrong
After pressing space (msaa:off)
Error log
Expected: