Skip to content

Commit

Permalink
Merge branch 'pipelined-rendering' into scale-normal-bias-by-texel-size
Browse files Browse the repository at this point in the history
  • Loading branch information
superdump committed Jul 17, 2021
2 parents b934f7b + 3560715 commit c5a7e76
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pipelined/bevy_pbr2/src/light.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand All @@ -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.
Expand Down
12 changes: 12 additions & 0 deletions pipelined/bevy_render2/src/render_graph/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,18 @@ impl RenderGraph {
self.nodes.values_mut()
}

pub fn iter_sub_graphs(&self) -> impl Iterator<Item = (&str, &RenderGraph)> {
self.sub_graphs
.iter()
.map(|(name, graph)| (name.as_ref(), graph))
}

pub fn iter_sub_graphs_mut(&mut self) -> impl Iterator<Item = (&str, &mut RenderGraph)> {
self.sub_graphs
.iter_mut()
.map(|(name, graph)| (name.as_ref(), graph))
}

pub fn iter_node_inputs(
&self,
label: impl Into<NodeLabel>,
Expand Down
6 changes: 5 additions & 1 deletion pipelined/bevy_render2/src/texture/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);
Expand Down

0 comments on commit c5a7e76

Please sign in to comment.