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
This commit is contained in:
		
							parent
							
								
									32c14d8c6b
								
							
						
					
					
						commit
						eb15f81e17
					
				| @ -1,7 +1,7 @@ | |||||||
| use bevy::{ | use bevy::{ | ||||||
|     ecs::prelude::*, |     ecs::prelude::*, | ||||||
|     math::{Quat, Vec2, Vec3}, |     math::{Quat, Vec2, Vec3}, | ||||||
|     pbr2::{PbrBundle, StandardMaterial}, |     pbr2::{AlphaMode, PbrBundle, StandardMaterial}, | ||||||
|     prelude::{App, AssetServer, Assets, Transform}, |     prelude::{App, AssetServer, Assets, Transform}, | ||||||
|     render2::{ |     render2::{ | ||||||
|         camera::PerspectiveCameraBundle, |         camera::PerspectiveCameraBundle, | ||||||
| @ -41,6 +41,7 @@ fn setup( | |||||||
|     let material_handle = materials.add(StandardMaterial { |     let material_handle = materials.add(StandardMaterial { | ||||||
|         base_color_texture: Some(texture_handle.clone()), |         base_color_texture: Some(texture_handle.clone()), | ||||||
|         unlit: true, |         unlit: true, | ||||||
|  |         alpha_mode: AlphaMode::Blend, | ||||||
|         ..Default::default() |         ..Default::default() | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
| @ -49,6 +50,7 @@ fn setup( | |||||||
|         base_color: Color::rgba(1.0, 0.0, 0.0, 0.5), |         base_color: Color::rgba(1.0, 0.0, 0.0, 0.5), | ||||||
|         base_color_texture: Some(texture_handle.clone()), |         base_color_texture: Some(texture_handle.clone()), | ||||||
|         unlit: true, |         unlit: true, | ||||||
|  |         alpha_mode: AlphaMode::Blend, | ||||||
|         ..Default::default() |         ..Default::default() | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
| @ -57,6 +59,7 @@ fn setup( | |||||||
|         base_color: Color::rgba(0.0, 0.0, 1.0, 0.5), |         base_color: Color::rgba(0.0, 0.0, 1.0, 0.5), | ||||||
|         base_color_texture: Some(texture_handle), |         base_color_texture: Some(texture_handle), | ||||||
|         unlit: true, |         unlit: true, | ||||||
|  |         alpha_mode: AlphaMode::Blend, | ||||||
|         ..Default::default() |         ..Default::default() | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 François
						François