From cfff5e65340cf3a5c124ebe7492f04508307f5ee Mon Sep 17 00:00:00 2001 From: IceSentry Date: Wed, 4 May 2022 12:21:58 -0400 Subject: [PATCH 1/2] set alpha_mode based on alpha value --- crates/bevy_pbr/src/pbr_material.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/bevy_pbr/src/pbr_material.rs b/crates/bevy_pbr/src/pbr_material.rs index 65362c5b14d13..06cb95411c2b1 100644 --- a/crates/bevy_pbr/src/pbr_material.rs +++ b/crates/bevy_pbr/src/pbr_material.rs @@ -100,6 +100,11 @@ impl From for StandardMaterial { fn from(color: Color) -> Self { StandardMaterial { base_color: color, + alpha_mode: if color.a() != 1.0 { + AlphaMode::Blend + } else { + AlphaMode::Opaque + }, ..Default::default() } } From dc7e1b07b604ecc688b0df24de0c3d48719cdc1e Mon Sep 17 00:00:00 2001 From: Charles Date: Wed, 4 May 2022 17:38:19 -0400 Subject: [PATCH 2/2] Update crates/bevy_pbr/src/pbr_material.rs Co-authored-by: Robert Swain --- crates/bevy_pbr/src/pbr_material.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_pbr/src/pbr_material.rs b/crates/bevy_pbr/src/pbr_material.rs index 06cb95411c2b1..54a74a517d7c1 100644 --- a/crates/bevy_pbr/src/pbr_material.rs +++ b/crates/bevy_pbr/src/pbr_material.rs @@ -100,7 +100,7 @@ impl From for StandardMaterial { fn from(color: Color) -> Self { StandardMaterial { base_color: color, - alpha_mode: if color.a() != 1.0 { + alpha_mode: if color.a() < 1.0 { AlphaMode::Blend } else { AlphaMode::Opaque