Skip to content

Commit

Permalink
Fix non-visible motion vector text in shader prepass example (#9155)
Browse files Browse the repository at this point in the history
# Objective

In the shader prepass example, changing to the motion vector output
hides the text, because both it and the background are rendererd black.
Seems to have been caused by this commit?
71cf35c

## Solution

Make the text white on all outputs.
  • Loading branch information
ShadowMitia authored Aug 10, 2023
1 parent e87d3cc commit b8695d0
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions examples/shader/shader_prepass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,16 +242,10 @@ fn toggle_prepass_view(
3 => "motion vectors",
_ => unreachable!(),
};
let text_color = if *prepass_view == 3 {
Color::BLACK
} else {
Color::WHITE
};

let mut text = text.single_mut();
text.sections[0].value = format!("Prepass Output: {label}\n");
for section in &mut text.sections {
section.style.color = text_color;
section.style.color = Color::WHITE;
}

let handle = material_handle.single();
Expand Down

0 comments on commit b8695d0

Please sign in to comment.