File tree 6 files changed +18
-908
lines changed 6 files changed +18
-908
lines changed Original file line number Diff line number Diff line change @@ -81,10 +81,10 @@ impl Node for MainPass3dNode {
81
81
} ] ,
82
82
depth_stencil_attachment : Some ( RenderPassDepthStencilAttachment {
83
83
view : & depth. view ,
84
- // NOTE: The opaque pass loads the depth prepass and does not store
84
+ // NOTE: The opaque main pass clears and writes to the depth buffer.
85
85
depth_ops : Some ( Operations {
86
- load : LoadOp :: Load ,
87
- store : false ,
86
+ load : LoadOp :: Clear ( 0.0 ) ,
87
+ store : true ,
88
88
} ) ,
89
89
stencil_ops : None ,
90
90
} ) ,
@@ -127,10 +127,10 @@ impl Node for MainPass3dNode {
127
127
} ] ,
128
128
depth_stencil_attachment : Some ( RenderPassDepthStencilAttachment {
129
129
view : & depth. view ,
130
- // NOTE: The alpha mask pass loads the depth prepass and does not store
130
+ // NOTE: The alpha mask pass loads the depth buffer and possibly overwrites it
131
131
depth_ops : Some ( Operations {
132
132
load : LoadOp :: Load ,
133
- store : false ,
133
+ store : true ,
134
134
} ) ,
135
135
stencil_ops : None ,
136
136
} ) ,
Original file line number Diff line number Diff line change @@ -27,13 +27,10 @@ use bevy_transform::TransformSystem;
27
27
28
28
pub mod draw_3d_graph {
29
29
pub mod node {
30
- pub const DEPTH_PREPASS : & str = "depth_prepass" ;
31
30
pub const SHADOW_PASS : & str = "shadow_pass" ;
32
31
}
33
32
}
34
33
35
- pub const DEPTH_PREPASS_SHADER_HANDLE : HandleUntyped =
36
- HandleUntyped :: weak_from_u64 ( Shader :: TYPE_UUID , 18081189618302456913 ) ;
37
34
pub const PBR_SHADER_HANDLE : HandleUntyped =
38
35
HandleUntyped :: weak_from_u64 ( Shader :: TYPE_UUID , 4805239651767701046 ) ;
39
36
pub const SHADOW_SHADER_HANDLE : HandleUntyped =
@@ -45,8 +42,6 @@ pub struct PbrPlugin;
45
42
impl Plugin for PbrPlugin {
46
43
fn build ( & self , app : & mut App ) {
47
44
let mut shaders = app. world . get_resource_mut :: < Assets < Shader > > ( ) . unwrap ( ) ;
48
- let depth_prepass_shader = Shader :: from_wgsl ( include_str ! ( "render/depth_prepass.wgsl" ) ) ;
49
- shaders. set_untracked ( DEPTH_PREPASS_SHADER_HANDLE , depth_prepass_shader) ;
50
45
let pbr_shader = Shader :: from_wgsl ( include_str ! ( "render/pbr.wgsl" ) ) ;
51
46
shaders. set_untracked ( PBR_SHADER_HANDLE , pbr_shader) ;
52
47
let shadow_shader = Shader :: from_wgsl ( include_str ! ( "render/depth.wgsl" ) ) ;
@@ -146,6 +141,5 @@ impl Plugin for PbrPlugin {
146
141
)
147
142
. unwrap ( ) ;
148
143
}
149
- app. add_plugin ( DepthPrepassPlugin ) ;
150
144
}
151
145
}
You can’t perform that action at this time.
0 commit comments