Ver Fonte

Add effects

habeebweeb há 4 anos atrás
pai
commit
81460df7a7
16 ficheiros alterados com 998 adições e 24 exclusões
  1. 100 0
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindowPanes/EffectsPanes/BloomPane.cs
  2. 80 0
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindowPanes/EffectsPanes/DepthOfFieldPane.cs
  3. 74 0
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindowPanes/EffectsPanes/EffectPane.cs
  4. 55 0
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindowPanes/EffectsPanes/EffectsPane.cs
  5. 115 0
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindowPanes/EffectsPanes/FogPane.cs
  6. 72 0
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindowPanes/EffectsPanes/VignettePane.cs
  7. 1 1
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BasePane.cs
  8. 15 0
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/MainWindowPanes/BGWindowPane.cs
  9. 19 6
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Managers/EffectManager.cs
  10. 128 0
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Managers/EffectManagers/BloomEffectManager.cs
  11. 100 0
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Managers/EffectManagers/DepthOfFieldManager.cs
  12. 124 0
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Managers/EffectManagers/FogEffectManager.cs
  13. 13 0
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Managers/EffectManagers/IEffectManager.cs
  14. 88 0
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Managers/EffectManagers/VignetteEffectManager.cs
  15. 13 6
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Managers/EnvironmentManager.cs
  16. 1 11
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/MeidoPhotoStudio.cs

+ 100 - 0
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindowPanes/EffectsPanes/BloomPane.cs

@@ -0,0 +1,100 @@
+using UnityEngine;
+
+namespace COM3D2.MeidoPhotoStudio.Plugin
+{
+    internal class BloomPane : EffectPane<BloomEffectManager>
+    {
+        protected override BloomEffectManager EffectManager { get; set; }
+        private Slider intensitySlider;
+        private Slider blurSlider;
+        private Slider redSlider;
+        private Slider greenSlider;
+        private Slider blueSlider;
+        private Toggle hdrToggle;
+
+        public BloomPane(EffectManager effectManager) : base(effectManager.BloomEffectManager)
+        {
+            Bloom bloom = GameMain.Instance.MainCamera.GetComponent<Bloom>();
+
+            this.intensitySlider = new Slider(
+                Translation.Get("effectBloom", "intensity"), 0f, 5.7f, bloom.bloomIntensity
+            );
+            this.intensitySlider.ControlEvent += (s, a) =>
+            {
+                if (this.updating) return;
+                this.EffectManager.Intensity = this.intensitySlider.Value;
+            };
+            this.blurSlider = new Slider(Translation.Get("effectBloom", "blur"), 0f, 15f, bloom.bloomBlurIterations);
+            this.blurSlider.ControlEvent += (s, a) =>
+            {
+                if (this.updating) return;
+                this.EffectManager.BlurIterations = (int)this.blurSlider.Value;
+            };
+            this.redSlider = new Slider(Translation.Get("backgroundWindow", "red"), 1f, 0.5f, 1f);
+            this.redSlider.ControlEvent += (s, a) =>
+            {
+                if (this.updating) return;
+                this.EffectManager.BloomThresholdColorRed = this.redSlider.Value;
+            };
+            this.greenSlider = new Slider(Translation.Get("backgroundWindow", "green"), 1f, 0.5f, 1f);
+            this.greenSlider.ControlEvent += (s, a) =>
+            {
+                if (this.updating) return;
+                this.EffectManager.BloomThresholdColorGreen = this.greenSlider.Value;
+            };
+            this.blueSlider = new Slider(Translation.Get("backgroundWindow", "blue"), 1f, 0.5f, 1f);
+            this.blueSlider.ControlEvent += (s, a) =>
+            {
+                if (this.updating) return;
+                this.EffectManager.BloomThresholdColorBlue = this.blueSlider.Value;
+            };
+            this.hdrToggle = new Toggle(Translation.Get("effectBloom", "hdrToggle"));
+            this.hdrToggle.ControlEvent += (s, a) =>
+            {
+                if (this.updating) return;
+                this.EffectManager.BloomHDR = this.hdrToggle.Value;
+            };
+        }
+
+        protected override void TranslatePane()
+        {
+            this.intensitySlider.Label = Translation.Get("effectBloom", "intensity");
+            this.blurSlider.Label = Translation.Get("effectBloom", "blur");
+            this.redSlider.Label = Translation.Get("backgroundWindow", "red");
+            this.greenSlider.Label = Translation.Get("backgroundWindow", "green");
+            this.blueSlider.Label = Translation.Get("backgroundWindow", "blue");
+            this.hdrToggle.Label = Translation.Get("effectBloom", "hdrToggle");
+        }
+
+        protected override void UpdateControls()
+        {
+            this.intensitySlider.Value = this.EffectManager.Intensity;
+            this.blurSlider.Value = this.EffectManager.BlurIterations;
+            this.redSlider.Value = this.EffectManager.BloomThresholdColorRed;
+            this.greenSlider.Value = this.EffectManager.BloomThresholdColorGreen;
+            this.blueSlider.Value = this.EffectManager.BloomThresholdColorBlue;
+            this.hdrToggle.Value = this.EffectManager.BloomHDR;
+        }
+
+        protected override void DrawPane()
+        {
+            GUILayoutOption sliderWidth = MiscGUI.HalfSlider;
+
+            GUILayout.BeginHorizontal();
+            this.intensitySlider.Draw(sliderWidth);
+            this.blurSlider.Draw(sliderWidth);
+            GUILayout.EndHorizontal();
+
+            GUILayout.BeginHorizontal();
+            this.redSlider.Draw(sliderWidth);
+            this.greenSlider.Draw(sliderWidth);
+            GUILayout.EndHorizontal();
+
+            GUILayout.BeginHorizontal();
+            this.blueSlider.Draw(sliderWidth);
+            GUILayout.FlexibleSpace();
+            this.hdrToggle.Draw(GUILayout.ExpandWidth(false));
+            GUILayout.EndHorizontal();
+        }
+    }
+}

+ 80 - 0
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindowPanes/EffectsPanes/DepthOfFieldPane.cs

@@ -0,0 +1,80 @@
+using UnityEngine;
+
+namespace COM3D2.MeidoPhotoStudio.Plugin
+{
+    internal class DepthOfFieldPane : EffectPane<DepthOfFieldEffectManager>
+    {
+        protected override DepthOfFieldEffectManager EffectManager { get; set; }
+        private Slider focalLengthSlider;
+        private Slider focalSizeSlider;
+        private Slider apertureSlider;
+        private Slider blurSlider;
+        private Toggle thicknessToggle;
+
+        public DepthOfFieldPane(EffectManager effectManager) : base(effectManager.DepthOfFieldEffectManager)
+        {
+            this.focalLengthSlider = new Slider(Translation.Get("effectDof", "focalLength"), 0f, 10f);
+            this.focalSizeSlider = new Slider(Translation.Get("effectDof", "focalArea"), 0f, 2f);
+            this.apertureSlider = new Slider(Translation.Get("effectDof", "aperture"), 0f, 60f);
+            this.blurSlider = new Slider(Translation.Get("effectDof", "blur"), 0f, 10f);
+            this.thicknessToggle = new Toggle(Translation.Get("effectDof", "thicknessToggle"));
+            this.focalLengthSlider.ControlEvent += (s, a) =>
+            {
+                this.EffectManager.FocalLength = this.focalLengthSlider.Value;
+            };
+            this.focalSizeSlider.ControlEvent += (s, a) =>
+            {
+                this.EffectManager.FocalSize = this.focalSizeSlider.Value;
+            };
+            this.apertureSlider.ControlEvent += (s, a) =>
+            {
+                this.EffectManager.Aperture = this.apertureSlider.Value;
+            };
+            this.blurSlider.ControlEvent += (s, a) =>
+            {
+                this.EffectManager.MaxBlurSize = this.blurSlider.Value;
+            };
+            this.thicknessToggle.ControlEvent += (s, a) =>
+            {
+                this.EffectManager.VisualizeFocus = this.thicknessToggle.Value;
+            };
+        }
+
+        protected override void TranslatePane()
+        {
+            this.focalLengthSlider.Label = Translation.Get("effectDof", "focalLength");
+            this.focalSizeSlider.Label = Translation.Get("effectDof", "focalArea");
+            this.apertureSlider.Label = Translation.Get("effectDof", "aperture");
+            this.blurSlider.Label = Translation.Get("effectDof", "blur");
+            this.thicknessToggle.Label = Translation.Get("effectDof", "thicknessToggle");
+        }
+
+        protected override void UpdateControls()
+        {
+            this.focalLengthSlider.Value = this.EffectManager.FocalLength;
+            this.focalSizeSlider.Value = this.EffectManager.FocalSize;
+            this.apertureSlider.Value = this.EffectManager.Aperture;
+            this.blurSlider.Value = this.EffectManager.MaxBlurSize;
+            this.thicknessToggle.Value = this.EffectManager.VisualizeFocus;
+        }
+
+        protected override void DrawPane()
+        {
+            this.focalLengthSlider.Draw();
+
+            GUILayoutOption sliderWidth = MiscGUI.HalfSlider;
+
+            GUILayout.BeginHorizontal();
+            this.focalSizeSlider.Draw(sliderWidth);
+            this.apertureSlider.Draw(sliderWidth);
+            GUILayout.EndHorizontal();
+
+            GUILayout.BeginHorizontal();
+            this.blurSlider.Draw(sliderWidth);
+            GUILayout.FlexibleSpace();
+            this.thicknessToggle.Draw();
+            GUILayout.EndHorizontal();
+            GUI.enabled = true;
+        }
+    }
+}

+ 74 - 0
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindowPanes/EffectsPanes/EffectPane.cs

@@ -0,0 +1,74 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace COM3D2.MeidoPhotoStudio.Plugin
+{
+    internal abstract class EffectPane<T> : BasePane where T : IEffectManager
+    {
+        protected abstract T EffectManager { get; set; }
+        protected Toggle effectToggle;
+        protected Button resetEffectButton;
+        private bool enabled;
+        public override bool Enabled
+        {
+            get => enabled;
+            set
+            {
+                this.enabled = value;
+                this.EffectManager.SetEffectActive(this.enabled);
+            }
+        }
+
+        public EffectPane(T effectManager) : base()
+        {
+            this.EffectManager = effectManager;
+            this.resetEffectButton = new Button(Translation.Get("effectsPane", "reset"));
+            this.resetEffectButton.ControlEvent += (s, a) => this.ResetEffect();
+            this.effectToggle = new Toggle(Translation.Get("effectsPane", "onToggle"));
+            this.effectToggle.ControlEvent += (s, a) => this.Enabled = this.effectToggle.Value;
+        }
+
+        protected override void ReloadTranslation()
+        {
+            this.updating = true;
+            this.effectToggle.Label = Translation.Get("effectsPane", "onToggle");
+            this.resetEffectButton.Label = Translation.Get("effectsPane", "reset");
+            TranslatePane();
+            this.updating = false;
+        }
+
+        protected abstract void TranslatePane();
+
+        public override void UpdatePane()
+        {
+            if (!EffectManager.IsReady) return;
+            this.updating = true;
+            this.effectToggle.Value = this.EffectManager.IsActive;
+            this.UpdateControls();
+            this.updating = false;
+        }
+
+        protected abstract void UpdateControls();
+
+        public override void Draw()
+        {
+            GUILayout.BeginHorizontal();
+            effectToggle.Draw();
+            GUILayout.FlexibleSpace();
+            GUI.enabled = this.Enabled;
+            resetEffectButton.Draw();
+            GUILayout.EndHorizontal();
+            DrawPane();
+            GUI.enabled = true;
+        }
+
+        protected abstract void DrawPane();
+
+        private void ResetEffect()
+        {
+            this.EffectManager.Deactivate();
+            this.EffectManager.SetEffectActive(true);
+            this.UpdatePane();
+        }
+    }
+}

+ 55 - 0
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindowPanes/EffectsPanes/EffectsPane.cs

@@ -0,0 +1,55 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace COM3D2.MeidoPhotoStudio.Plugin
+{
+    internal class EffectsPane : BasePane
+    {
+        private Dictionary<string, BasePane> effectPanes = new Dictionary<string, BasePane>();
+        private SelectionGrid effectToggles;
+        private BasePane currentEffectPane;
+        private List<string> effectList = new List<string>();
+
+        public BasePane this[string effectUI]
+        {
+            private get => effectPanes[effectUI];
+            set
+            {
+                effectPanes[effectUI] = value;
+                effectList.Add(effectUI);
+                effectToggles.SetItems(Translation.GetArray("effectsPane", effectList), 0);
+            }
+        }
+
+        public EffectsPane()
+        {
+            effectToggles = new SelectionGrid(new[] { "dummy" });
+            effectToggles.ControlEvent += (s, a) => SetEffectPane(effectList[effectToggles.SelectedItemIndex]);
+        }
+
+        protected override void ReloadTranslation()
+        {
+            effectToggles.SetItems(Translation.GetArray("effectsPane", effectList));
+        }
+
+        private void SetEffectPane(string effectUI)
+        {
+            currentEffectPane = effectPanes[effectUI];
+            currentEffectPane.UpdatePane();
+        }
+
+        public override void UpdatePane()
+        {
+            currentEffectPane.UpdatePane();
+        }
+
+        public override void Draw()
+        {
+            MiscGUI.Header("Effects");
+            MiscGUI.WhiteLine();
+            effectToggles.Draw();
+            currentEffectPane.Draw();
+        }
+    }
+}

+ 115 - 0
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindowPanes/EffectsPanes/FogPane.cs

@@ -0,0 +1,115 @@
+using UnityEngine;
+
+namespace COM3D2.MeidoPhotoStudio.Plugin
+{
+    internal class FogPane : EffectPane<FogEffectManager>
+    {
+        protected override FogEffectManager EffectManager { get; set; }
+        private Slider distanceSlider;
+        private Slider densitySlider;
+        private Slider heightScaleSlider;
+        private Slider heightSlider;
+        private Slider redSlider;
+        private Slider greenSlider;
+        private Slider blueSlider;
+
+        public FogPane(EffectManager effectManager) : base(effectManager.FogEffectManager)
+        {
+            this.distanceSlider = new Slider(
+                Translation.Get("effectFog", "distance"), 0f, 30f, FogEffectManager.InitialDistance
+            );
+            this.densitySlider = new Slider(
+                Translation.Get("effectFog", "density"), 0f, 10f, FogEffectManager.InitialDensity
+            );
+            this.heightScaleSlider = new Slider(
+                Translation.Get("effectFog", "strength"), -5f, 20f, FogEffectManager.InitialHeightScale
+            );
+            this.heightSlider = new Slider(
+                Translation.Get("effectFog", "height"), -10f, 10f, FogEffectManager.InitialHeight
+            );
+            Color initialFogColour = FogEffectManager.InitialColour;
+            this.redSlider = new Slider(Translation.Get("backgroundWIndow", "red"), 0f, 1f, initialFogColour.r);
+            this.greenSlider = new Slider(Translation.Get("backgroundWIndow", "green"), 0f, 1f, initialFogColour.g);
+            this.blueSlider = new Slider(Translation.Get("backgroundWIndow", "blue"), 0f, 1f, initialFogColour.b);
+            this.distanceSlider.ControlEvent += (s, a) =>
+            {
+                if (this.updating) return;
+                this.EffectManager.Distance = this.distanceSlider.Value;
+            };
+            this.densitySlider.ControlEvent += (s, a) =>
+            {
+                if (this.updating) return;
+                this.EffectManager.Density = this.densitySlider.Value;
+            };
+            this.heightScaleSlider.ControlEvent += (s, a) =>
+            {
+                if (this.updating) return;
+                this.EffectManager.HeightScale = this.heightScaleSlider.Value;
+            };
+            this.heightSlider.ControlEvent += (s, a) =>
+            {
+                if (this.updating) return;
+                this.EffectManager.Height = this.heightSlider.Value;
+            };
+            this.redSlider.ControlEvent += (s, a) =>
+            {
+                if (this.updating) return;
+                this.EffectManager.FogColourRed = this.redSlider.Value;
+            };
+            this.greenSlider.ControlEvent += (s, a) =>
+            {
+                if (this.updating) return;
+                this.EffectManager.FogColourGreen = this.greenSlider.Value;
+            };
+            this.blueSlider.ControlEvent += (s, a) =>
+            {
+                if (this.updating) return;
+                this.EffectManager.FogColourBlue = this.blueSlider.Value;
+            };
+        }
+
+        protected override void TranslatePane()
+        {
+            this.distanceSlider.Label = Translation.Get("effectFog", "distance");
+            this.densitySlider.Label = Translation.Get("effectFog", "density");
+            this.heightScaleSlider.Label = Translation.Get("effectFog", "strength");
+            this.heightSlider.Label = Translation.Get("effectFog", "height");
+            this.redSlider.Label = Translation.Get("backgroundWIndow", "red");
+            this.greenSlider.Label = Translation.Get("backgroundWIndow", "green");
+            this.blueSlider.Label = Translation.Get("backgroundWIndow", "blue");
+        }
+
+        protected override void UpdateControls()
+        {
+            this.distanceSlider.Value = EffectManager.Distance;
+            this.densitySlider.Value = EffectManager.Density;
+            this.heightScaleSlider.Value = EffectManager.HeightScale;
+            this.heightSlider.Value = EffectManager.Height;
+            this.redSlider.Value = EffectManager.FogColourRed;
+            this.greenSlider.Value = EffectManager.FogColourGreen;
+            this.blueSlider.Value = EffectManager.FogColourBlue;
+        }
+
+        protected override void DrawPane()
+        {
+            GUILayoutOption sliderWidth = MiscGUI.HalfSlider;
+
+            GUILayout.BeginHorizontal();
+            this.distanceSlider.Draw(sliderWidth);
+            this.densitySlider.Draw(sliderWidth);
+            GUILayout.EndHorizontal();
+
+            GUILayout.BeginHorizontal();
+            this.heightScaleSlider.Draw(sliderWidth);
+            this.heightSlider.Draw(sliderWidth);
+            GUILayout.EndHorizontal();
+
+            GUILayout.BeginHorizontal();
+            redSlider.Draw(sliderWidth);
+            greenSlider.Draw(sliderWidth);
+            GUILayout.EndHorizontal();
+
+            blueSlider.Draw(sliderWidth);
+        }
+    }
+}

+ 72 - 0
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindowPanes/EffectsPanes/VignettePane.cs

@@ -0,0 +1,72 @@
+using UnityEngine;
+
+namespace COM3D2.MeidoPhotoStudio.Plugin
+{
+    internal class VignettePane : EffectPane<VignetteEffectManager>
+    {
+        protected override VignetteEffectManager EffectManager { get; set; }
+        private Slider intensitySlider;
+        private Slider blurSlider;
+        private Slider blurSpreadSlider;
+        private Slider aberrationSlider;
+
+        public VignettePane(EffectManager effectManager) : base(effectManager.VignetteEffectManager)
+        {
+            this.intensitySlider = new Slider(Translation.Get("effectVignette", "intensity"), -40f, 70f);
+            this.intensitySlider.ControlEvent += (s, a) =>
+            {
+                if (this.updating) return;
+                this.EffectManager.Intensity = this.intensitySlider.Value;
+            };
+            this.blurSlider = new Slider(Translation.Get("effectVignette", "blur"), 0f, 5f);
+            this.blurSlider.ControlEvent += (s, a) =>
+            {
+                if (this.updating) return;
+                this.EffectManager.Blur = this.blurSlider.Value;
+            };
+            this.blurSpreadSlider = new Slider(Translation.Get("effectVignette", "blurSpread"), 0f, 40f);
+            this.blurSpreadSlider.ControlEvent += (s, a) =>
+            {
+                if (this.updating) return;
+                this.EffectManager.BlurSpread = this.blurSpreadSlider.Value;
+            };
+            this.aberrationSlider = new Slider(Translation.Get("effectVignette", "aberration"), -30f, 30f);
+            this.aberrationSlider.ControlEvent += (s, a) =>
+            {
+                if (this.updating) return;
+                this.EffectManager.ChromaticAberration = this.aberrationSlider.Value;
+            };
+        }
+
+        protected override void TranslatePane()
+        {
+            this.intensitySlider.Label = Translation.Get("effectVignette", "intensity");
+            this.blurSlider.Label = Translation.Get("effectVignette", "blur");
+            this.blurSpreadSlider.Label = Translation.Get("effectVignette", "blurSpread");
+            this.aberrationSlider.Label = Translation.Get("effectVignette", "aberration");
+        }
+
+        protected override void UpdateControls()
+        {
+            this.intensitySlider.Value = this.EffectManager.Intensity;
+            this.blurSlider.Value = this.EffectManager.Blur;
+            this.blurSpreadSlider.Value = this.EffectManager.BlurSpread;
+            this.aberrationSlider.Value = this.EffectManager.ChromaticAberration;
+        }
+
+        protected override void DrawPane()
+        {
+            GUILayoutOption sliderWidth = MiscGUI.HalfSlider;
+
+            GUILayout.BeginHorizontal();
+            this.intensitySlider.Draw(sliderWidth);
+            this.blurSlider.Draw(sliderWidth);
+            GUILayout.EndHorizontal();
+
+            GUILayout.BeginHorizontal();
+            this.blurSpreadSlider.Draw(sliderWidth);
+            this.aberrationSlider.Draw(sliderWidth);
+            GUILayout.EndHorizontal();
+        }
+    }
+}

+ 1 - 1
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BasePane.cs

@@ -8,7 +8,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         protected List<BaseControl> Controls { get; set; }
         protected bool updating = false;
         public virtual bool Visible { get; set; }
-        public bool Enabled { get; set; }
+        public virtual bool Enabled { get; set; }
 
         public BasePane()
         {

+ 15 - 0
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/MainWindowPanes/BGWindowPane.cs

@@ -8,18 +8,32 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         private BackgroundSelectorPane backgroundSelectorPane;
         private PropsPane propsPane;
         private LightsPane lightsPane;
+        private EffectsPane effectsPane;
 
         public BGWindowPane(EnvironmentManager environmentManager)
         {
             this.backgroundSelectorPane = new BackgroundSelectorPane(environmentManager);
             this.propsPane = new PropsPane(environmentManager.PropManager);
             this.lightsPane = new LightsPane(environmentManager);
+
+            EffectManager effectManager = environmentManager.EffectManager;
+
+            this.effectsPane = new EffectsPane()
+            {
+                ["bloom"] = new BloomPane(effectManager),
+                ["dof"] = new DepthOfFieldPane(effectManager),
+                ["vignette"] = new VignettePane(effectManager),
+                ["fog"] = new FogPane(effectManager)
+            };
         }
         public override void Draw()
         {
             this.backgroundSelectorPane.Draw();
             this.propsPane.Draw();
+            this.scrollPos = GUILayout.BeginScrollView(this.scrollPos);
             this.lightsPane.Draw();
+            this.effectsPane.Draw();
+            GUILayout.EndScrollView();
         }
 
         public override void UpdatePanes()
@@ -28,6 +42,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             {
                 this.propsPane.UpdatePane();
                 this.lightsPane.UpdatePane();
+                this.effectsPane.UpdatePane();
             }
         }
     }

+ 19 - 6
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Managers/EffectManager.cs

@@ -5,27 +5,40 @@ using UnityEngine;
 
 namespace COM3D2.MeidoPhotoStudio.Plugin
 {
-    public class EffectManager
+    internal class EffectManager
     {
+        public BloomEffectManager BloomEffectManager { get; }
+        public DepthOfFieldEffectManager DepthOfFieldEffectManager { get; }
+        public VignetteEffectManager VignetteEffectManager { get; }
+        public FogEffectManager FogEffectManager { get; }
+
         public EffectManager()
         {
-
+            BloomEffectManager = new BloomEffectManager();
+            DepthOfFieldEffectManager = new DepthOfFieldEffectManager();
+            VignetteEffectManager = new VignetteEffectManager();
+            FogEffectManager = new FogEffectManager();
         }
 
         public void Activate()
         {
-
+            BloomEffectManager.Activate();
+            DepthOfFieldEffectManager.Activate();
+            VignetteEffectManager.Activate();
+            FogEffectManager.Activate();
         }
 
         public void Deactivate()
         {
-
+            BloomEffectManager.Deactivate();
+            DepthOfFieldEffectManager.Deactivate();
+            VignetteEffectManager.Deactivate();
+            FogEffectManager.Deactivate();
         }
 
         public void Update()
         {
-
+            BloomEffectManager.Update();
         }
-
     }
 }

+ 128 - 0
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Managers/EffectManagers/BloomEffectManager.cs

@@ -0,0 +1,128 @@
+using System;
+using UnityEngine;
+
+namespace COM3D2.MeidoPhotoStudio.Plugin
+{
+    internal class BloomEffectManager : IEffectManager
+    {
+        private Bloom Bloom { get; set; }
+        private float initialIntensity;
+        private int initialBlurIterations;
+        private Color initialThresholdColour;
+        private Bloom.HDRBloomMode initialHDRBloomMode;
+        public bool IsReady { get; private set; }
+        public bool IsActive { get; private set; }
+        private float intensity;
+        public float Intensity
+        {
+            get => intensity;// m_gcBloom.GetValue();
+            set => intensity = value;
+        }
+        private int blurIterations;
+        public int BlurIterations
+        {
+            get => blurIterations;
+            set => blurIterations = Bloom.bloomBlurIterations = value;
+        }
+        public float BloomThresholdColorRed
+        {
+            get => BloomThresholdColour.r;
+            set
+            {
+                Color colour = Bloom.bloomThreshholdColor;
+                BloomThresholdColour = new Color(value, colour.g, colour.b);
+            }
+        }
+        public float BloomThresholdColorGreen
+        {
+            get => BloomThresholdColour.g;
+            set
+            {
+                Color colour = Bloom.bloomThreshholdColor;
+                BloomThresholdColour = new Color(colour.r, value, colour.b);
+            }
+        }
+        public float BloomThresholdColorBlue
+        {
+            get => BloomThresholdColour.b;
+            set
+            {
+                Color colour = Bloom.bloomThreshholdColor;
+                BloomThresholdColour = new Color(colour.r, colour.g, value);
+            }
+        }
+        private Color bloomThresholdColour;
+        public Color BloomThresholdColour
+        {
+            get => bloomThresholdColour;
+            set => bloomThresholdColour = Bloom.bloomThreshholdColor = value;
+        }
+        private bool HDRBloomMode;
+        public bool BloomHDR
+        {
+            get => HDRBloomMode;
+            set
+            {
+                Bloom.hdr = value ? Bloom.HDRBloomMode.On : Bloom.HDRBloomMode.Auto;
+                HDRBloomMode = value;
+            }
+        }
+
+        public void Activate()
+        {
+            if (Bloom == null)
+            {
+                IsReady = true;
+                Bloom = GameMain.Instance.MainCamera.GetOrAddComponent<Bloom>();
+                initialIntensity = Intensity = Bloom.bloomIntensity;
+                initialBlurIterations = BlurIterations = Bloom.bloomBlurIterations;
+                initialThresholdColour = BloomThresholdColour = Bloom.bloomThreshholdColor;
+                initialHDRBloomMode = Bloom.hdr;
+                BloomHDR = initialHDRBloomMode == Bloom.HDRBloomMode.On;
+            }
+        }
+
+        public void Deactivate()
+        {
+            Intensity = initialIntensity;
+            BlurIterations = initialBlurIterations;
+            BloomThresholdColour = initialThresholdColour;
+            BloomHDR = initialHDRBloomMode == Bloom.HDRBloomMode.On;
+            BloomHDR = false;
+            Bloom.enabled = true;
+            IsActive = false;
+        }
+
+        public void Reset()
+        {
+            Bloom.bloomIntensity = initialIntensity;
+            Bloom.bloomBlurIterations = initialBlurIterations;
+            Bloom.bloomThreshholdColor = initialThresholdColour;
+            Bloom.hdr = initialHDRBloomMode;
+        }
+
+        public void SetEffectActive(bool active)
+        {
+            Bloom.enabled = active;
+            IsActive = active;
+            if (this.IsActive)
+            {
+                Bloom.bloomIntensity = Intensity;
+                Bloom.bloomBlurIterations = BlurIterations;
+                Bloom.bloomThreshholdColor = BloomThresholdColour;
+                Bloom.hdr = BloomHDR ? Bloom.HDRBloomMode.On : Bloom.HDRBloomMode.Auto;
+            }
+            else Reset();
+        }
+
+        public void Update()
+        {
+            if (IsActive)
+            {
+                // Fuck this stupid shit
+                Bloom.enabled = true;
+                Bloom.bloomIntensity = intensity;
+            }
+        }
+    }
+}

+ 100 - 0
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Managers/EffectManagers/DepthOfFieldManager.cs

@@ -0,0 +1,100 @@
+using UnityEngine;
+using UnityEngine.PostProcessing;
+
+namespace COM3D2.MeidoPhotoStudio.Plugin
+{
+    internal class DepthOfFieldEffectManager : IEffectManager
+    {
+        private DepthOfFieldScatter DepthOfField { get; set; }
+        public bool IsReady { get; private set; }
+        public bool IsActive { get; private set; }
+        private readonly float initialValue = 0f;
+        private float focalLength;
+        public float FocalLength
+        {
+            get => focalLength;
+            set => focalLength = DepthOfField.focalLength = value;
+        }
+
+        private float focalSize;
+        public float FocalSize
+        {
+            get => focalSize;
+            set => focalSize = DepthOfField.focalSize = value;
+        }
+        private float aperture;
+        public float Aperture
+        {
+            get => aperture;
+            set => aperture = DepthOfField.aperture = value;
+        }
+        private float maxBlurSize;
+        public float MaxBlurSize
+        {
+            get => maxBlurSize;
+            set => maxBlurSize = DepthOfField.maxBlurSize = value;
+        }
+        private bool visualizeFocus;
+        public bool VisualizeFocus
+        {
+            get => visualizeFocus;
+            set => visualizeFocus = DepthOfField.visualizeFocus = value;
+        }
+
+        public void Activate()
+        {
+            if (DepthOfField == null)
+            {
+                IsReady = true;
+                DepthOfField = GameMain.Instance.MainCamera.GetOrAddComponent<DepthOfFieldScatter>();
+                if (DepthOfField.dofHdrShader == null)
+                {
+                    DepthOfField.dofHdrShader = Shader.Find("Hidden/Dof/DepthOfFieldHdr");
+                }
+                if (DepthOfField.dx11BokehShader == null)
+                {
+                    DepthOfField.dx11BokehShader = Shader.Find("Hidden/Dof/DX11Dof");
+                }
+                if (DepthOfField.dx11BokehTexture == null)
+                {
+                    DepthOfField.dx11BokehTexture = Resources.Load("Textures/hexShape") as Texture2D;
+                }
+            }
+        }
+
+        public void Deactivate()
+        {
+            FocalLength = initialValue;
+            FocalSize = initialValue;
+            Aperture = initialValue;
+            MaxBlurSize = initialValue;
+            VisualizeFocus = false;
+            DepthOfField.enabled = false;
+            IsActive = false;
+        }
+
+        public void Reset()
+        {
+            DepthOfField.focalLength = initialValue;
+            DepthOfField.focalSize = initialValue;
+            DepthOfField.aperture = initialValue;
+            DepthOfField.maxBlurSize = initialValue;
+        }
+
+        public void SetEffectActive(bool active)
+        {
+            DepthOfField.enabled = active;
+            this.IsActive = active;
+            if (this.IsActive)
+            {
+                DepthOfField.focalLength = FocalLength;
+                DepthOfField.focalSize = FocalSize;
+                DepthOfField.aperture = Aperture;
+                DepthOfField.maxBlurSize = MaxBlurSize;
+            }
+            else Reset();
+        }
+
+        public void Update() { }
+    }
+}

+ 124 - 0
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Managers/EffectManagers/FogEffectManager.cs

@@ -0,0 +1,124 @@
+using UnityEngine;
+
+namespace COM3D2.MeidoPhotoStudio.Plugin
+{
+    internal class FogEffectManager : IEffectManager
+    {
+        private GlobalFog Fog { get; set; }
+        public bool IsReady { get; private set; }
+        public bool IsActive { get; private set; }
+        public static float InitialDistance { get; private set; } = 4f;
+        public static float InitialDensity { get; private set; } = 1f;
+        public static float InitialHeightScale { get; private set; } = 1f;
+        public static float InitialHeight { get; private set; } = 0f;
+        public static Color InitialColour { get; private set; } = Color.white;
+        private float distance;
+        public float Distance
+        {
+            get => distance;
+            set => distance = Fog.startDistance = value;
+        }
+        private float density;
+        public float Density
+        {
+            get => density;
+            set => density = Fog.globalDensity = value;
+        }
+        private float heightScale;
+        public float HeightScale
+        {
+            get => heightScale;
+            set => heightScale = Fog.heightScale = value;
+        }
+        private float height;
+        public float Height
+        {
+            get => height;
+            set => height = Fog.height = value;
+        }
+        public float FogColourRed
+        {
+            get => FogColour.r;
+            set
+            {
+                Color fogColour = FogColour;
+                FogColour = new Color(value, fogColour.g, fogColour.b);
+            }
+        }
+        public float FogColourGreen
+        {
+            get => FogColour.g;
+            set
+            {
+                Color fogColour = FogColour;
+                FogColour = new Color(fogColour.r, value, fogColour.b);
+            }
+        }
+        public float FogColourBlue
+        {
+            get => FogColour.b;
+            set
+            {
+                Color fogColour = FogColour;
+                FogColour = new Color(fogColour.r, fogColour.g, value);
+            }
+        }
+        private Color fogColour;
+        public Color FogColour
+        {
+            get => fogColour;
+            set => fogColour = Fog.globalFogColor = value;
+        }
+
+        public void Activate()
+        {
+            if (Fog == null)
+            {
+                Fog = GameMain.Instance.MainCamera.GetOrAddComponent<GlobalFog>();
+                if (Fog.fogShader == null) Fog.fogShader = Shader.Find("Hidden/GlobalFog");
+                Distance = InitialDistance;
+                Density = InitialDensity;
+                HeightScale = InitialHeightScale;
+                Height = InitialHeight;
+                FogColour = InitialColour;
+            }
+        }
+
+        public void Deactivate()
+        {
+            Distance = InitialDistance;
+            Density = InitialDensity;
+            HeightScale = InitialHeightScale;
+            Height = InitialHeight;
+            FogColour = InitialColour;
+            Fog.enabled = false;
+            IsActive = false;
+        }
+
+        public void Reset()
+        {
+            Fog.startDistance = InitialDistance;
+            Fog.globalDensity = InitialDensity;
+            Fog.heightScale = InitialHeightScale;
+            Fog.height = InitialHeight;
+            Fog.globalFogColor = InitialColour;
+        }
+
+        public void SetEffectActive(bool active)
+        {
+            Fog.enabled = active;
+            this.IsActive = active;
+            if (this.IsActive)
+            {
+                Fog.startDistance = Distance;
+                Fog.globalDensity = Density;
+                Fog.heightScale = HeightScale;
+                Fog.height = Height;
+                Fog.globalFogColor = FogColour;
+            }
+            else Reset();
+        }
+
+        public void Update() { }
+    }
+}

+ 13 - 0
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Managers/EffectManagers/IEffectManager.cs

@@ -0,0 +1,13 @@
+namespace COM3D2.MeidoPhotoStudio.Plugin
+{
+    internal interface IEffectManager
+    {
+        bool IsReady { get; }
+        bool IsActive { get; }
+        void Activate();
+        void Deactivate();
+        void SetEffectActive(bool active);
+        void Reset();
+        void Update();
+    }
+}

+ 88 - 0
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Managers/EffectManagers/VignetteEffectManager.cs

@@ -0,0 +1,88 @@
+using UnityEngine;
+
+namespace COM3D2.MeidoPhotoStudio.Plugin
+{
+    internal class VignetteEffectManager : IEffectManager
+    {
+        private Vignetting Vignette { get; set; }
+        private float initialIntensity;
+        private float initialBlur;
+        private float initialBlurSpread;
+        private float initialChromaticAberration;
+        public bool IsReady { get; private set; }
+        public bool IsActive { get; private set; }
+        private float intensity;
+        public float Intensity
+        {
+            get => intensity;
+            set => intensity = Vignette.intensity = value;
+        }
+        private float blur;
+        public float Blur
+        {
+            get => blur;
+            set => blur = Vignette.blur = value;
+        }
+        private float blurSpread;
+        public float BlurSpread
+        {
+            get => blurSpread;
+            set => blurSpread = Vignette.blurSpread = value;
+        }
+        private float chromaticAberration;
+        public float ChromaticAberration
+        {
+            get => chromaticAberration;
+            set => chromaticAberration = Vignette.chromaticAberration = value;
+        }
+
+        public void Activate()
+        {
+            if (Vignette == null)
+            {
+                IsReady = true;
+                Vignette = GameMain.Instance.MainCamera.GetOrAddComponent<Vignetting>();
+                Vignette.mode = Vignetting.AberrationMode.Simple;
+
+                initialIntensity = Vignette.intensity;
+                initialBlur = Vignette.blur;
+                initialBlurSpread = Vignette.blurSpread;
+                initialChromaticAberration = Vignette.chromaticAberration;
+            }
+        }
+
+        public void Deactivate()
+        {
+            Intensity = initialIntensity;
+            Blur = initialBlur;
+            BlurSpread = initialBlurSpread;
+            ChromaticAberration = initialChromaticAberration;
+            Vignette.enabled = false;
+            IsActive = false;
+        }
+
+        public void Reset()
+        {
+            Vignette.intensity = initialIntensity;
+            Vignette.blur = initialBlur;
+            Vignette.blurSpread = initialBlurSpread;
+            Vignette.chromaticAberration = initialChromaticAberration;
+        }
+
+        public void SetEffectActive(bool active)
+        {
+            Vignette.enabled = active;
+            IsActive = active;
+            if (this.IsActive)
+            {
+                Vignette.intensity = Intensity;
+                Vignette.blur = Blur;
+                Vignette.blurSpread = BlurSpread;
+                Vignette.chromaticAberration = ChromaticAberration;
+            }
+            else Reset();
+        }
+
+        public void Update() { }
+    }
+}

+ 13 - 6
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Managers/EnvironmentManager.cs

@@ -9,9 +9,9 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         private GameObject bgObject;
         private Transform bg;
         private CameraInfo cameraInfo;
-        public LightManager LightManager { get; set; }
-        public PropManager PropManager { get; set; }
-        public EffectManager EffectManager { get; set; }
+        public LightManager LightManager { get; }
+        public PropManager PropManager { get; }
+        public EffectManager EffectManager { get; }
         private bool bgVisible = true;
         public bool BGVisible
         {
@@ -23,6 +23,13 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             }
         }
 
+        public EnvironmentManager()
+        {
+            PropManager = new PropManager();
+            LightManager = new LightManager();
+            EffectManager = new EffectManager();
+        }
+
         public void Activate()
         {
             bgObject = GameObject.Find("__GameMain__/BG");
@@ -50,7 +57,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
             PropManager.Activate();
             LightManager.Activate();
-            // EffectManager.Activate();
+            EffectManager.Activate();
         }
 
         public void Deactivate()
@@ -60,7 +67,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
             PropManager.Deactivate();
             LightManager.Deactivate();
-            // EffectManager.Deactivate();
+            EffectManager.Deactivate();
 
             bool isNight = GameMain.Instance.CharacterMgr.status.GetFlag("時間帯") == 3;
 
@@ -101,7 +108,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
             PropManager.Update();
             LightManager.Update();
-            // EffectManager.Update();
+            EffectManager.Update();
         }
 
         public void ChangeBackground(string assetName, bool creative = false)

+ 1 - 11
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/MeidoPhotoStudio.cs

@@ -17,9 +17,6 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         private WindowManager windowManager;
         private MeidoManager meidoManager;
         private EnvironmentManager environmentManager;
-        private PropManager propManager;
-        private LightManager lightManager;
-        // private EffectManager effectManager;
         private MessageWindowManager messageWindowManager;
         private Constants.Scene currentScene;
         private bool initialized = false;
@@ -143,14 +140,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             initialized = true;
 
             meidoManager = new MeidoManager();
-            propManager = new PropManager();
-            lightManager = new LightManager();
-            environmentManager = new EnvironmentManager()
-            {
-                PropManager = propManager,
-                LightManager = lightManager
-            };
-
+            environmentManager = new EnvironmentManager();
             messageWindowManager = new MessageWindowManager();
 
             MaidSwitcherPane maidSwitcherPane = new MaidSwitcherPane(meidoManager);