Fix comments and rename to opaque subpass (#3)
Rename default to opaque pass and add transparent as a separate subpass so the sprites will render
This commit is contained in:
committed by
Hilmar Wiegand
parent
1e682ede22
commit
daeb3543b0
@@ -1,7 +1,7 @@
|
|||||||
use amethyst::{
|
use amethyst::{
|
||||||
ecs::prelude::{ReadExpect, Resources, SystemData},
|
ecs::prelude::{ReadExpect, Resources, SystemData},
|
||||||
renderer::{
|
renderer::{
|
||||||
pass::DrawFlat2DTransparentDesc,
|
pass::{DrawFlat2DDesc, DrawFlat2DTransparentDesc},
|
||||||
rendy::{
|
rendy::{
|
||||||
factory::Factory,
|
factory::Factory,
|
||||||
graph::{
|
graph::{
|
||||||
@@ -73,7 +73,16 @@ impl GraphCreator<DefaultBackend> for RenderGraph {
|
|||||||
let depth = builder.create_image(window_kind, 1, Format::D32Sfloat, Some(clear_depth));
|
let depth = builder.create_image(window_kind, 1, Format::D32Sfloat, Some(clear_depth));
|
||||||
|
|
||||||
// Add additional draw groups here for things like UI
|
// Add additional draw groups here for things like UI
|
||||||
let pass = builder.add_node(
|
let opaque = builder.add_node(
|
||||||
|
SubpassBuilder::new()
|
||||||
|
// Draw sprites with flat subpass
|
||||||
|
.with_group(DrawFlat2DDesc::new().builder())
|
||||||
|
.with_color(color)
|
||||||
|
.with_depth_stencil(depth)
|
||||||
|
.into_pass(),
|
||||||
|
);
|
||||||
|
|
||||||
|
let transparent = builder.add_node(
|
||||||
SubpassBuilder::new()
|
SubpassBuilder::new()
|
||||||
// Draw sprites with transparency
|
// Draw sprites with transparency
|
||||||
.with_group(DrawFlat2DTransparentDesc::new().builder())
|
.with_group(DrawFlat2DTransparentDesc::new().builder())
|
||||||
@@ -83,8 +92,11 @@ impl GraphCreator<DefaultBackend> for RenderGraph {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Render the result to the surface
|
// Render the result to the surface
|
||||||
let present = PresentNode::builder(factory, surface, color).with_dependency(pass);
|
let _present = builder.add_node(
|
||||||
builder.add_node(present);
|
PresentNode::builder(factory, surface, color)
|
||||||
|
.with_dependency(opaque)
|
||||||
|
.with_dependency(transparent),
|
||||||
|
);
|
||||||
|
|
||||||
builder
|
builder
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user