Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Assets/Scripts/ControlWPFWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
Expand Down Expand Up @@ -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,
Expand All @@ -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
});
}
Expand Down
17 changes: 17 additions & 0 deletions Assets/Scripts/PostProcessingManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<AmbientOcclusion>();
if (ao == null)
{
ao = sp.AddSettings<AmbientOcclusion>();
}
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<ChromaticAberration>();
if (ca == null)
{
Expand Down
28 changes: 28 additions & 0 deletions Assets/Scripts/Setting/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand All @@ -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;

Expand Down
25 changes: 24 additions & 1 deletion ControlWindowWPF/ControlWindowWPF/GraphicsOptionWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,30 @@
</GroupBox>
</DockPanel>
</GroupBox>
<GroupBox Header="Other" DockPanel.Dock="Top">
<GroupBox Header="Ambient Occlusion" DockPanel.Dock="Top">
<DockPanel DockPanel.Dock="Top" LastChildFill="False">
<DockPanel DockPanel.Dock="Top" LastChildFill="False">
<CheckBox Name="AO_Enable_CheckBox" Content="Enable" DockPanel.Dock="Left" Checked="Checked" Unchecked="Checked"/>
<Button Content="Reset" Click="AO_Reset_Clicked" DockPanel.Dock="Right" Height="Auto" />
</DockPanel>
<DockPanel DockPanel.Dock="Top" LastChildFill="False">
<CheckBox Name="AO_IsScalable_CheckBox" Content="Is Scalable" DockPanel.Dock="Left" Checked="Checked" Unchecked="Checked"/>
</DockPanel>
<DockPanel DockPanel.Dock="Top" LastChildFill="False">
<TextBlock Text="Intensity" DockPanel.Dock="Left"/>
<Slider Name="AO_Intensity_Slider" DockPanel.Dock="Right" HorizontalAlignment="Right" Width="200" Value="0" Minimum="0" Maximum="1" ValueChanged="SliverValueChanged"/>
</DockPanel>
<DockPanel DockPanel.Dock="Top" LastChildFill="False">
<TextBlock Text="Thickness" DockPanel.Dock="Left"/>
<Slider Name="AO_Thickness_Slider" DockPanel.Dock="Right" HorizontalAlignment="Right" Width="200" Value="0" Minimum="0" Maximum="1" ValueChanged="SliverValueChanged"/>
</DockPanel>
<DockPanel DockPanel.Dock="Top" LastChildFill="False">
<Button Content="Color" Name="AO_Color_Button" DockPanel.Dock="Left" Height="Auto" Click="AO_Color_Button_Clicked" Background="Black" />
</DockPanel>
</DockPanel>
</GroupBox>

<GroupBox Header="Other" DockPanel.Dock="Top">
<DockPanel DockPanel.Dock="Top" LastChildFill="True">
<DockPanel DockPanel.Dock="Top" LastChildFill="False">
<CheckBox Name="TurnOffAmbientLight_CheckBox" Content="Turn OFF Ambient Light" DockPanel.Dock="Left" Checked="Checked" Unchecked="Checked"/>
Expand Down
58 changes: 58 additions & 0 deletions ControlWindowWPF/ControlWindowWPF/GraphicsOptionWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@ await Globals.Client.SendCommandAsync(new PipeCommands.SetAdvancedGraphicsOption
Vignette_Color_b = (float)((Vignette_Color_Button.Background as SolidColorBrush).Color.B / 255.0),
Vignette_Color_a = (float)((Vignette_Color_Button.Background as SolidColorBrush).Color.A / 255.0),

AO_Enable = AO_Enable_CheckBox?.IsChecked ?? false,
AO_IsScalable = AO_IsScalable_CheckBox?.IsChecked ?? false,
AO_Intensity = (float)(AO_Intensity_Slider?.Value ?? 0f),
AO_Thickness = (float)(AO_Thickness_Slider?.Value ?? 0f),
AO_Color_a = (float)((AO_Color_Button.Background as SolidColorBrush).Color.A / 255.0),
AO_Color_r = (float)((AO_Color_Button.Background as SolidColorBrush).Color.R / 255.0),
AO_Color_g = (float)((AO_Color_Button.Background as SolidColorBrush).Color.G / 255.0),
AO_Color_b = (float)((AO_Color_Button.Background as SolidColorBrush).Color.B / 255.0),

CA_Enable = CA_Enable_CheckBox?.IsChecked ?? false,
CA_Intensity = (float)(CA_Intensity_Slider?.Value ?? 0f),
CA_FastMode = CA_FastMode_CheckBox?.IsChecked ?? false,
Expand Down Expand Up @@ -192,6 +201,28 @@ private void ValueApply(PipeCommands.SetAdvancedGraphicsOption d)
Vignette_Color_Button.Background = new SolidColorBrush(c);
}

if (AO_Enable_CheckBox != null)
{
AO_Enable_CheckBox.IsChecked = d.AO_Enable;
}
if (AO_IsScalable_CheckBox != null)
{
AO_IsScalable_CheckBox.IsChecked = d.AO_IsScalable;
}
if (AO_Intensity_Slider != null)
{
AO_Intensity_Slider.Value = d.AO_Intensity;
}
if (AO_Thickness_Slider != null)
{
AO_Thickness_Slider.Value = d.AO_Thickness;
}
if (AO_Color_Button != null)
{
Color c = Color.FromArgb((byte)(d.AO_Color_a * 255), (byte)(d.AO_Color_r * 255), (byte)(d.AO_Color_g * 255), (byte)(d.AO_Color_b * 255));
AO_Color_Button.Background = new SolidColorBrush(c);
}


if (CA_Enable_CheckBox != null)
{
Expand Down Expand Up @@ -274,6 +305,23 @@ private void ColorPickerWindow_SelectedColorChanged_Vignette_Color_Button(object
ValueChanged();
}

private void AO_Color_Button_Clicked(object sender, RoutedEventArgs e)
{
var win = new ColorPickerWindow();
win.SelectedColor = (AO_Color_Button.Background as SolidColorBrush).Color;
win.SelectedColorChangedEvent += ColorPickerWindow_SelectedColorChangedAO_Color_Button;
win.Owner = this;
win.ShowDialog();
win.SelectedColorChangedEvent -= ColorPickerWindow_SelectedColorChangedAO_Color_Button;

}

private void ColorPickerWindow_SelectedColorChangedAO_Color_Button(object sender, Color e)
{
AO_Color_Button.Background = new SolidColorBrush(e);
ValueChanged();
}

private void Bloom_Reset_Clicked(object sender, RoutedEventArgs e)
{
Bloom_Intensity_Slider.Value = 2.7f;
Expand Down Expand Up @@ -314,6 +362,16 @@ private void Vignette_Reset_Clicked(object sender, RoutedEventArgs e)
ValueChanged();
}

private void AO_Reset_Clicked(object sender, RoutedEventArgs e)
{
AO_IsScalable_CheckBox.IsChecked = false;
AO_Intensity_Slider.Value = 0f;
AO_Thickness_Slider.Value = 0f;
Color c = Color.FromArgb(0, 0, 0, 255);
AO_Color_Button.Background = new SolidColorBrush(c);
ValueChanged();
}

private void CA_Reset_Clicked(object sender, RoutedEventArgs e)
{
CA_Intensity_Slider.Value = 1f;
Expand Down
10 changes: 10 additions & 0 deletions UnityMemoryMappedFile/PipeCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,11 @@ public class SetAdvancedGraphicsOption
public float Vignette_Smoothness { get; set; }
public float Vignette_Roundness { get; set; }

public bool AO_Enable { get; set; }
public bool AO_IsScalable { get; set; }
public float AO_Intensity { get; set; }
public float AO_Thickness { get; set; }

public bool CA_Enable { get; set; }
public float CA_Intensity { get; set; }
public bool CA_FastMode { get; set; }
Expand All @@ -674,6 +679,11 @@ public class SetAdvancedGraphicsOption
public float Vignette_Color_g { get; set; }
public float Vignette_Color_b { get; set; }

public float AO_Color_a { get; set; }
public float AO_Color_r { get; set; }
public float AO_Color_g { get; set; }
public float AO_Color_b { get; set; }

public bool TurnOffAmbientLight { get; set; }

}
Expand Down