VB
Size: a a a
VB
G
MT
V
#version 450
layout(set = 1, binding = 0) uniform sampler2D albedo;
layout(location = 0) in VertexData {
vec2 uv;
float seconds_since_spawn;
} vertex;
layout(location = 0) out vec4 out_color;
const float partcile_ttl = 0.1;
const vec3 particle_color = vec3(1.0, 0.0, 0.0);
void main() {
out_color = vec4(particle_color, 0.0);
}
V
let pipes = PipelinesBuilder::new()
.with_pipeline(
PipelineDescBuilder::new()
.with_vertex_desc(&[(
SpellParticleVertexData::vertex(),
pso::VertexInputRate::Instance(1),
)])
.with_input_assembler(pso::InputAssemblerDesc::new(hal::Primitive::TriangleStrip))
.with_shaders(util::simple_shader_set(
&shader_vertex,
Some(&shader_fragment),
))
.with_layout(&pipeline_layout)
.with_subpass(subpass)
.with_framebuffer_size(framebuffer_width, framebuffer_height)
.with_blend_targets(vec![pso::ColorBlendDesc {
mask: pso::ColorMask::ALL,
blend: Some(pso::BlendState::PREMULTIPLIED_ALPHA),
}])
.with_depth_test(pso::DepthTest {
fun: pso::Comparison::Less,
write: false,
}),
)
.build(factory, None);
V
pso::BlendState::ALPHA
, и вроде бы стало окV
R
AL
LC
IB
LC
ШН
IB
LC
AL
o
ШН
AL