Skip to content

Commit

Permalink
enable alpha mode for textures materials that are transparent (#3202)
Browse files Browse the repository at this point in the history
# Objective

- Transparent materials used in 3d are not transparent by default

## Solution

- Enable transparency in example
  • Loading branch information
mockersf committed Nov 29, 2021
1 parent 32c14d8 commit eb15f81
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion examples/3d/texture_pipelined.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use bevy::{
ecs::prelude::*,
math::{Quat, Vec2, Vec3},
pbr2::{PbrBundle, StandardMaterial},
pbr2::{AlphaMode, PbrBundle, StandardMaterial},
prelude::{App, AssetServer, Assets, Transform},
render2::{
camera::PerspectiveCameraBundle,
Expand Down Expand Up @@ -41,6 +41,7 @@ fn setup(
let material_handle = materials.add(StandardMaterial {
base_color_texture: Some(texture_handle.clone()),
unlit: true,
alpha_mode: AlphaMode::Blend,
..Default::default()
});

Expand All @@ -49,6 +50,7 @@ fn setup(
base_color: Color::rgba(1.0, 0.0, 0.0, 0.5),
base_color_texture: Some(texture_handle.clone()),
unlit: true,
alpha_mode: AlphaMode::Blend,
..Default::default()
});

Expand All @@ -57,6 +59,7 @@ fn setup(
base_color: Color::rgba(0.0, 0.0, 1.0, 0.5),
base_color_texture: Some(texture_handle),
unlit: true,
alpha_mode: AlphaMode::Blend,
..Default::default()
});

Expand Down

0 comments on commit eb15f81

Please sign in to comment.