Upgrade to Bevy 0.19 and harden editor workflows
CI / Format, lint, test, build (push) Has been cancelled
CI / Format, lint, test, build (push) Has been cancelled
This commit is contained in:
1 parent
3f85d25cc7
commit
b5e561904c
204 files changed
+6972
-29907
No files matched your search
@@ -6,13 +6,13 @@ use super::camera_fx::{
|
||||
};
|
||||
use super::solari::SolariRaytracingSceneStats;
|
||||
use bevy::anti_alias::taa::TemporalAntiAliasing;
|
||||
use bevy::camera::Exposure;
|
||||
use bevy::camera::{Exposure, Hdr};
|
||||
use bevy::core_pipeline::tonemapping::Tonemapping;
|
||||
use bevy::pbr::{Atmosphere, ScatteringMedium, ScreenSpaceAmbientOcclusion};
|
||||
use bevy::light::atmosphere::ScatteringMedium;
|
||||
use bevy::pbr::{AtmosphereSettings, ScreenSpaceAmbientOcclusion};
|
||||
use bevy::post_process::auto_exposure::AutoExposure;
|
||||
use bevy::post_process::bloom::Bloom;
|
||||
use bevy::prelude::*;
|
||||
use bevy::render::view::Hdr;
|
||||
use settings::{
|
||||
resolve_effective_render_stack, write_effective_render_stack, ActiveCameraRenderProfile,
|
||||
EffectiveRenderStack, GiPath, ProjectRenderCamera, RenderingCapabilities,
|
||||
@@ -39,18 +39,18 @@ pub fn resolve_viewport_camera_owner(
|
||||
|
||||
/// 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)
|
||||
points.iter().any(|l| l.shadow_maps_enabled) || spots.iter().any(|l| l.shadow_maps_enabled)
|
||||
}
|
||||
|
||||
/// [`has_local_shadow_lights`] for exclusive [`World`] access (hot reload, diagnostics).
|
||||
pub fn world_has_local_shadow_lights(world: &mut World) -> bool {
|
||||
for pl in world.query::<&PointLight>().iter(world) {
|
||||
if pl.shadows_enabled {
|
||||
if pl.shadow_maps_enabled {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
for sl in world.query::<&SpotLight>().iter(world) {
|
||||
if sl.shadows_enabled {
|
||||
if sl.shadow_maps_enabled {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -92,7 +92,7 @@ pub fn clear_viewport_camera_stack(commands: &mut Commands, entity: Entity) {
|
||||
#[derive(Debug, Clone, Copy, Default)]
|
||||
pub struct ViewportFxSnapshot {
|
||||
pub has_stack: bool,
|
||||
pub has_atmosphere: bool,
|
||||
pub has_atmosphere_settings: bool,
|
||||
pub has_tonemapping: bool,
|
||||
pub has_bloom: bool,
|
||||
pub has_ssao: bool,
|
||||
@@ -156,7 +156,7 @@ pub fn sync_viewport_camera_stack(
|
||||
caps,
|
||||
solari_stats,
|
||||
mediums,
|
||||
snap.has_atmosphere,
|
||||
snap.has_atmosphere_settings,
|
||||
snap.has_tonemapping,
|
||||
snap.has_bloom,
|
||||
snap.has_ssao,
|
||||
@@ -203,6 +203,19 @@ pub fn sync_viewport_camera_stack(
|
||||
}
|
||||
|
||||
/// Builds a [`ViewportFxSnapshot`] from an entity's current components.
|
||||
pub fn snapshot_viewport_fx(entity: Entity, world: &World) -> ViewportFxSnapshot {
|
||||
ViewportFxSnapshot {
|
||||
has_stack: world.get::<ProjectRenderCamera>(entity).is_some(),
|
||||
has_atmosphere_settings: world.get::<AtmosphereSettings>(entity).is_some(),
|
||||
has_tonemapping: world.get::<Tonemapping>(entity).is_some(),
|
||||
has_bloom: world.get::<Bloom>(entity).is_some(),
|
||||
has_ssao: world.get::<ScreenSpaceAmbientOcclusion>(entity).is_some(),
|
||||
has_taa: world.get::<TemporalAntiAliasing>(entity).is_some(),
|
||||
has_hdr: world.get::<Hdr>(entity).is_some(),
|
||||
has_auto_exposure: world.get::<AutoExposure>(entity).is_some(),
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
@@ -230,16 +243,3 @@ mod tests {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn snapshot_viewport_fx(entity: Entity, world: &World) -> ViewportFxSnapshot {
|
||||
ViewportFxSnapshot {
|
||||
has_stack: world.get::<ProjectRenderCamera>(entity).is_some(),
|
||||
has_atmosphere: world.get::<Atmosphere>(entity).is_some(),
|
||||
has_tonemapping: world.get::<Tonemapping>(entity).is_some(),
|
||||
has_bloom: world.get::<Bloom>(entity).is_some(),
|
||||
has_ssao: world.get::<ScreenSpaceAmbientOcclusion>(entity).is_some(),
|
||||
has_taa: world.get::<TemporalAntiAliasing>(entity).is_some(),
|
||||
has_hdr: world.get::<Hdr>(entity).is_some(),
|
||||
has_auto_exposure: world.get::<AutoExposure>(entity).is_some(),
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user