This commit is contained in:
1 parent
2fa64106c8
commit
2054fa2558
21 files changed
+711
-159
No files matched your search
@@ -37,7 +37,7 @@ pub fn resolve_viewport_camera_owner(
|
||||
}
|
||||
}
|
||||
|
||||
/// True when any point or spot light in the world casts shadows (forces Forward GI).
|
||||
/// True when any point or spot light in the world casts shadows.
|
||||
pub fn has_local_shadow_lights(points: &Query<&PointLight>, spots: &Query<&SpotLight>) -> bool {
|
||||
points.iter().any(|l| l.shadows_enabled) || spots.iter().any(|l| l.shadows_enabled)
|
||||
}
|
||||
@@ -57,7 +57,7 @@ pub fn world_has_local_shadow_lights(world: &mut World) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
/// Effective GI path for the main viewport, including auto-forward for local shadow lights.
|
||||
/// Effective GI path for the main viewport.
|
||||
pub fn effective_viewport_gi_path(
|
||||
requested: GiPath,
|
||||
caps: &RenderingCapabilities,
|
||||
@@ -134,6 +134,7 @@ pub fn sync_viewport_camera_stack(
|
||||
|
||||
match mode {
|
||||
ViewportStackApply::Full => {
|
||||
strip_project_camera_fx(commands, entity);
|
||||
commands.entity(entity).insert(ProjectRenderCamera);
|
||||
apply_camera_render_profile(
|
||||
commands,
|
||||
@@ -208,7 +209,7 @@ mod tests {
|
||||
use settings::RenderingCapabilities;
|
||||
|
||||
#[test]
|
||||
fn effective_viewport_gi_forces_forward_when_local_shadow_lights_exist() {
|
||||
fn effective_viewport_gi_keeps_solari_when_local_shadow_lights_exist() {
|
||||
let caps = RenderingCapabilities {
|
||||
rt_supported: true,
|
||||
..Default::default()
|
||||
@@ -221,7 +222,7 @@ mod tests {
|
||||
});
|
||||
assert_eq!(
|
||||
effective_viewport_gi_path(GiPath::SolariDeferred, &caps, stats.as_ref(), true),
|
||||
GiPath::Forward
|
||||
GiPath::SolariDeferred
|
||||
);
|
||||
assert_eq!(
|
||||
effective_viewport_gi_path(GiPath::SolariDeferred, &caps, stats.as_ref(), false),
|
||||
|
||||
Reference in new issue
Block a user