|
|
|
@ -220,6 +220,9 @@ fn hydrate_camera(
|
|
|
|
let skybox_handle = tweak
|
|
|
|
let skybox_handle = tweak
|
|
|
|
.get_handle::<Image>("display3d_models_skybox_file")
|
|
|
|
.get_handle::<Image>("display3d_models_skybox_file")
|
|
|
|
.unwrap();
|
|
|
|
.unwrap();
|
|
|
|
|
|
|
|
let skybox_brightness = tweak.get::<f32>("display3d_skybox_brightness").unwrap();
|
|
|
|
|
|
|
|
let environment_map_intensity = tweak.get::<f32>("display3d_environment_map_light_intensity").unwrap();
|
|
|
|
|
|
|
|
let fog_settings = tweak.get::<tweaks::TweakFogSettings>("display3d_fog").unwrap().into();
|
|
|
|
info!("Hydrating camera {:?}", entity);
|
|
|
|
info!("Hydrating camera {:?}", entity);
|
|
|
|
// Populate the components for the camera
|
|
|
|
// Populate the components for the camera
|
|
|
|
commands.entity(entity).insert((
|
|
|
|
commands.entity(entity).insert((
|
|
|
|
@ -238,18 +241,17 @@ fn hydrate_camera(
|
|
|
|
BloomSettings { ..default() },
|
|
|
|
BloomSettings { ..default() },
|
|
|
|
Skybox {
|
|
|
|
Skybox {
|
|
|
|
image: skybox_handle.clone(),
|
|
|
|
image: skybox_handle.clone(),
|
|
|
|
brightness: 150.0,
|
|
|
|
brightness: skybox_brightness,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
EnvironmentMapLight {
|
|
|
|
EnvironmentMapLight {
|
|
|
|
diffuse_map: skybox_handle.clone(),
|
|
|
|
diffuse_map: skybox_handle.clone(),
|
|
|
|
specular_map: skybox_handle.clone(),
|
|
|
|
specular_map: skybox_handle.clone(),
|
|
|
|
intensity: 1.0,
|
|
|
|
intensity: environment_map_intensity,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
FogSettings { ..default() },
|
|
|
|
FogSettings { ..fog_settings },
|
|
|
|
ScreenSpaceAmbientOcclusionBundle { ..default() },
|
|
|
|
ScreenSpaceAmbientOcclusionBundle { ..default() },
|
|
|
|
TemporalAntiAliasSettings { ..default() },
|
|
|
|
TemporalAntiAliasSettings { ..default() },
|
|
|
|
MotionVectorPrepass,
|
|
|
|
MotionVectorPrepass,
|
|
|
|
// Name::new("3D Camera"),
|
|
|
|
|
|
|
|
));
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
|
|
let assets_handle = tweak
|
|
|
|
let assets_handle = tweak
|
|
|
|
@ -290,6 +292,8 @@ fn update_tweaks(
|
|
|
|
&mut ColorGrading,
|
|
|
|
&mut ColorGrading,
|
|
|
|
&mut Tonemapping,
|
|
|
|
&mut Tonemapping,
|
|
|
|
&mut BloomSettings,
|
|
|
|
&mut BloomSettings,
|
|
|
|
|
|
|
|
&mut Skybox,
|
|
|
|
|
|
|
|
&mut EnvironmentMapLight,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
With<Display3d>,
|
|
|
|
With<Display3d>,
|
|
|
|
>,
|
|
|
|
>,
|
|
|
|
@ -300,7 +304,7 @@ fn update_tweaks(
|
|
|
|
if let Some(tweak) = tweaks.get(tweaks_file.handle.clone()) {
|
|
|
|
if let Some(tweak) = tweaks.get(tweaks_file.handle.clone()) {
|
|
|
|
warn!("Updating tweaks!");
|
|
|
|
warn!("Updating tweaks!");
|
|
|
|
camera_settings.iter_mut().for_each(
|
|
|
|
camera_settings.iter_mut().for_each(
|
|
|
|
|(entity, mut fog, mut color_grading, mut tonemapping, mut bloom)| {
|
|
|
|
|(entity, mut fog, mut color_grading, mut tonemapping, mut bloom, mut skybox, mut environment_map_light)| {
|
|
|
|
*fog = tweak
|
|
|
|
*fog = tweak
|
|
|
|
.get::<tweaks::TweakFogSettings>("display3d_fog")
|
|
|
|
.get::<tweaks::TweakFogSettings>("display3d_fog")
|
|
|
|
.unwrap()
|
|
|
|
.unwrap()
|
|
|
|
@ -317,6 +321,12 @@ fn update_tweaks(
|
|
|
|
.get::<tweaks::TweakBloomSettings>("display3d_bloom")
|
|
|
|
.get::<tweaks::TweakBloomSettings>("display3d_bloom")
|
|
|
|
.unwrap()
|
|
|
|
.unwrap()
|
|
|
|
.into();
|
|
|
|
.into();
|
|
|
|
|
|
|
|
skybox.brightness = tweak
|
|
|
|
|
|
|
|
.get::<f32>("display3d_skybox_brightness")
|
|
|
|
|
|
|
|
.unwrap();
|
|
|
|
|
|
|
|
environment_map_light.intensity = tweak
|
|
|
|
|
|
|
|
.get::<f32>("display3d_environment_map_light_intensity")
|
|
|
|
|
|
|
|
.unwrap();
|
|
|
|
|
|
|
|
|
|
|
|
let quality_level = tweak
|
|
|
|
let quality_level = tweak
|
|
|
|
.get::<tweaks::TweakScreenSpaceAmbientOcclusionQualityLevel>(
|
|
|
|
.get::<tweaks::TweakScreenSpaceAmbientOcclusionQualityLevel>(
|
|
|
|
@ -1124,11 +1134,15 @@ fn setup_capture_piece(
|
|
|
|
// Extension we will add to existing gltf-sourced materials
|
|
|
|
// Extension we will add to existing gltf-sourced materials
|
|
|
|
let extension = DissolveExtension { percentage: 1.0 };
|
|
|
|
let extension = DissolveExtension { percentage: 1.0 };
|
|
|
|
// Base material we will extend for the duration of the dissolve effect
|
|
|
|
// Base material we will extend for the duration of the dissolve effect
|
|
|
|
let base = standard_materials
|
|
|
|
let mut base: StandardMaterial = standard_materials
|
|
|
|
.get(std_handle)
|
|
|
|
.get(std_handle)
|
|
|
|
.expect("Resolve material data")
|
|
|
|
.expect("Resolve material data")
|
|
|
|
.clone();
|
|
|
|
.clone();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
base.alpha_mode = AlphaMode::Mask(0.5);
|
|
|
|
|
|
|
|
base.base_color = Color::NONE.with_a(0.0);
|
|
|
|
|
|
|
|
info!("Base material {:#?}", base);
|
|
|
|
|
|
|
|
|
|
|
|
dissolve_materials.add(ExtendedMaterial { base, extension })
|
|
|
|
dissolve_materials.add(ExtendedMaterial { base, extension })
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Some(dis_handle) => dis_handle.clone(),
|
|
|
|
Some(dis_handle) => dis_handle.clone(),
|
|
|
|
|