add alpha to ui pipeline
This commit is contained in:
parent
5d9bb88d1b
commit
a798cf3346
@ -175,4 +175,15 @@ fn setup(world: &mut World) {
|
|||||||
Parent(parent),
|
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,
|
primitive_topology: wgpu::PrimitiveTopology::TriangleList,
|
||||||
color_states: &[wgpu::ColorStateDescriptor {
|
color_states: &[wgpu::ColorStateDescriptor {
|
||||||
format: render_graph.swap_chain_descriptor.format,
|
format: wgpu::TextureFormat::Bgra8UnormSrgb,
|
||||||
color_blend: wgpu::BlendDescriptor::REPLACE,
|
color_blend: wgpu::BlendDescriptor {
|
||||||
alpha_blend: wgpu::BlendDescriptor::REPLACE,
|
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,
|
write_mask: wgpu::ColorWrite::ALL,
|
||||||
}],
|
}],
|
||||||
depth_stencil_state: Some(wgpu::DepthStencilStateDescriptor {
|
depth_stencil_state: Some(wgpu::DepthStencilStateDescriptor {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user