diff --git a/pipelined/bevy_pbr2/src/light.rs b/pipelined/bevy_pbr2/src/light.rs index 65063363a10e7..44f2c2b6f7bb2 100644 --- a/pipelined/bevy_pbr2/src/light.rs +++ b/pipelined/bevy_pbr2/src/light.rs @@ -64,6 +64,8 @@ pub struct DirectionalLight { pub illuminance: f32, pub shadow_projection: OrthographicProjection, pub shadow_depth_bias: f32, + /// A bias applied along the direction of the fragment's surface normal. It is scaled to the + /// shadow map's texel size so that it is automatically adjusted to the orthographic projection. pub shadow_normal_bias: f32, } @@ -90,7 +92,7 @@ impl Default for DirectionalLight { impl DirectionalLight { pub const DEFAULT_SHADOW_DEPTH_BIAS: f32 = 0.02; - pub const DEFAULT_SHADOW_NORMAL_BIAS: f32 = 0.5; + pub const DEFAULT_SHADOW_NORMAL_BIAS: f32 = 0.6; } // Ambient light color. diff --git a/pipelined/bevy_render2/src/render_graph/graph.rs b/pipelined/bevy_render2/src/render_graph/graph.rs index daf5d37be9ff8..23d6c40932d4a 100644 --- a/pipelined/bevy_render2/src/render_graph/graph.rs +++ b/pipelined/bevy_render2/src/render_graph/graph.rs @@ -261,6 +261,18 @@ impl RenderGraph { self.nodes.values_mut() } + pub fn iter_sub_graphs(&self) -> impl Iterator { + self.sub_graphs + .iter() + .map(|(name, graph)| (name.as_ref(), graph)) + } + + pub fn iter_sub_graphs_mut(&mut self) -> impl Iterator { + self.sub_graphs + .iter_mut() + .map(|(name, graph)| (name.as_ref(), graph)) + } + pub fn iter_node_inputs( &self, label: impl Into, diff --git a/pipelined/bevy_render2/src/texture/image.rs b/pipelined/bevy_render2/src/texture/image.rs index d0294ab265746..196185ddfa53f 100644 --- a/pipelined/bevy_render2/src/texture/image.rs +++ b/pipelined/bevy_render2/src/texture/image.rs @@ -375,7 +375,11 @@ impl RenderAsset for Image { ) .unwrap(), ), - rows_per_image: None, + rows_per_image: if image.texture_descriptor.size.depth_or_array_layers > 1 { + std::num::NonZeroU32::new(image.texture_descriptor.size.height) + } else { + None + }, }, image.texture_descriptor.size, );