Files
Main/Assets/Editor/External/AmplifyBloom/AmplifyBloomEffectEditorBase.cs
2025-01-25 04:38:09 +08:00

677 lines
39 KiB
C#

using System;
using UnityEditor;
using UnityEngine;
namespace AmplifyBloom
{
[Serializable]
public class AmplifyBloomEffectEditorBase : Editor
{
private const string IntensityStr = "Intensity";
private const string AdvancedSettingsStr = "Advanced Settings";
private Rect TemporalCurveRanges = new Rect(0f, 0f, 1f, 0.999f);
private Color TemporalCurveColor = new Color(0f, 1f, 0f, 1f);
[SerializeField]
private bool m_bokehAdvancedSettingsFoldout;
[SerializeField]
private bool m_ghostsAdvancedSettingsFoldout;
[SerializeField]
private bool m_haloAdvancedSettingsFoldout;
[SerializeField]
private bool m_lensGlareAdvancedSettingsFoldout;
[SerializeField]
private bool m_bloomFoldout = true;
[SerializeField]
private bool m_temporalFilterFoldout;
[SerializeField]
private bool m_featuresFoldout;
[SerializeField]
private bool m_bokehFilterFoldout;
[SerializeField]
private bool m_lensFlareFoldout;
[SerializeField]
private bool m_ghostsFoldout;
[SerializeField]
private bool m_haloFoldout;
[SerializeField]
private bool m_lensGlareFoldout;
[SerializeField]
private bool m_lensDirtFoldout;
[SerializeField]
private bool m_lensStarburstFoldout;
[SerializeField]
private bool m_mipSettingsFoldout;
[SerializeField]
private bool m_lensDirtWeightsFoldout;
[SerializeField]
private bool m_lensStarburstWeightsFoldout;
[SerializeField]
private bool m_bloomWeightsFoldout;
private GUIStyle m_mainFoldoutStyle;
private GUIContent m_highPrecisionGC = new GUIContent("Precision", "Switch between HDR and LDR Render Texture formats.");
private GUIContent m_debugToScreenGC = new GUIContent("Debug", "Debug each bloom/feature stage to screen.");
private GUIContent m_ldrRangeGC = new GUIContent("Range", "LDR Tweakable range. Use to match HDR results.");
private GUIContent m_overallIntensityGC = new GUIContent("Intensity", "Overall bloom intensity. Affects all the effects bellow.");
private GUIContent m_thresholdGC = new GUIContent("Threshold", "Luminance threshold to setup what should generate bloom.");
private GUIContent m_blurStepGC = new GUIContent("Blur Step", "Number of blur passes done on bloom results. Higher number provides smoother results but decreases performance.");
private GUIContent m_blurRadiusGC = new GUIContent("Blur Radius", "Blur radius amount");
private GUIContent m_upscaleWeightGC = new GUIContent("Weight", "Influence of the selected Mip. Only valid when Mip Amount greater than 0.");
private GUIContent m_featuresSourceIdGC = new GUIContent("Features Source Id", "Mip source which will be used to generate features.");
private GUIContent m_upscaleQualityGC = new GUIContent("Technique", "Method which will be used to upscale results. Realistic is visually more robust but less efficient.");
private GUIContent m_downscaleAmountGC = new GUIContent("Mip Count", "Number of resizes done on main RT before performing bloom. Increasing its the number provides finer tweaking but at the loss at performance.");
private GUIContent m_upscaleScaleRadiusGC = new GUIContent("Upscale Blur Radius", "Radius used on the tent filter when upscaling to source size.");
private GUIContent m_filterCurveGC = new GUIContent("Filter Curve", "Range of values which defines temporal filter behaviour.");
private GUIContent m_filterValueGC = new GUIContent("Filter Value", "Position on the filter curve.");
private GUIContent m_separateThresholdGC = new GUIContent("Threshold", "Threshold value for second threshold layer.");
private GUIContent m_bokehApplyOnBloomSourceGC = new GUIContent("Apply on Bloom Source", "Bokeh filtering can either be applied on the bloom source and visually affect it or only affect features (lens flare/glare/dirt/starburst).");
private GUIContent m_bokehApertureShapeGC = new GUIContent("Aperture Shape", "Type of bokeh filter which will reshape bloom results.");
private GUIContent m_bokehSampleRadiusGC = new GUIContent("Sample Radius", "Bokeh imaginary camera DOF's radius.");
private GUIContent m_bokehRotationGC = new GUIContent("Rotation", "Filter overall rotation.");
private GUIContent m_bokehApertureGC = new GUIContent("Aperture", "Bokeh imaginary camera DOF's aperture.");
private GUIContent m_bokehFocalLengthGC = new GUIContent("Focal Length", "Bokeh imaginary camera DOF's focal length.");
private GUIContent m_bokehFocalDistanceGC = new GUIContent("Focal Distance", "Bokeh imaginary camera DOF's focal distance.");
private GUIContent m_bokehMaxCoCDiameterGC = new GUIContent("Max CoC Diameter", "Bokeh imaginary camera DOF's Max Circle of Confusion diameter.");
private GUIContent m_lensFlareIntensityGC = new GUIContent("Intensity", "Overall intensity for both halo and ghosts.");
private GUIContent m_lensFlareBlurAmountGC = new GUIContent("Blur amount", "Amount of blur applied on generated halo and ghosts.");
private GUIContent m_lensFlareRadialTintGC = new GUIContent("Radial Tint", "Dynamic tint color applied to halo and ghosts according to its screen position. Left most color on gradient corresponds to screen center.");
private GUIContent m_lensFlareGhostsInstensityGC = new GUIContent("Intensity", "Ghosts intensity.");
private GUIContent m_lensFlareGhostAmountGC = new GUIContent("Count", "Amount of ghosts generated from each bloom area.");
private GUIContent m_lensFlareGhostDispersalGC = new GUIContent("Dispersal", "Distance between ghost generated from the same bloom area.");
private GUIContent m_lensFlareGhostChrmDistortGC = new GUIContent("Chromatic Distortion", "Amount of chromatic distortion applied on each ghost.");
private GUIContent m_lensFlareGhostPowerFactorGC = new GUIContent("Power Factor", "Base on ghost fade power function.");
private GUIContent m_lensFlareGhostPowerFalloffGC = new GUIContent("Power Falloff", "Exponent on ghost fade power function.");
private GUIContent m_lensFlareHalosIntensityGC = new GUIContent("Intensity", "Halo intensity.");
private GUIContent m_lensFlareHaloWidthGC = new GUIContent("Width", "Width/Radius of the generated halo.");
private GUIContent m_lensFlareHaloChrmDistGC = new GUIContent("Chromatic Distortion", "Amount of chromatic distortion applied on halo.");
private GUIContent m_lensFlareHaloPowerFactorGC = new GUIContent("Power Factor", "Base on halo fade power function.");
private GUIContent m_lensFlareHaloPowerFalloffGC = new GUIContent("Power Falloff", "Exponent on halo fade power function.");
private GUIContent m_lensGlareIntensityGC = new GUIContent("Intensity", "Lens Glare intensity.");
private GUIContent m_lensGlareOverallStreakScaleGC = new GUIContent("Streak Scale", "Overall glare streak length modifier.");
private GUIContent m_lensGlareOverallTintGC = new GUIContent("Overall Tint", "Tint applied uniformly across each type of glare.");
private GUIContent m_lensGlareTypeGC = new GUIContent("Type", "Type of glare.");
private GUIContent m_lensGlareTintAlongGlareGC = new GUIContent("Tint Along Glare", "Tint for spectral types along each ray.Leftmost color on the gradient corresponds to sample near bloom source.");
private GUIContent m_lensGlarePerPassDispGC = new GUIContent("Per Pass Displacement", "Distance between samples when creating each ray.");
private GUIContent m_lensGlareMaxPerRayGC = new GUIContent("Max Per Ray Passes", "Max amount of passes used to build each ray. More passes means more defined and propagated rays but decreases performance.");
private GUIContent m_lensDirtIntensityGC = new GUIContent("Intensity", "Lens Dirt Intensity.");
private GUIContent m_lensDirtTextureGC = new GUIContent("Dirt Texture", "Mask from which dirt is going to be created.");
private GUIContent m_lensStarburstIntensityGC = new GUIContent("Intensity", "Lens Starburst Intensity.");
private GUIContent m_lensStarburstTextureGC = new GUIContent("Starburst Texture", "Mask from which starburst is going to be created.");
private GUIContent m_bloomFoldoutGC = new GUIContent(" Bloom", "Settings for bloom generation, will affect all features.");
private GUIContent m_bokehFilterFoldoutGC = new GUIContent(" Bokeh Filter", "Settings for Bokeh filter generation.");
private GUIContent m_lensFlareFoldoutGC = new GUIContent(" Lens Flare", "Overall settings for Lens Flare (Halo/Ghosts) generation.");
private GUIContent m_ghostsFoldoutGC = new GUIContent("Ghosts", "Settings for Ghosts generation.");
private GUIContent m_halosFoldoutGC = new GUIContent("Halo", "Settings for Halo generation.");
private GUIContent m_lensGlareFoldoutGC = new GUIContent(" Lens Glare", "Settings for Anamorphic Lens Glare generation.");
private GUIContent m_lensDirtFoldoutGC = new GUIContent(" Lens Dirt", "Settings for Lens Dirt composition.");
private GUIContent m_lensStarburstFoldoutGC = new GUIContent(" Lens Starburst", "Settings for Lens Starburts composition.");
private GUIContent m_temporalFilterFoldoutGC = new GUIContent(" Temporal Filter", "Settings for temporal filtering configuration.");
private GUIContent m_sepFeaturesThresholdFoldoutGC = new GUIContent(" Features Threshold", "Settings for features threshold.");
private GUIContent m_advancedSettingsBokehFoldoutGC = new GUIContent("Advanced Settings", "Advanced settings for Bokeh filter.");
private GUIContent m_advancedSettingsGhostsFoldoutGC = new GUIContent("Advanced Settings", "Advanced settings for Ghosts.");
private GUIContent m_advancedSettingsHalosFoldoutGC = new GUIContent("Advanced Settings", "Advanced settings for Halo.");
private GUIContent m_advancedSettingsLensGlareFoldoutGC = new GUIContent("Advanced Settings", "Advanced settings for Lens Glare.");
private GUIContent m_customGlareIdxGC = new GUIContent("Current", "Current selected custom glare from array bellow.");
private GUIContent m_customGlareSizeGC = new GUIContent("Size", "Amount of customizable glare definitions.");
private GUIContent m_customGlareNameGC = new GUIContent("Name", "Custom glare name.");
private GUIContent m_customGlareStarInclinationGC = new GUIContent("Initial Offset", "Star angle initial offset.");
private GUIContent m_customGlareChromaticAberrationGC = new GUIContent("Chromatic Amount", "Amount of influence from chromatic gradient.");
private GUIContent m_customGlareStarlinesCountGC = new GUIContent("Star Lines Count", "Amount of generated rays.");
private GUIContent m_customGlarePassCountGC = new GUIContent("Pass Count", "Amount of passes used to generate rays.");
private GUIContent m_customGlareSampleLengthGC = new GUIContent("Sample Length", "Spacing between each sample when generating rays.");
private GUIContent m_customGlareAttenuationGC = new GUIContent("Attenuation", "Attenuation factor along ray.");
private GUIContent m_customGlareRotationGC = new GUIContent("Camera Influence", "Amount of influence camera rotation has on rays.");
private GUIContent m_customGlareCustomIncrementGC = new GUIContent("Custom Increment", "Custom angle increment between rays. They will be evenly rotated if specified a value equal to 0.");
private GUIContent m_customGlareLongAttenuationGC = new GUIContent("Long Attenuation", "Second attenuation factor. Rays will alternate between Attenuation ( Odd numbers) and Long Attenuation ( Even numbers). Only active if specified value is greater than 0.");
private GUIContent m_customGlareFoldoutGC = new GUIContent("Custom Label", "Properties for hovered custom glare.");
private GUIContent m_mipSettingGC = new GUIContent("Mip Settings", "Configurable settings for each mip");
private GUIContent m_lensWeightsFoldoutGC = new GUIContent("Mip Weights", "Each mip contribution to the Lens Dirt and Starburts feature.");
private GUIContent m_lensWeightGC = new GUIContent("Mip ", "Influence of the selected Mip. Only valid when Mip Amount greater than 0.");
private GUIContent[] m_lensWeightGCArr;
private GUIContent m_bloomWeightsFoldoutGC = new GUIContent("Mip Weights", "Each mip contribution to Bloom.");
private GUIContent m_showDebugMessagesGC = new GUIContent("Show Warnings", "Show relevant Amplify Bloom Warnings to Console.");
private GUIContent m_mainThresholdSizeGC = new GUIContent("Source Downscale", "Initial render texture scale on which the Main Threshold will be written.");
private GUIContent m_targetTextureGC = new GUIContent("Target Texture", "Render Bloom to a render texture instead of destination");
private GUIContent m_maskTextureGC = new GUIContent("Mask Texture", "Render Bloom only on certain areas specifed by mask.");
private GUIStyle m_foldoutClosed;
private GUIStyle m_foldoutOpened;
private GUIStyle m_toggleStyle;
private GUIStyle m_mainLabelStyle;
private GUIStyle m_disabledToggleStyle;
private GUIContent[] m_bloomWeightsLabelGCArr;
private void Awake()
{
this.m_bloomWeightsLabelGCArr = new GUIContent[6];
for (int i = 0; i < this.m_bloomWeightsLabelGCArr.Length; i++)
{
this.m_bloomWeightsLabelGCArr[i] = new GUIContent("Mip " + (i + 1), this.m_bloomWeightsFoldoutGC.tooltip);
}
this.m_mainLabelStyle = new GUIStyle(EditorStyles.label);
this.m_mainLabelStyle.fontStyle = (FontStyle)1;
this.m_disabledToggleStyle = new GUIStyle(EditorStyles.toggle);
this.m_disabledToggleStyle.normal = this.m_disabledToggleStyle.onActive;
this.m_foldoutClosed = new GUIStyle(EditorStyles.foldout);
this.m_foldoutClosed.fontStyle = (FontStyle)1;
this.m_foldoutOpened = new GUIStyle(EditorStyles.foldout);
this.m_foldoutOpened.normal = this.m_foldoutOpened.onActive;
this.m_foldoutOpened.fontStyle = (FontStyle)1;
this.m_mainFoldoutStyle = new GUIStyle(EditorStyles.foldout);
this.m_mainFoldoutStyle.fontStyle = (FontStyle)1;
this.m_toggleStyle = new GUIStyle(EditorStyles.toggle);
this.m_toggleStyle.fontStyle = (FontStyle)1;
this.m_lensWeightGCArr = new GUIContent[6];
for (int j = 0; j < this.m_lensWeightGCArr.Length; j++)
{
this.m_lensWeightGCArr[j] = new GUIContent(this.m_lensWeightGC);
GUIContent expr_13C = this.m_lensWeightGCArr[j];
expr_13C.text = expr_13C.text + (j + 1).ToString();
}
AmplifyBloomBase amplifyBloomBase = (AmplifyBloomBase)base.target;
if (amplifyBloomBase.LensDirtTexture == null)
{
amplifyBloomBase.LensDirtTexture = AssetDatabase.LoadAssetAtPath<Texture>("Assets/AmplifyBloom/Samples/Textures/Dirt/DirtHighContrast.png");
}
if (amplifyBloomBase.LensStardurstTex == null)
{
amplifyBloomBase.LensStardurstTex = AssetDatabase.LoadAssetAtPath<Texture>("Assets/AmplifyBloom/Samples/Textures/Starburst/Starburst.png");
}
}
private bool CustomFoldout(bool value, GUIContent content, int space = 4)
{
GUIStyle gUIStyle = value ? this.m_foldoutOpened : this.m_foldoutClosed;
this.m_mainLabelStyle.fontStyle = (FontStyle)0;
EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
GUILayout.Space((float)space);
if (GUILayout.Button(string.Empty, gUIStyle, new GUILayoutOption[]
{
GUILayout.Width(10f)
}))
{
value = !value;
}
if (GUILayout.Button(content, this.m_mainLabelStyle, new GUILayoutOption[0]))
{
value = !value;
}
EditorGUILayout.EndHorizontal();
return value;
}
private void ToggleFoldout(GUIContent content, ref bool foldoutValue, ref bool toggleValue, bool applyBold, int space = -8, bool specialToggle = false)
{
GUIStyle gUIStyle = foldoutValue ? this.m_foldoutOpened : this.m_foldoutClosed;
GUIStyle arg_2A_0 = this.m_toggleStyle;
FontStyle fontStyle;
gUIStyle.fontStyle = (fontStyle = (applyBold ? (FontStyle)1 : (FontStyle)0));
arg_2A_0.fontStyle = fontStyle;
this.m_mainLabelStyle.fontStyle = this.m_toggleStyle.fontStyle;
EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
GUILayout.Space((float)space);
if (GUILayout.Button(string.Empty, gUIStyle, new GUILayoutOption[]
{
GUILayout.Width(10f)
}))
{
foldoutValue = !foldoutValue;
}
if (specialToggle)
{
GUI.enabled = false;
GUILayout.Button(string.Empty, this.m_disabledToggleStyle, new GUILayoutOption[]
{
GUILayout.Width(10f)
});
GUI.enabled = true;
}
else
{
toggleValue = GUILayout.Toggle(toggleValue, content, this.m_toggleStyle, new GUILayoutOption[]
{
GUILayout.Width(10f)
});
}
if (GUILayout.Button(content, this.m_mainLabelStyle, new GUILayoutOption[0]))
{
foldoutValue = !foldoutValue;
}
EditorGUILayout.EndHorizontal();
}
public override void OnInspectorGUI()
{
Undo.RecordObject(base.target, "AmplifyBloomInspector");
AmplifyBloomBase amplifyBloomBase = (AmplifyBloomBase)base.target;
SerializedObject serializedObject = new SerializedObject(amplifyBloomBase);
GUILayout.BeginVertical(new GUILayoutOption[0]);
EditorGUI.BeginChangeCheck();
EditorGUILayout.Separator();
bool flag = true;
this.ToggleFoldout(this.m_bloomFoldoutGC, ref this.m_bloomFoldout, ref flag, true, -8, true);
if (this.m_bloomFoldout)
{
amplifyBloomBase.UpscaleQuality=((UpscaleQualityEnum)EditorGUILayout.EnumPopup(this.m_upscaleQualityGC, amplifyBloomBase.UpscaleQuality, new GUILayoutOption[0]));
amplifyBloomBase.MainThresholdSize=((MainThresholdSizeEnum)EditorGUILayout.EnumPopup(this.m_mainThresholdSizeGC, amplifyBloomBase.MainThresholdSize, new GUILayoutOption[0]));
GUILayout.BeginHorizontal(new GUILayoutOption[0]);
float labelWidth = EditorGUIUtility.labelWidth;
amplifyBloomBase.CurrentPrecisionMode=((PrecisionModes)EditorGUILayout.EnumPopup(this.m_highPrecisionGC, amplifyBloomBase.CurrentPrecisionMode, new GUILayoutOption[0]));
GUI.enabled=(!amplifyBloomBase.HighPrecision);
EditorGUIUtility.labelWidth=(45f);
amplifyBloomBase.BloomRange=(EditorGUILayout.FloatField(this.m_ldrRangeGC, amplifyBloomBase.BloomRange, new GUILayoutOption[]
{
GUILayout.MaxWidth(1300f)
}));
EditorGUIUtility.labelWidth=(labelWidth);
GUI.enabled = true;
GUILayout.EndHorizontal();
amplifyBloomBase.OverallIntensity=(EditorGUILayout.FloatField(this.m_overallIntensityGC, amplifyBloomBase.OverallIntensity, new GUILayoutOption[0]));
amplifyBloomBase.OverallThreshold=(EditorGUILayout.FloatField(this.m_thresholdGC, amplifyBloomBase.OverallThreshold, new GUILayoutOption[0]));
SerializedProperty arg_18E_0 = serializedObject.FindProperty("m_maskTexture");
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(arg_18E_0, this.m_maskTextureGC, new GUILayoutOption[0]);
if (EditorGUI.EndChangeCheck())
{
serializedObject.ApplyModifiedProperties();
}
SerializedProperty arg_1BE_0 = serializedObject.FindProperty("m_targetTexture");
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(arg_1BE_0, this.m_targetTextureGC, new GUILayoutOption[0]);
if (EditorGUI.EndChangeCheck())
{
serializedObject.ApplyModifiedProperties();
}
amplifyBloomBase.DebugToScreen = ((DebugToScreenEnum)EditorGUILayout.EnumPopup(this.m_debugToScreenGC, amplifyBloomBase.DebugToScreen, new GUILayoutOption[0]));
amplifyBloomBase.ShowDebugMessages = (EditorGUILayout.Toggle(this.m_showDebugMessagesGC, amplifyBloomBase.ShowDebugMessages, new GUILayoutOption[0]));
int num = Mathf.Max(1, amplifyBloomBase.BloomDownsampleCount);
EditorGUI.indentLevel = (EditorGUI.indentLevel + 1);
this.m_mipSettingsFoldout = this.CustomFoldout(this.m_mipSettingsFoldout, this.m_mipSettingGC, 4);
if (this.m_mipSettingsFoldout)
{
EditorGUI.indentLevel = (EditorGUI.indentLevel + 1);
amplifyBloomBase.BloomDownsampleCount=(EditorGUILayout.IntSlider(this.m_downscaleAmountGC, amplifyBloomBase.BloomDownsampleCount, 1, amplifyBloomBase.SoftMaxdownscales, new GUILayoutOption[0]));
bool flag2 = amplifyBloomBase.BloomDownsampleCount != 0;
GUI.enabled=(amplifyBloomBase.UpscaleQuality == 0 & flag2);
amplifyBloomBase.UpscaleBlurRadius = (EditorGUILayout.Slider(this.m_upscaleScaleRadiusGC, amplifyBloomBase.UpscaleBlurRadius, 1f, 3f, new GUILayoutOption[0]));
GUI.enabled=(flag2);
int num2 = amplifyBloomBase.FeaturesSourceId + 1;
num2 = EditorGUILayout.IntSlider(this.m_featuresSourceIdGC, num2, 1, amplifyBloomBase.BloomDownsampleCount, new GUILayoutOption[0]);
amplifyBloomBase.FeaturesSourceId=(num2 - 1);
EditorGUI.indentLevel = (EditorGUI.indentLevel - 1);
}
GUI.enabled = true;
this.m_bloomWeightsFoldout = this.CustomFoldout(this.m_bloomWeightsFoldout, this.m_bloomWeightsFoldoutGC, 4);
if (this.m_bloomWeightsFoldout)
{
EditorGUI.indentLevel =EditorGUI.indentLevel + 1;
float num3 = 15f;
float num4 = 15f;
float num5 = 25f;
GUILayout.BeginHorizontal(new GUILayoutOption[0]);
GUILayout.Space(41f);
EditorGUILayout.LabelField(this.m_blurStepGC, new GUILayoutOption[]
{
GUILayout.MinWidth(num3)
});
GUILayout.Space(-26f);
EditorGUILayout.LabelField(this.m_blurRadiusGC, new GUILayoutOption[]
{
GUILayout.MinWidth(num4)
});
GUILayout.Space(-27f);
EditorGUILayout.LabelField(this.m_upscaleWeightGC, new GUILayoutOption[]
{
GUILayout.MinWidth(num5)
});
GUILayout.EndHorizontal();
for (int i = 0; i < num; i++)
{
GUILayout.BeginHorizontal(new GUILayoutOption[0]);
EditorGUILayout.LabelField(this.m_bloomWeightsLabelGCArr[i], new GUILayoutOption[]
{
GUILayout.Width(65f)
});
GUILayout.Space(-30f);
amplifyBloomBase.GaussianSteps[i] = EditorGUILayout.IntField(string.Empty, amplifyBloomBase.GaussianSteps[i], new GUILayoutOption[]
{
GUILayout.MinWidth(num3)
});
amplifyBloomBase.GaussianSteps[i] = Mathf.Clamp(amplifyBloomBase.GaussianSteps[i], 0, 8);
GUILayout.Space(-27f);
amplifyBloomBase.GaussianRadius[i] = EditorGUILayout.FloatField(string.Empty, amplifyBloomBase.GaussianRadius[i], new GUILayoutOption[]
{
GUILayout.MinWidth(num4)
});
amplifyBloomBase.GaussianRadius[i] = Mathf.Max(amplifyBloomBase.GaussianRadius[i], 0f);
GUILayout.Space(-27f);
int num6 = num - 1 - i;
amplifyBloomBase.UpscaleWeights[num6] = EditorGUILayout.FloatField(string.Empty, amplifyBloomBase.UpscaleWeights[num6], new GUILayoutOption[]
{
GUILayout.MinWidth(num5)
});
amplifyBloomBase.UpscaleWeights[num6] = Mathf.Max(amplifyBloomBase.UpscaleWeights[num6], 0f);
GUILayout.EndHorizontal();
}
EditorGUI.indentLevel = (EditorGUI.indentLevel - 1);
}
GUI.enabled = true;
bool temporalFilteringActive = amplifyBloomBase.TemporalFilteringActive;
this.ToggleFoldout(this.m_temporalFilterFoldoutGC, ref this.m_temporalFilterFoldout, ref temporalFilteringActive, false, 4, false);
amplifyBloomBase.TemporalFilteringActive=(temporalFilteringActive);
if (this.m_temporalFilterFoldout)
{
GUI.enabled=(amplifyBloomBase.TemporalFilteringActive);
amplifyBloomBase.TemporalFilteringCurve=(EditorGUILayout.CurveField(this.m_filterCurveGC, amplifyBloomBase.TemporalFilteringCurve, this.TemporalCurveColor, this.TemporalCurveRanges, new GUILayoutOption[0]));
amplifyBloomBase.TemporalFilteringValue=(EditorGUILayout.Slider(this.m_filterValueGC, amplifyBloomBase.TemporalFilteringValue, 0.01f, 1f, new GUILayoutOption[0]));
GUI.enabled = true;
}
bool separateFeaturesThreshold = amplifyBloomBase.SeparateFeaturesThreshold;
this.ToggleFoldout(this.m_sepFeaturesThresholdFoldoutGC, ref this.m_featuresFoldout, ref separateFeaturesThreshold, false, 4, false);
amplifyBloomBase.SeparateFeaturesThreshold=(separateFeaturesThreshold);
if (this.m_featuresFoldout)
{
GUI.enabled=(amplifyBloomBase.SeparateFeaturesThreshold);
amplifyBloomBase.FeaturesThreshold = (EditorGUILayout.FloatField(this.m_separateThresholdGC, amplifyBloomBase.FeaturesThreshold, new GUILayoutOption[0]));
GUI.enabled = true;
}
EditorGUI.indentLevel = (EditorGUI.indentLevel - 1);
}
bool applyLensDirt = amplifyBloomBase.ApplyLensDirt;
this.ToggleFoldout(this.m_lensDirtFoldoutGC, ref this.m_lensDirtFoldout, ref applyLensDirt, true, -8, false);
amplifyBloomBase.ApplyLensDirt = (applyLensDirt);
if (this.m_lensDirtFoldout)
{
GUI.enabled=(amplifyBloomBase.ApplyLensDirt);
amplifyBloomBase.LensDirtStrength = (EditorGUILayout.FloatField(this.m_lensDirtIntensityGC, amplifyBloomBase.LensDirtStrength, new GUILayoutOption[0]));
EditorGUI.indentLevel = (EditorGUI.indentLevel + 1);
this.m_lensDirtWeightsFoldout = this.CustomFoldout(this.m_lensDirtWeightsFoldout, this.m_lensWeightsFoldoutGC, 4);
if (this.m_lensDirtWeightsFoldout)
{
for (int j = 0; j < amplifyBloomBase.BloomDownsampleCount; j++)
{
int num7 = amplifyBloomBase.BloomDownsampleCount - 1 - j;
amplifyBloomBase.LensDirtWeights[num7] = EditorGUILayout.FloatField(this.m_lensWeightGCArr[j], amplifyBloomBase.LensDirtWeights[num7], new GUILayoutOption[0]);
amplifyBloomBase.LensDirtWeights[num7] = Mathf.Max(amplifyBloomBase.LensDirtWeights[num7], 0f);
}
}
EditorGUI.indentLevel = (EditorGUI.indentLevel - 1);
amplifyBloomBase.LensDirtTexture = (EditorGUILayout.ObjectField(this.m_lensDirtTextureGC, amplifyBloomBase.LensDirtTexture, typeof(Texture), false, new GUILayoutOption[0]) as Texture);
GUI.enabled = true;
}
bool applyLensStardurst = amplifyBloomBase.ApplyLensStardurst;
this.ToggleFoldout(this.m_lensStarburstFoldoutGC, ref this.m_lensStarburstFoldout, ref applyLensStardurst, true, -8, false);
amplifyBloomBase.ApplyLensStardurst = (applyLensStardurst);
if (this.m_lensStarburstFoldout)
{
GUI.enabled=(amplifyBloomBase.ApplyLensStardurst);
amplifyBloomBase.LensStarburstStrength = (EditorGUILayout.FloatField(this.m_lensStarburstIntensityGC, amplifyBloomBase.LensStarburstStrength, new GUILayoutOption[0]));
EditorGUI.indentLevel = (EditorGUI.indentLevel + 1);
this.m_lensStarburstWeightsFoldout = this.CustomFoldout(this.m_lensStarburstWeightsFoldout, this.m_lensWeightsFoldoutGC, 4);
if (this.m_lensStarburstWeightsFoldout)
{
for (int k = 0; k < amplifyBloomBase.BloomDownsampleCount; k++)
{
int num8 = amplifyBloomBase.BloomDownsampleCount - 1 - k;
amplifyBloomBase.LensStarburstWeights[num8] = EditorGUILayout.FloatField(this.m_lensWeightGCArr[k], amplifyBloomBase.LensStarburstWeights[num8], new GUILayoutOption[0]);
amplifyBloomBase.LensStarburstWeights[num8] = Mathf.Max(amplifyBloomBase.LensStarburstWeights[num8], 0f);
}
}
EditorGUI.indentLevel = (EditorGUI.indentLevel - 1);
amplifyBloomBase.LensStardurstTex = (EditorGUILayout.ObjectField(this.m_lensStarburstTextureGC, amplifyBloomBase.LensStardurstTex, typeof(Texture), false, new GUILayoutOption[0]) as Texture);
GUI.enabled = true;
}
bool applyBokeh = amplifyBloomBase.BokehFilterInstance.ApplyBokeh;
this.ToggleFoldout(this.m_bokehFilterFoldoutGC, ref this.m_bokehFilterFoldout, ref applyBokeh, true, -8, false);
amplifyBloomBase.BokehFilterInstance.ApplyBokeh = (applyBokeh);
if (this.m_bokehFilterFoldout)
{
GUI.enabled=(amplifyBloomBase.BokehFilterInstance.ApplyBokeh);
amplifyBloomBase.BokehFilterInstance.ApplyOnBloomSource=(EditorGUILayout.Toggle(this.m_bokehApplyOnBloomSourceGC, amplifyBloomBase.BokehFilterInstance.ApplyOnBloomSource, new GUILayoutOption[0]));
amplifyBloomBase.BokehFilterInstance.ApertureShape=((ApertureShape)EditorGUILayout.EnumPopup(this.m_bokehApertureShapeGC, amplifyBloomBase.BokehFilterInstance.ApertureShape, new GUILayoutOption[0]));
EditorGUI.indentLevel = (EditorGUI.indentLevel + 1);
this.m_bokehAdvancedSettingsFoldout = this.CustomFoldout(this.m_bokehAdvancedSettingsFoldout, this.m_advancedSettingsBokehFoldoutGC, 4);
if (this.m_bokehAdvancedSettingsFoldout)
{
amplifyBloomBase.BokehFilterInstance.OffsetRotation=(EditorGUILayout.Slider(this.m_bokehRotationGC, amplifyBloomBase.BokehFilterInstance.OffsetRotation, 0f, 360f, new GUILayoutOption[0]));
amplifyBloomBase.BokehFilterInstance.BokehSampleRadius=(EditorGUILayout.Slider(this.m_bokehSampleRadiusGC, amplifyBloomBase.BokehFilterInstance.BokehSampleRadius, 0.01f, 1f, new GUILayoutOption[0]));
amplifyBloomBase.BokehFilterInstance.Aperture=(EditorGUILayout.Slider(this.m_bokehApertureGC, amplifyBloomBase.BokehFilterInstance.Aperture, 0.01f, 0.05f, new GUILayoutOption[0]));
amplifyBloomBase.BokehFilterInstance.FocalLength=(EditorGUILayout.Slider(this.m_bokehFocalLengthGC, amplifyBloomBase.BokehFilterInstance.FocalLength, 0.018f, 0.055f, new GUILayoutOption[0]));
amplifyBloomBase.BokehFilterInstance.FocalDistance=(EditorGUILayout.Slider(this.m_bokehFocalDistanceGC, amplifyBloomBase.BokehFilterInstance.FocalDistance, 0.055f, 3f, new GUILayoutOption[0]));
amplifyBloomBase.BokehFilterInstance.MaxCoCDiameter=(EditorGUILayout.Slider(this.m_bokehMaxCoCDiameterGC, amplifyBloomBase.BokehFilterInstance.MaxCoCDiameter, 0f, 2f, new GUILayoutOption[0]));
}
EditorGUI.indentLevel = (EditorGUI.indentLevel - 1);
GUI.enabled = true;
}
bool applyLensFlare = amplifyBloomBase.LensFlareInstance.ApplyLensFlare;
this.ToggleFoldout(this.m_lensFlareFoldoutGC, ref this.m_lensFlareFoldout, ref applyLensFlare, true, -8, false);
amplifyBloomBase.LensFlareInstance.ApplyLensFlare=(applyLensFlare);
if (this.m_lensFlareFoldout)
{
GUI.enabled=(amplifyBloomBase.LensFlareInstance.ApplyLensFlare);
amplifyBloomBase.LensFlareInstance.OverallIntensity=(EditorGUILayout.FloatField(this.m_lensFlareIntensityGC, amplifyBloomBase.LensFlareInstance.OverallIntensity, new GUILayoutOption[0]));
amplifyBloomBase.LensFlareInstance.LensFlareGaussianBlurAmount=(EditorGUILayout.IntSlider(this.m_lensFlareBlurAmountGC, amplifyBloomBase.LensFlareInstance.LensFlareGaussianBlurAmount, 0, 3, new GUILayoutOption[0]));
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_lensFlare.m_lensGradient"), this.m_lensFlareRadialTintGC, new GUILayoutOption[0]);
if (EditorGUI.EndChangeCheck())
{
serializedObject.ApplyModifiedProperties();
amplifyBloomBase.LensFlareInstance.TextureFromGradient();
}
EditorGUI.indentLevel = (EditorGUI.indentLevel + 1);
this.m_ghostsFoldout = this.CustomFoldout(this.m_ghostsFoldout, this.m_ghostsFoldoutGC, 4);
if (this.m_ghostsFoldout)
{
amplifyBloomBase.LensFlareInstance.LensFlareNormalizedGhostsIntensity=(EditorGUILayout.FloatField(this.m_lensFlareGhostsInstensityGC, amplifyBloomBase.LensFlareInstance.LensFlareNormalizedGhostsIntensity, new GUILayoutOption[0]));
amplifyBloomBase.LensFlareInstance.LensFlareGhostAmount=(EditorGUILayout.IntSlider(this.m_lensFlareGhostAmountGC, amplifyBloomBase.LensFlareInstance.LensFlareGhostAmount, 0, 5, new GUILayoutOption[0]));
amplifyBloomBase.LensFlareInstance.LensFlareGhostsDispersal=(EditorGUILayout.Slider(this.m_lensFlareGhostDispersalGC, amplifyBloomBase.LensFlareInstance.LensFlareGhostsDispersal, 0.01f, 1f, new GUILayoutOption[0]));
amplifyBloomBase.LensFlareInstance.LensFlareGhostChrDistortion=(EditorGUILayout.Slider(this.m_lensFlareGhostChrmDistortGC, amplifyBloomBase.LensFlareInstance.LensFlareGhostChrDistortion, 0f, 10f, new GUILayoutOption[0]));
EditorGUI.indentLevel = (EditorGUI.indentLevel + 1);
this.m_ghostsAdvancedSettingsFoldout = this.CustomFoldout(this.m_ghostsAdvancedSettingsFoldout, this.m_advancedSettingsGhostsFoldoutGC, 19);
if (this.m_ghostsAdvancedSettingsFoldout)
{
amplifyBloomBase.LensFlareInstance.LensFlareGhostsPowerFactor=(EditorGUILayout.Slider(this.m_lensFlareGhostPowerFactorGC, amplifyBloomBase.LensFlareInstance.LensFlareGhostsPowerFactor, 0f, 2f, new GUILayoutOption[0]));
amplifyBloomBase.LensFlareInstance.LensFlareGhostsPowerFalloff=(EditorGUILayout.Slider(this.m_lensFlareGhostPowerFalloffGC, amplifyBloomBase.LensFlareInstance.LensFlareGhostsPowerFalloff, 1f, 128f, new GUILayoutOption[0]));
}
EditorGUI.indentLevel = (EditorGUI.indentLevel - 1);
}
this.m_haloFoldout = this.CustomFoldout(this.m_haloFoldout, this.m_halosFoldoutGC, 4);
if (this.m_haloFoldout)
{
amplifyBloomBase.LensFlareInstance.LensFlareNormalizedHaloIntensity=(EditorGUILayout.FloatField(this.m_lensFlareHalosIntensityGC, amplifyBloomBase.LensFlareInstance.LensFlareNormalizedHaloIntensity, new GUILayoutOption[0]));
amplifyBloomBase.LensFlareInstance.LensFlareHaloWidth=(EditorGUILayout.Slider(this.m_lensFlareHaloWidthGC, amplifyBloomBase.LensFlareInstance.LensFlareHaloWidth, 0f, 1f, new GUILayoutOption[0]));
amplifyBloomBase.LensFlareInstance.LensFlareHaloChrDistortion=(EditorGUILayout.Slider(this.m_lensFlareHaloChrmDistGC, amplifyBloomBase.LensFlareInstance.LensFlareHaloChrDistortion, 0f, 10f, new GUILayoutOption[0]));
EditorGUI.indentLevel = (EditorGUI.indentLevel + 1);
this.m_haloAdvancedSettingsFoldout = this.CustomFoldout(this.m_haloAdvancedSettingsFoldout, this.m_advancedSettingsHalosFoldoutGC, 19);
if (this.m_haloAdvancedSettingsFoldout)
{
amplifyBloomBase.LensFlareInstance.LensFlareHaloPowerFactor=(EditorGUILayout.Slider(this.m_lensFlareHaloPowerFactorGC, amplifyBloomBase.LensFlareInstance.LensFlareHaloPowerFactor, 1f, 2f, new GUILayoutOption[0]));
amplifyBloomBase.LensFlareInstance.LensFlareHaloPowerFalloff=(EditorGUILayout.Slider(this.m_lensFlareHaloPowerFalloffGC, amplifyBloomBase.LensFlareInstance.LensFlareHaloPowerFalloff, 1f, 128f, new GUILayoutOption[0]));
}
EditorGUI.indentLevel = (EditorGUI.indentLevel - 1);
}
EditorGUI.indentLevel = (EditorGUI.indentLevel - 1);
GUI.enabled = true;
}
bool applyLensGlare = amplifyBloomBase.LensGlareInstance.ApplyLensGlare;
this.ToggleFoldout(this.m_lensGlareFoldoutGC, ref this.m_lensGlareFoldout, ref applyLensGlare, true, -8, false);
amplifyBloomBase.LensGlareInstance.ApplyLensGlare=(applyLensGlare);
if (this.m_lensGlareFoldout)
{
GUI.enabled=(amplifyBloomBase.LensGlareInstance.ApplyLensGlare);
amplifyBloomBase.LensGlareInstance.Intensity=(EditorGUILayout.FloatField(this.m_lensGlareIntensityGC, amplifyBloomBase.LensGlareInstance.Intensity, new GUILayoutOption[0]));
amplifyBloomBase.LensGlareInstance.OverallStreakScale=(EditorGUILayout.Slider(this.m_lensGlareOverallStreakScaleGC, amplifyBloomBase.LensGlareInstance.OverallStreakScale, 0f, 2f, new GUILayoutOption[0]));
amplifyBloomBase.LensGlareInstance.OverallTint=(EditorGUILayout.ColorField(this.m_lensGlareOverallTintGC, amplifyBloomBase.LensGlareInstance.OverallTint, new GUILayoutOption[0]));
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_anamorphicGlare.m_cromaticAberrationGrad"), this.m_lensGlareTintAlongGlareGC, new GUILayoutOption[0]);
if (EditorGUI.EndChangeCheck())
{
serializedObject.ApplyModifiedProperties();
amplifyBloomBase.LensGlareInstance.SetDirty();
}
amplifyBloomBase.LensGlareInstance.CurrentGlare=((GlareLibType)EditorGUILayout.EnumPopup(this.m_lensGlareTypeGC, amplifyBloomBase.LensGlareInstance.CurrentGlare, new GUILayoutOption[0]));
if (amplifyBloomBase.LensGlareInstance.CurrentGlare == (GlareLibType)9)
{
EditorGUI.indentLevel = (EditorGUI.indentLevel + 1);
amplifyBloomBase.LensGlareInstance.CustomGlareDefAmount=(EditorGUILayout.IntSlider(this.m_customGlareSizeGC, amplifyBloomBase.LensGlareInstance.CustomGlareDefAmount, 0, 32, new GUILayoutOption[0]));
if (amplifyBloomBase.LensGlareInstance.CustomGlareDefAmount > 0)
{
amplifyBloomBase.LensGlareInstance.CustomGlareDefIdx=(EditorGUILayout.IntSlider(this.m_customGlareIdxGC, amplifyBloomBase.LensGlareInstance.CustomGlareDefIdx, 0, amplifyBloomBase.LensGlareInstance.CustomGlareDef.Length - 1, new GUILayoutOption[0]));
for (int l = 0; l < amplifyBloomBase.LensGlareInstance.CustomGlareDef.Length; l++)
{
EditorGUI.indentLevel = (EditorGUI.indentLevel + 1);
this.m_customGlareFoldoutGC.text=(string.Concat(new object[]
{
"[",
l,
"] ",
amplifyBloomBase.LensGlareInstance.CustomGlareDef[l].CustomStarData.StarName
}));
amplifyBloomBase.LensGlareInstance.CustomGlareDef[l].FoldoutValue = this.CustomFoldout(amplifyBloomBase.LensGlareInstance.CustomGlareDef[l].FoldoutValue, this.m_customGlareFoldoutGC, 4);
if (amplifyBloomBase.LensGlareInstance.CustomGlareDef[l].FoldoutValue)
{
amplifyBloomBase.LensGlareInstance.CustomGlareDef[l].CustomStarData.StarName=(EditorGUILayout.TextField(this.m_customGlareNameGC, amplifyBloomBase.LensGlareInstance.CustomGlareDef[l].CustomStarData.StarName, new GUILayoutOption[0]));
amplifyBloomBase.LensGlareInstance.CustomGlareDef[l].StarInclinationDeg=(EditorGUILayout.Slider(this.m_customGlareStarInclinationGC, amplifyBloomBase.LensGlareInstance.CustomGlareDef[l].StarInclinationDeg, 0f, 180f, new GUILayoutOption[0]));
amplifyBloomBase.LensGlareInstance.CustomGlareDef[l].ChromaticAberration=(EditorGUILayout.Slider(this.m_customGlareChromaticAberrationGC, amplifyBloomBase.LensGlareInstance.CustomGlareDef[l].ChromaticAberration, 0f, 1f, new GUILayoutOption[0]));
amplifyBloomBase.LensGlareInstance.CustomGlareDef[l].CustomStarData.StarlinesCount=(EditorGUILayout.IntSlider(this.m_customGlareStarlinesCountGC, amplifyBloomBase.LensGlareInstance.CustomGlareDef[l].CustomStarData.StarlinesCount, 1, 4, new GUILayoutOption[0]));
amplifyBloomBase.LensGlareInstance.CustomGlareDef[l].CustomStarData.PassCount=(EditorGUILayout.IntSlider(this.m_customGlarePassCountGC, amplifyBloomBase.LensGlareInstance.CustomGlareDef[l].CustomStarData.PassCount, 1, 4, new GUILayoutOption[0]));
amplifyBloomBase.LensGlareInstance.CustomGlareDef[l].CustomStarData.SampleLength=(EditorGUILayout.Slider(this.m_customGlareSampleLengthGC, amplifyBloomBase.LensGlareInstance.CustomGlareDef[l].CustomStarData.SampleLength, 0f, 2f, new GUILayoutOption[0]));
amplifyBloomBase.LensGlareInstance.CustomGlareDef[l].CustomStarData.Attenuation=(EditorGUILayout.Slider(this.m_customGlareAttenuationGC, amplifyBloomBase.LensGlareInstance.CustomGlareDef[l].CustomStarData.Attenuation, 0f, 1f, new GUILayoutOption[0]));
amplifyBloomBase.LensGlareInstance.CustomGlareDef[l].CustomStarData.CameraRotInfluence=(EditorGUILayout.FloatField(this.m_customGlareRotationGC, amplifyBloomBase.LensGlareInstance.CustomGlareDef[l].CustomStarData.CameraRotInfluence, new GUILayoutOption[0]));
amplifyBloomBase.LensGlareInstance.CustomGlareDef[l].CustomStarData.CustomIncrement=(EditorGUILayout.Slider(this.m_customGlareCustomIncrementGC, amplifyBloomBase.LensGlareInstance.CustomGlareDef[l].CustomStarData.CustomIncrement, 0f, 180f, new GUILayoutOption[0]));
amplifyBloomBase.LensGlareInstance.CustomGlareDef[l].CustomStarData.LongAttenuation=(EditorGUILayout.Slider(this.m_customGlareLongAttenuationGC, amplifyBloomBase.LensGlareInstance.CustomGlareDef[l].CustomStarData.LongAttenuation, 0f, 1f, new GUILayoutOption[0]));
}
EditorGUI.indentLevel = (EditorGUI.indentLevel - 1);
}
}
EditorGUI.indentLevel = (EditorGUI.indentLevel - 1);
}
EditorGUI.indentLevel = (EditorGUI.indentLevel + 1);
this.m_lensGlareAdvancedSettingsFoldout = this.CustomFoldout(this.m_lensGlareAdvancedSettingsFoldout, this.m_advancedSettingsLensGlareFoldoutGC, 4);
if (this.m_lensGlareAdvancedSettingsFoldout)
{
amplifyBloomBase.LensGlareInstance.PerPassDisplacement=(EditorGUILayout.Slider(this.m_lensGlarePerPassDispGC, amplifyBloomBase.LensGlareInstance.PerPassDisplacement, 1f, 8f, new GUILayoutOption[0]));
amplifyBloomBase.LensGlareInstance.GlareMaxPassCount=(EditorGUILayout.IntSlider(this.m_lensGlareMaxPerRayGC, amplifyBloomBase.LensGlareInstance.GlareMaxPassCount, 1, 4, new GUILayoutOption[0]));
}
EditorGUI.indentLevel = (EditorGUI.indentLevel - 1);
GUI.enabled = true;
}
if (EditorGUI.EndChangeCheck())
{
EditorUtility.SetDirty(amplifyBloomBase);
}
GUILayout.EndVertical();
}
}
}