Add sprite sorting and transparency

This commit is contained in:
Hilmar Wiegand
2019-06-25 15:22:29 +02:00
parent 988a8f9b57
commit 1e682ede22
2 changed files with 12 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
use amethyst::{
ecs::prelude::{ReadExpect, Resources, SystemData},
renderer::{
pass::DrawFlat2DDesc,
pass::DrawFlat2DTransparentDesc,
rendy::{
factory::Factory,
graph::{
@@ -75,7 +75,8 @@ impl GraphCreator<DefaultBackend> for RenderGraph {
// Add additional draw groups here for things like UI
let pass = builder.add_node(
SubpassBuilder::new()
.with_group(DrawFlat2DDesc::new().builder()) // Draw sprites
// Draw sprites with transparency
.with_group(DrawFlat2DTransparentDesc::new().builder())
.with_color(color)
.with_depth_stencil(depth)
.into_pass(),