Skip to content

Commit eb15f81

Browse files
committed
enable alpha mode for textures materials that are transparent (#3202)
# Objective - Transparent materials used in 3d are not transparent by default ## Solution - Enable transparency in example
1 parent 32c14d8 commit eb15f81

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

examples/3d/texture_pipelined.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use bevy::{
22
ecs::prelude::*,
33
math::{Quat, Vec2, Vec3},
4-
pbr2::{PbrBundle, StandardMaterial},
4+
pbr2::{AlphaMode, PbrBundle, StandardMaterial},
55
prelude::{App, AssetServer, Assets, Transform},
66
render2::{
77
camera::PerspectiveCameraBundle,
@@ -41,6 +41,7 @@ fn setup(
4141
let material_handle = materials.add(StandardMaterial {
4242
base_color_texture: Some(texture_handle.clone()),
4343
unlit: true,
44+
alpha_mode: AlphaMode::Blend,
4445
..Default::default()
4546
});
4647

@@ -49,6 +50,7 @@ fn setup(
4950
base_color: Color::rgba(1.0, 0.0, 0.0, 0.5),
5051
base_color_texture: Some(texture_handle.clone()),
5152
unlit: true,
53+
alpha_mode: AlphaMode::Blend,
5254
..Default::default()
5355
});
5456

@@ -57,6 +59,7 @@ fn setup(
5759
base_color: Color::rgba(0.0, 0.0, 1.0, 0.5),
5860
base_color_texture: Some(texture_handle),
5961
unlit: true,
62+
alpha_mode: AlphaMode::Blend,
6063
..Default::default()
6164
});
6265

0 commit comments

Comments
 (0)