Skip to content

Instantly share code, notes, and snippets.

@pcwalton
Created May 4, 2024 20:18
Show Gist options
  • Save pcwalton/c8dc719469d7aef8e2d4edb8b319c848 to your computer and use it in GitHub Desktop.
Save pcwalton/c8dc719469d7aef8e2d4edb8b319c848 to your computer and use it in GitHub Desktop.
diff --git a/examples/tools/scene_viewer/scene_viewer_plugin.rs b/examples/tools/scene_viewer/scene_viewer_plugin.rs
index 2ff6af494..52597c1bb 100644
--- a/examples/tools/scene_viewer/scene_viewer_plugin.rs
+++ b/examples/tools/scene_viewer/scene_viewer_plugin.rs
@@ -72,6 +72,7 @@ impl Plugin for SceneViewerPlugin {
Update,
(
update_lights,
+ update_materials,
camera_tracker,
toggle_bounding_boxes.run_if(input_just_pressed(KeyCode::KeyB)),
),
@@ -167,6 +168,14 @@ fn update_lights(
}
}
+fn update_materials(mut materials: ResMut<Assets<StandardMaterial>>) {
+ for material in materials.iter_mut() {
+ if material.1.alpha_mode != AlphaMode::Opaque {
+ material.1.alpha_mode = AlphaMode::AlphaToCoverage;
+ }
+ }
+}
+
#[derive(Resource, Default)]
struct CameraTracker {
active_index: Option<usize>,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment