mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
add alpha to ui pipeline
This commit is contained in:
parent
5d9bb88d1b
commit
a798cf3346
2 changed files with 22 additions and 3 deletions
|
@ -175,4 +175,15 @@ fn setup(world: &mut World) {
|
|||
Parent(parent),
|
||||
)],
|
||||
);
|
||||
|
||||
// alpha test
|
||||
world.insert(
|
||||
(),
|
||||
vec![(Node::new(
|
||||
math::vec2(200.0, 200.0),
|
||||
Anchors::new(0.5, 0.5, 0.5, 0.5),
|
||||
Margins::new(0.0, 100.0, 0.0, 100.0),
|
||||
math::vec4(1.0, 0.7, 0.7, 0.2),
|
||||
),)],
|
||||
);
|
||||
}
|
||||
|
|
|
@ -196,9 +196,17 @@ impl Pipeline for UiPipeline {
|
|||
}),
|
||||
primitive_topology: wgpu::PrimitiveTopology::TriangleList,
|
||||
color_states: &[wgpu::ColorStateDescriptor {
|
||||
format: render_graph.swap_chain_descriptor.format,
|
||||
color_blend: wgpu::BlendDescriptor::REPLACE,
|
||||
alpha_blend: wgpu::BlendDescriptor::REPLACE,
|
||||
format: wgpu::TextureFormat::Bgra8UnormSrgb,
|
||||
color_blend: wgpu::BlendDescriptor {
|
||||
src_factor: wgpu::BlendFactor::SrcAlpha,
|
||||
dst_factor: wgpu::BlendFactor::OneMinusSrcAlpha,
|
||||
operation: wgpu::BlendOperation::Add,
|
||||
},
|
||||
alpha_blend: wgpu::BlendDescriptor {
|
||||
src_factor: wgpu::BlendFactor::One,
|
||||
dst_factor: wgpu::BlendFactor::OneMinusSrcAlpha,
|
||||
operation: wgpu::BlendOperation::Add,
|
||||
},
|
||||
write_mask: wgpu::ColorWrite::ALL,
|
||||
}],
|
||||
depth_stencil_state: Some(wgpu::DepthStencilStateDescriptor {
|
||||
|
|
Loading…
Reference in a new issue