diff --git a/Assets/Scripts/ControlWPFWindow.cs b/Assets/Scripts/ControlWPFWindow.cs index 820d13f9..55177b57 100644 --- a/Assets/Scripts/ControlWPFWindow.cs +++ b/Assets/Scripts/ControlWPFWindow.cs @@ -859,6 +859,11 @@ await server.SendCommandAsync(new PipeCommands.SetViveLipTrackingEnable Settings.Current.PPS_Vignette_Smoothness = d.Vignette_Smoothness; Settings.Current.PPS_Vignette_Roundness = d.Vignette_Roundness; + Settings.Current.PPS_AO_Enable = d.AO_Enable; + Settings.Current.PPS_AO_IsScalable = d.AO_IsScalable; + Settings.Current.PPS_AO_Intensity = d.AO_Intensity; + Settings.Current.PPS_AO_Thickness = d.AO_Thickness; + Settings.Current.PPS_CA_Enable = d.CA_Enable; Settings.Current.PPS_CA_Intensity = d.CA_Intensity; Settings.Current.PPS_CA_FastMode = d.CA_FastMode; @@ -878,6 +883,11 @@ await server.SendCommandAsync(new PipeCommands.SetViveLipTrackingEnable Settings.Current.PPS_Vignette_Color_g = d.Vignette_Color_g; Settings.Current.PPS_Vignette_Color_b = d.Vignette_Color_b; + Settings.Current.PPS_AO_Color_a = d.AO_Color_a; + Settings.Current.PPS_AO_Color_r = d.AO_Color_r; + Settings.Current.PPS_AO_Color_g = d.AO_Color_g; + Settings.Current.PPS_AO_Color_b = d.AO_Color_b; + Settings.Current.TurnOffAmbientLight = d.TurnOffAmbientLight; SetAdvancedGraphicsOption(); @@ -1007,6 +1017,11 @@ await server.SendCommandAsync(new PipeCommands.SetAdvancedGraphicsOption Vignette_Smoothness = Settings.Current.PPS_Vignette_Smoothness, Vignette_Roundness = Settings.Current.PPS_Vignette_Roundness, + AO_Enable = Settings.Current.PPS_AO_Enable, + AO_IsScalable = Settings.Current.PPS_AO_IsScalable, + AO_Intensity = Settings.Current.PPS_AO_Intensity, + AO_Thickness = Settings.Current.PPS_AO_Thickness, + CA_Enable = Settings.Current.PPS_CA_Enable, CA_Intensity = Settings.Current.PPS_CA_Intensity, CA_FastMode = Settings.Current.PPS_CA_FastMode, @@ -1026,6 +1041,11 @@ await server.SendCommandAsync(new PipeCommands.SetAdvancedGraphicsOption Vignette_Color_g = Settings.Current.PPS_Vignette_Color_g, Vignette_Color_b = Settings.Current.PPS_Vignette_Color_b, + AO_Color_a = Settings.Current.PPS_AO_Color_a, + AO_Color_r = Settings.Current.PPS_AO_Color_r, + AO_Color_g = Settings.Current.PPS_AO_Color_g, + AO_Color_b = Settings.Current.PPS_AO_Color_b, + TurnOffAmbientLight = Settings.Current.TurnOffAmbientLight }); } diff --git a/Assets/Scripts/PostProcessingManager.cs b/Assets/Scripts/PostProcessingManager.cs index 7404a685..4a9f72d8 100644 --- a/Assets/Scripts/PostProcessingManager.cs +++ b/Assets/Scripts/PostProcessingManager.cs @@ -113,6 +113,23 @@ public void Apply(Settings d) vg.color.overrideState = true; vg.color.value = new Color(d.PPS_Vignette_Color_r, d.PPS_Vignette_Color_g, d.PPS_Vignette_Color_b, d.PPS_Vignette_Color_a); + var ao = sp.GetSetting(); + if (ao == null) + { + ao = sp.AddSettings(); + } + ao.active = true; + ao.enabled.overrideState = true; + ao.enabled.value = d.PPS_AO_Enable; + ao.mode.overrideState = true; + ao.mode.value = d.PPS_AO_IsScalable ? AmbientOcclusionMode.ScalableAmbientObscurance : AmbientOcclusionMode.MultiScaleVolumetricObscurance; + ao.intensity.overrideState = true; + ao.intensity.value = d.PPS_AO_Intensity; + ao.thicknessModifier.overrideState = true; + ao.thicknessModifier.value = d.PPS_AO_Thickness; + ao.color.overrideState = true; + ao.color.value = new Color(d.PPS_AO_Color_r, d.PPS_AO_Color_g, d.PPS_AO_Color_b, d.PPS_AO_Color_a); + var ca = sp.GetSetting(); if (ca == null) { diff --git a/Assets/Scripts/Setting/Settings.cs b/Assets/Scripts/Setting/Settings.cs index fbece59e..e9036e5c 100644 --- a/Assets/Scripts/Setting/Settings.cs +++ b/Assets/Scripts/Setting/Settings.cs @@ -613,6 +613,15 @@ public class Settings [OptionalField] public float PPS_Vignette_Roundness; + [OptionalField] + public bool PPS_AO_Enable; + [OptionalField] + public bool PPS_AO_IsScalable; + [OptionalField] + public float PPS_AO_Intensity; + [OptionalField] + public float PPS_AO_Thickness; + [OptionalField] public bool PPS_CA_Enable; [OptionalField] @@ -647,6 +656,15 @@ public class Settings [OptionalField] public float PPS_Vignette_Color_b; + [OptionalField] + public float PPS_AO_Color_a; + [OptionalField] + public float PPS_AO_Color_r; + [OptionalField] + public float PPS_AO_Color_g; + [OptionalField] + public float PPS_AO_Color_b; + [OptionalField] public bool TurnOffAmbientLight; @@ -829,6 +847,11 @@ internal void OnDeserializingMethod(StreamingContext context) PPS_Vignette_Smoothness = 0.35f; PPS_Vignette_Roundness = 1f; + PPS_AO_Enable = false; + PPS_AO_IsScalable = false; + PPS_AO_Intensity = 0f; + PPS_AO_Thickness = 0f; + PPS_CA_Enable = false; PPS_CA_Intensity = 1f; PPS_CA_FastMode = false; @@ -848,6 +871,11 @@ internal void OnDeserializingMethod(StreamingContext context) PPS_Vignette_Color_g = 0f; PPS_Vignette_Color_b = 0f; + PPS_AO_Color_a = 0f; + PPS_AO_Color_r = 0f; + PPS_AO_Color_g = 0f; + PPS_AO_Color_b = 0f; + TurnOffAmbientLight = false; ExternalBonesReceiverEnable = false; diff --git a/ControlWindowWPF/ControlWindowWPF/GraphicsOptionWindow.xaml b/ControlWindowWPF/ControlWindowWPF/GraphicsOptionWindow.xaml index d4d4cd95..61c50a98 100644 --- a/ControlWindowWPF/ControlWindowWPF/GraphicsOptionWindow.xaml +++ b/ControlWindowWPF/ControlWindowWPF/GraphicsOptionWindow.xaml @@ -128,7 +128,30 @@ - + + + + +