/// <summary>
        /// Displays distance fadein parameters for spot/point lights' cookies
        /// </summary>
        private void DisplayCookieDistanceAttenuationParameters()
        {
            EditorGUILayout.BeginVertical();

            GUILayout.Label("Cookie Fade-In Attenuation", GuiStyles.LabelCenteredBig);
            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            GuiHelpers.DrawContextualHelpBox("The \"Thresholds\" parameters are the normalized range where the cookie will fade in.");
            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("Fade-In Thresholds", GuiStyles.Label, GUILayout.MaxWidth(160));
            GuiHelpers.DrawMinMaxSlider(ref _customCookieDistanceFalloffLowThresholdProperty, ref _customCookieDistanceFalloffHiThresholdProperty, 0.0f, 1.0f);
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.Separator();

            GuiHelpers.DrawPositiveOnlyFloatField(ref _customCookieDistanceFalloffPowerProperty, new GUIContent("Strength", "The curve of the fading"));

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            GuiHelpers.DrawContextualHelpBox("Allows to reset to Unity's default values.");
            if (GUILayout.Button("Reset", GuiStyles.Button))
            {
                _customCookieDistanceFalloffLowThresholdProperty.floatValue = 0.1f;
                _customCookieDistanceFalloffHiThresholdProperty.floatValue  = 0.25f;
                _customAngularFalloffPowerProperty.floatValue = 2.0f;
            }

            EditorGUILayout.EndVertical();
        }
        /// <summary>
        /// Displays the additional parameters for directional lights
        /// </summary>
        private void DisplayDirectionalLightAdditionalSettingsArea()
        {
            EditorGUILayout.BeginVertical();

            EditorGUILayout.Separator();
            GUILayout.Label(_directionalLightSettingsTitleContent, new GUIStyle(GuiStyles.LabelBoldCenteredBig)
            {
                fontSize = 15
            });
            EditorGUILayout.Separator();

            GuiHelpers.DrawContextualHelpBox("The \"Enable Out-Of-Phase Color\" parameter allows you to use a color when the view angle is not towards the directional light (the decay is controlled by the scattering factor.");
            GuiHelpers.DrawToggleChecker(ref _enableOutOfPhaseColorProperty, "Enable Out-Of-Phase Color");
            if (_enableOutOfPhaseColorProperty.boolValue)
            {
                //EditorGUI.BeginDisabledGroup(!_enableOutOfPhaseColorProperty.boolValue);
                EditorGUILayout.BeginVertical();
                GuiHelpers.DrawContextualHelpBox("The color when the view direction is not towards the directional light.");
                EditorGUILayout.PropertyField(_outOfPhaseColorProperty);
                GuiHelpers.DrawFloatField(ref _outOfPhaseColorStrengthProperty, new GUIContent("Strength", "Multiplies the intensity of the color"));
                EditorGUILayout.EndVertical();
                //EditorGUI.EndDisabledGroup();
            }

            EditorGUILayout.Separator();

            EditorGUILayout.EndVertical();
        }
        /// <summary>
        /// Displays distance fadeout parameters for spot/point lights
        /// </summary>
        private void DisplayLightDistanceAttenuationParameters()
        {
            EditorGUILayout.BeginVertical();

            GUILayout.Label("Distance Attenuation", GuiStyles.LabelCenteredBig);
            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            GuiHelpers.DrawContextualHelpBox("The \"Threshold\" parameter is the normalized distance when the fade will start, until 1.");
            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("Threshold", GuiStyles.Label, GUILayout.MaxWidth(160));
            GuiHelpers.DrawSlider(ref _customDistanceFalloffThresholdProperty, 0.0f, 1.0f);
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.Separator();

            GuiHelpers.DrawPositiveOnlyFloatField(ref _customDistanceFalloffPowerProperty, new GUIContent("Strength", "The curve of the fading"));

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            GuiHelpers.DrawContextualHelpBox("Allows to reset to Unity's default values.");
            if (GUILayout.Button("Reset", GuiStyles.Button))
            {
                _customDistanceFalloffThresholdProperty.floatValue = 0.5f;
                _customDistanceFalloffPowerProperty.floatValue     = 2.0f;
            }

            EditorGUILayout.EndVertical();
        }
Beispiel #4
0
        /// <summary>
        /// Draws the fields required for a LevelsParameters object
        /// </summary>
        /// <param name="levelsProperty">The related serialized property</param>
        public static void DrawLevelsField(ref SerializedProperty levelsProperty)
        {
            GuiHelpers.DrawContextualHelpBox("The \"Levels\" parameter will filter the input value.\n\nKeeps the value between the \"Level Thresholds\" and remaps the range from 0 to 1.\"");
            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("Filter Range", GuiStyles.Label, GUILayout.MaxWidth(160));
            SerializedProperty levelLowThresholdProperty = levelsProperty.FindPropertyRelative("levelLowThreshold");
            SerializedProperty levelHiThresholdProperty  = levelsProperty.FindPropertyRelative("levelHiThreshold");

            GuiHelpers.DrawMinMaxSlider(ref levelLowThresholdProperty, ref levelHiThresholdProperty, 0, 1);
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.Separator();

            SerializedProperty contrastProperty = levelsProperty.FindPropertyRelative("contrast");

            DrawFloatField(ref contrastProperty, new GUIContent("Contrast", "Contrast the input mask"));

            EditorGUILayout.Separator();

            GuiHelpers.DrawContextualHelpBox("The \"Output\" parameters will rescale this new range\n\n0 will now equal the lower \"Output Value\" and 1 will now equal the higher.");
            SerializedProperty outputLowValueProperty = levelsProperty.FindPropertyRelative("outputLowValue");

            DrawFloatField(ref outputLowValueProperty, new GUIContent("Output Min", "Output minimum value"));
            SerializedProperty outputHiValueProperty = levelsProperty.FindPropertyRelative("outputHiValue");

            DrawFloatField(ref outputHiValueProperty, new GUIContent("Output Max", "Output maximum value"));
        }
        /// <summary>
        /// Displays the common parameters tab
        /// </summary>
        private void DisplayCommonSettingsArea()
        {
            EditorGUILayout.BeginVertical(GuiStyles.ButtonNoHover);

            EditorGUILayout.Separator();
            GUILayout.Label(_commonSettingsTitleContent, new GUIStyle(GuiStyles.LabelBoldCenteredBig)
            {
                fontSize = 15
            });
            EditorGUILayout.Separator();

            GuiHelpers.DrawFloatField(ref _strengthProperty, new GUIContent("Strength", "Multiplies the intensity of the light source in the system"));

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            GuiHelpers.DrawContextualHelpBox("The \"Enable Shadows\" parameter allows you to compute the light's shadows (if enabled) in the system.");
            GuiHelpers.DrawToggleChecker(ref _useShadowsProperty, "Enable Shadows");

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            GuiHelpers.DrawContextualHelpBox("The \"Enable Cookie\" parameter allows you to compute the light's cookie (if enabled) in the system.");
            //EditorGUI.BeginDisabledGroup(!_component.CastsCookie);
            GuiHelpers.DrawToggleChecker(ref _useCookieProperty, "Enable Cookie");
            //EditorGUI.EndDisabledGroup();

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            GuiHelpers.DrawContextualHelpBox("The \"Override Color\" parameter allows you to replace the light's color in the system.");
            GuiHelpers.DrawToggleChecker(ref _overrideColorProperty, "Override Color");
            if (_overrideColorProperty.boolValue)
            {
                //EditorGUI.BeginDisabledGroup(!_overrideColorProperty.boolValue);
                EditorGUILayout.BeginVertical();
                GuiHelpers.DrawContextualHelpBox("The \"Overriding Color\" is the color that will replace the light's color in the system.");
                EditorGUILayout.PropertyField(_overridingColorProperty);
                EditorGUILayout.EndVertical();
                //EditorGUI.EndDisabledGroup();
            }

            EditorGUILayout.Separator();

            GuiHelpers.DrawContextualHelpBox("The \"Scattering Bias\" parameter allows to have more control of how the light will scatter in the environment.");
            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("Scattering Bias", GuiStyles.Label, GUILayout.MaxWidth(160));
            GuiHelpers.DrawSlider(ref _scatteringBiasProperty, -1.0f, 1.0f);
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.Separator();

            EditorGUILayout.EndVertical();
        }
 /// <summary>
 /// Displays Scattering Injection area
 /// </summary>
 private void DisplayScatteringInjectionArea()
 {
     EditorGUILayout.BeginVertical(GuiStyles.Background);
     GuiHelpers.DrawContextualHelpBox("The \"Scattering Injection\" parameters allows you to add/remove scattering inside the system.\n\nIn other words, you will be able to modify how light from light sources will bounce inside the micro particles and will be deviated by them. Typically, how \"wet\" the micro particles are.\n TIP :The \"Strength\" parameter will accept negative values. Meaning that you will be able to remove scattering as well.");
     GuiHelpers.DrawToggleChecker(ref _scatteringInjectionBoolProperty, _scatteringInjectionTitleContent, true, true);
     if (_scatteringInjectionBoolProperty.boolValue)
     {
         //EditorGUI.BeginDisabledGroup(!_scatteringInjectionBoolProperty.boolValue);
         EditorGUILayout.BeginVertical(GuiStyles.EmptyMiddleAligned);
         GuiHelpers.DrawInjectionField(ref _scatteringInjectionParametersProperty, _noiseMaskBoolProperty.boolValue, _currentVolume.UsesTexture2DMasking, _currentVolume.UsesTexture3DMasking);
         EditorGUILayout.Separator();
         EditorGUILayout.EndVertical();
         //EditorGUI.EndDisabledGroup();
     }
     EditorGUILayout.EndVertical();
 }
 /// <summary>
 /// Displays Light Probes settings area
 /// </summary>
 private void DisplayLightProbesLightingInjectionArea()
 {
     EditorGUILayout.BeginVertical(GuiStyles.Background);
     GuiHelpers.DrawContextualHelpBox("These parameters allow to enable the volume to inject the baked light probes illumination and tweak the strength of the injection.");
     GuiHelpers.DrawToggleChecker(ref _useAsLightProbesProxyVolumeProperty, new GUIContent("Light Probes Lighting", Aura.ResourcesCollection.lightProbesIconTexture), true, true);
     if (_useAsLightProbesProxyVolumeProperty.boolValue)
     {
         GUILayout.Label(new GUIContent(" Experimental Feature (PREVIEW)", Aura.ResourcesCollection.experimentalIconTexture), GuiStyles.LabelBoldCentered);
         //EditorGUI.BeginDisabledGroup(!_useAsLightProbesProxyVolumeProperty.boolValue);
         EditorGUILayout.BeginVertical(GuiStyles.EmptyMiddleAligned);
         GuiHelpers.DrawPositiveOnlyFloatField(ref _lightProbesMultiplierProperty, new GUIContent("Strength", "Multiplies the injected lighting"));
         EditorGUILayout.EndVertical();
         //EditorGUI.EndDisabledGroup();
     }
     EditorGUILayout.EndVertical();
 }
 /// <summary>
 /// Displays Light Injection area
 /// </summary>
 private void DisplayLightInjectionArea()
 {
     EditorGUILayout.BeginVertical(GuiStyles.Background);
     GuiHelpers.DrawContextualHelpBox("The \"Light Injection\" parameters allows you to add/remove color inside the system.\n\nIn other words, you will be able to add/remove light inside a defined area.\n TIP :The \"Strength\" parameter will accept negative values. Meaning that you will be able to remove Color.");
     GuiHelpers.DrawToggleChecker(ref _lightInjectionBoolProperty, _lightInjectionTitleContent, true, true);
     if (_lightInjectionBoolProperty.boolValue)
     {
         //EditorGUI.BeginDisabledGroup(!_lightInjectionBoolProperty.boolValue);
         EditorGUILayout.BeginVertical(GuiStyles.EmptyMiddleAligned);
         EditorGUILayout.PropertyField(_lightInjectionColorProperty);
         GuiHelpers.DrawInjectionField(ref _lightInjectionParametersProperty, _noiseMaskBoolProperty.boolValue, _currentVolume.UsesTexture2DMasking, _currentVolume.UsesTexture3DMasking);
         EditorGUILayout.Separator();
         EditorGUILayout.EndVertical();
         //EditorGUI.EndDisabledGroup();
     }
     EditorGUILayout.EndVertical();
 }
 /// <summary>
 /// Displays Noise Mask Area
 /// </summary>
 private void DisplayNoiseMaskArea()
 {
     EditorGUILayout.BeginVertical(GuiStyles.Background);
     GuiHelpers.DrawContextualHelpBox("The \"Noise Mask\" parameter allows you to assign a dynamic morphing noise mask to the volume.\nThis noise will be used for masking the data injected.");
     GuiHelpers.DrawToggleChecker(ref _noiseMaskBoolProperty, new GUIContent("Noise Mask", Aura.ResourcesCollection.noiseIconTexture), true, true);
     if (_noiseMaskBoolProperty.boolValue)
     {
         //EditorGUI.BeginDisabledGroup(!_noiseMaskBoolProperty.boolValue);
         EditorGUILayout.BeginVertical(GuiStyles.EmptyMiddleAligned);
         GuiHelpers.DrawFloatField(ref _noiseMaskSpeedProperty, new GUIContent("Speed", "Speed of the morph"));
         EditorGUILayout.Separator();
         EditorGUILayout.Separator();
         GuiHelpers.DrawTransformField(ref _noiseMaskTransformProperty);
         EditorGUILayout.EndVertical();
         //EditorGUI.EndDisabledGroup();
     }
     EditorGUILayout.EndVertical();
 }
Beispiel #10
0
        /// <summary>
        /// Displays the common parameters tab
        /// </summary>
        private void DisplayCommonSettingsArea()
        {
            EditorGUILayout.BeginVertical(GuiStyles.ButtonNoHover);

            EditorGUILayout.Separator();
            GUILayout.Label(_commonSettingsTitleContent, new GUIStyle(GuiStyles.LabelBoldCenteredBig)
            {
                fontSize = 15
            });
            EditorGUILayout.Separator();

            GuiHelpers.DrawFloatField(ref _strengthProperty, new GUIContent("Strength", "Multiplies the intensity of the light source in the system"));

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            EditorGUILayout.PropertyField(_useScatteringProperty);
            if ((BooleanChoice)_useScatteringProperty.enumValueIndex == BooleanChoice.Default || (BooleanChoice)_useScatteringProperty.enumValueIndex == BooleanChoice.True)
            {
                EditorGUILayout.Separator();
                GuiHelpers.DrawToggleChecker(ref _overrideScatteringProperty, "Override Scattering");
                if (_overrideScatteringProperty.boolValue)
                {
                    EditorGUILayout.BeginVertical();
                    EditorGUILayout.PropertyField(_overridingScatteringProperty);
                    EditorGUILayout.EndVertical();
                }
            }

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            GuiHelpers.DrawContextualHelpBox("The \"Enable Shadows\" parameter allows you to compute the light's shadows (if enabled) in the system.");
            GuiHelpers.DrawToggleChecker(ref _useShadowsProperty, "Enable Shadows");

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            GuiHelpers.DrawContextualHelpBox("The \"Enable Cookie\" parameter allows you to compute the light's cookie (if enabled) in the system.");
            //EditorGUI.BeginDisabledGroup(!_component.CastsCookie);
            GuiHelpers.DrawToggleChecker(ref _useCookieProperty, "Enable Cookie");
            //EditorGUI.EndDisabledGroup();

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            GuiHelpers.DrawContextualHelpBox("The \"Override Color\" parameter allows you to replace the light's color in the system.");
            GuiHelpers.DrawToggleChecker(ref _overrideColorProperty, "Override Color");
            if (_overrideColorProperty.boolValue)
            {
                //EditorGUI.BeginDisabledGroup(!_overrideColorProperty.boolValue);
                EditorGUILayout.BeginVertical();
                GuiHelpers.DrawContextualHelpBox("The \"Overriding Color\" is the color that will replace the light's color in the system.");
                EditorGUILayout.PropertyField(_overridingColorProperty);
                EditorGUILayout.EndVertical();
                //EditorGUI.EndDisabledGroup();
            }

            if (LightHelpers.IsColorTemperatureAvailable)
            {
                EditorGUILayout.Separator();
                EditorGUILayout.Separator();
                EditorGUILayout.Separator();

                GuiHelpers.DrawHelpBox("Unity currently gives no way to know if the color temperature mode is enabled on the light, therefore you need to manually enable it here under.", HelpBoxType.Warning);
                EditorGUILayout.Separator();
                GuiHelpers.DrawToggleChecker(ref _useColorTemperatureTintProperty, "Use Color Temperature Tint");
            }

            EditorGUILayout.Separator();

            EditorGUILayout.EndVertical();
        }
        /// <summary>
        /// Displays the content of the settings tab
        /// </summary>
        private static void DisplaySettingsArea(SerializedObject serializedObject, AuraCamera auraComponent)
        {
            EditorGUILayout.BeginVertical(GuiStyles.Background);

            EditorGUILayout.BeginVertical(GuiStyles.ButtonNoHover);

            EditorGUILayout.Separator();
            GUILayout.Label(new GUIContent(" Debug", Aura.ResourcesCollection.debugIconTexture), GuiStyles.LabelBoldCenteredBig);
            EditorGUILayout.Separator();

            GuiHelpers.DrawToggleChecker(ref _debugVolumetricLightingProperty, "Display Volumetric Lighting Only");

            EditorGUILayout.Separator();

            GuiHelpers.DrawToggleChecker(ref _debugOcclusionCullingProperty, "Display Occlusion Miss");

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            EditorGUILayout.EndVertical();

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            EditorGUILayout.BeginVertical(GuiStyles.ButtonNoHover);

            EditorGUILayout.Separator();
            GUILayout.Label(new GUIContent(" Grid", Aura.ResourcesCollection.gridIconTexture), GuiStyles.LabelBoldCenteredBig);
            EditorGUILayout.Separator();

            GuiHelpers.DrawContextualHelpBox("The \"Grid\" parameters allow you to determine the density of cells used to compute the volumetric lighting.\n\nThis cubic grid will be remapped on the frustum (the volume visible to the camera) and will range from the camera's near clip distance to the \"Range\" distance parameter (for performance saving and because behind a certain distance, changes are barely noticeable).");

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            EditorGUILayout.BeginVertical();
            if (!IsEditionQualitySettings)
            {
                _frustumGridResolutionProperty.FindPropertyRelative("x").intValue = Mathf.Max(8, EditorGUILayout.IntField("Horizontal", _frustumGridResolutionProperty.FindPropertyRelative("x").intValue));
                _frustumGridResolutionProperty.FindPropertyRelative("y").intValue = Mathf.Max(8, EditorGUILayout.IntField("Vertical", _frustumGridResolutionProperty.FindPropertyRelative("y").intValue));
                _frustumGridResolutionProperty.FindPropertyRelative("z").intValue = Mathf.Max(8, EditorGUILayout.IntField("Depth", _frustumGridResolutionProperty.FindPropertyRelative("z").intValue));
                EditorGUILayout.Separator();
                if (GUILayout.Button("Set Resolution", GuiStyles.ButtonBold))
                {
                    //if (IsEditionQualitySettings)
                    //{
                    //    SceneViewVisualization.SetSceneViewVisualizationFrustumGridResolution(_frustumGridResolutionProperty.vector3IntValue);
                    //}
                    //else
                    {
                        _current.SetFrustumGridResolution(_frustumGridResolutionProperty.vector3IntValue);
                    }
                }

                EditorGUILayout.Separator();
                EditorGUILayout.Separator();

                GuiHelpers.DrawToggleChecker(ref _enableAutomaticStereoResizingProperty, new GUIContent("Resize Automatically In Stereo Mode", "Enables the automatic horizontal resizing of the frustum grid resolution when the camera is running in stereo mode\n(halved size for MultiPass, doubled size for SinglePass)"));

                EditorGUILayout.Separator();
                EditorGUILayout.Separator();
            }
            else
            {
                GuiHelpers.DrawHelpBox("Custom grid resolution in SceneView is not currently available", HelpBoxType.Experimental);
                EditorGUILayout.Separator();
                EditorGUILayout.Separator();
            }

            GuiHelpers.DrawPositiveOnlyFloatField(ref _gridSettingsFarPlaneProperty, "Range");
            if (auraComponent != null && _gridSettingsFarPlaneProperty.floatValue < auraComponent.CameraComponent.nearClipPlane)
            {
                GuiHelpers.DrawHelpBox("Range must be bigger than 0", HelpBoxType.Warning);
            }

            EditorGUILayout.Separator();

            GuiHelpers.DrawSlider(ref _depthBiasCoefficientProperty, 0, 1, "Depth Bias", true);

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            GuiHelpers.DrawContextualHelpBox("The \"Occlusion Culling\" allows to compute the maximum visible depth of the frustum grid.\n\nThis leads to avoid computing cells that are invisible to the camera because hidden behind objects.");
            GuiHelpers.DrawToggleChecker(ref _enableOcclusionCullingProperty, "Enable Occlusion Culling");
            EditorGUI.BeginDisabledGroup(!_enableOcclusionCullingProperty.boolValue);
            EditorGUILayout.BeginVertical(GuiStyles.EmptyMiddleAligned);
            EditorGUILayout.PropertyField(_occlusionCullingAccuracyProperty, new GUIContent("Accuracy"));
            EditorGUILayout.EndVertical();
            EditorGUI.EndDisabledGroup();

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            EditorGUILayout.EndVertical();

            EditorGUILayout.EndVertical();

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            EditorGUILayout.BeginVertical(GuiStyles.ButtonNoHover);

            EditorGUILayout.Separator();
            GUILayout.Label(new GUIContent(" Filtering", Aura.ResourcesCollection.cameraIconTexture), GuiStyles.LabelBoldCenteredBig);
            EditorGUILayout.Separator();

            GuiHelpers.DrawContextualHelpBox("These parameters allow to configure the filtering of the volumetric data.");

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            EditorGUILayout.BeginVertical();
            GuiHelpers.DrawToggleChecker(ref _enableDitheringProperty, "Enable Color Dithering");

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            EditorGUILayout.PropertyField(_texture3DFilteringProperty, new GUIContent("Texture3D Filtering"));

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            GuiHelpers.DrawContextualHelpBox("The \"Reprojection\" allows to blend the current (jittered) computed frame with the previous one.\n\nThis leads to a smoother volumetric lighting, especially with a low resolution grid.");
            GuiHelpers.DrawToggleChecker(ref _enableTemporalReprojectionProperty, "Enable Reprojection");
            EditorGUI.BeginDisabledGroup(!_enableTemporalReprojectionProperty.boolValue);
            EditorGUILayout.BeginVertical(GuiStyles.EmptyMiddleAligned);
            GuiHelpers.DrawSlider(ref _temporalReprojectionFactorProperty, 0, 1, "Reprojector factor");
            EditorGUILayout.EndVertical();
            EditorGUI.EndDisabledGroup();

            EditorGUILayout.Separator();

            EditorGUILayout.EndVertical();
            EditorGUILayout.EndVertical();

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            EditorGUILayout.BeginVertical(GuiStyles.ButtonNoHover);

            EditorGUILayout.Separator();
            GUILayout.Label(new GUIContent(" Options", Aura.ResourcesCollection.optionsIconTexture), GuiStyles.LabelBoldCenteredBig);
            EditorGUILayout.Separator();

            GuiHelpers.DrawContextualHelpBox("These parameters allow you to enable/disable some options.\n\nNote that the existence of the different contributions are handled by the system at runtime.");

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            EditorGUILayout.BeginVertical();

            GuiHelpers.DrawToggleChecker(ref _enableAmbientLightingProperty, "Enable Ambient Lighting");

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            GuiHelpers.DrawToggleChecker(ref _enableVolumesProperty, "Enable Volumes");
            EditorGUI.BeginDisabledGroup(!_enableVolumesProperty.boolValue);
            EditorGUILayout.BeginVertical(GuiStyles.EmptyMiddleAligned);
            GuiHelpers.DrawToggleChecker(ref _enableVolumesNoiseMaskProperty, "Enable Noise Masks");
            EditorGUILayout.Separator();
            GuiHelpers.DrawToggleChecker(ref _enableVolumesTexture2DMaskProperty, "Enable Texture2D Masks");
            EditorGUILayout.Separator();
            GuiHelpers.DrawToggleChecker(ref _enableVolumesTexture3DMaskProperty, "Enable Texture3D Masks");
            EditorGUILayout.EndVertical();
            EditorGUI.EndDisabledGroup();

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            GuiHelpers.DrawToggleChecker(ref _enableDirectionalLightsProperty, "Enable Directional Lights");
            EditorGUI.BeginDisabledGroup(!_enableDirectionalLightsProperty.boolValue);
            EditorGUILayout.BeginVertical(GuiStyles.EmptyMiddleAligned);
            GuiHelpers.DrawToggleChecker(ref _enableDirectionalLightsShadowsProperty, "Enable Shadows");
            EditorGUILayout.EndVertical();
            EditorGUI.EndDisabledGroup();

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            GuiHelpers.DrawToggleChecker(ref _enableSpotLightsProperty, "Enable Spot Lights");
            EditorGUI.BeginDisabledGroup(!_enableSpotLightsProperty.boolValue);
            EditorGUILayout.BeginVertical(GuiStyles.EmptyMiddleAligned);
            GuiHelpers.DrawToggleChecker(ref _enableSpotLightsShadowsProperty, "Enable Shadows");
            EditorGUILayout.EndVertical();
            EditorGUI.EndDisabledGroup();

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            GuiHelpers.DrawToggleChecker(ref _enablePointLightsProperty, "Enable Point Lights");
            EditorGUI.BeginDisabledGroup(!_enablePointLightsProperty.boolValue);
            EditorGUILayout.BeginVertical(GuiStyles.EmptyMiddleAligned);
            GuiHelpers.DrawToggleChecker(ref _enablePointLightsShadowsProperty, "Enable Shadows");
            EditorGUILayout.EndVertical();
            EditorGUI.EndDisabledGroup();

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            EditorGUI.BeginDisabledGroup(!_enableSpotLightsProperty.boolValue && !_enableSpotLightsProperty.boolValue && !_enableDirectionalLightsProperty.boolValue);
            GuiHelpers.DrawToggleChecker(ref _enableLightsCookiesProperty, "Enable Cookies");
            EditorGUI.EndDisabledGroup();

            EditorGUILayout.Separator();

            EditorGUILayout.EndVertical();

            EditorGUILayout.EndVertical();

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            EditorGUILayout.BeginVertical(GuiStyles.ButtonNoHover);

            EditorGUILayout.Separator();
            GUILayout.Label(new GUIContent(" Experimental Features", Aura.ResourcesCollection.experimentalIconTexture), GuiStyles.LabelBoldCenteredBig);
            EditorGUILayout.Separator();

            GuiHelpers.DrawHelpBox("These features are still under active development.\nThey might currently lead to visual/performance issues.", HelpBoxType.Experimental);

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            GuiHelpers.DrawToggleChecker(ref _enableDenoisingFilterProperty, "Enable Denoising Filter");
            EditorGUI.BeginDisabledGroup(!_enableDenoisingFilterProperty.boolValue);
            EditorGUILayout.BeginVertical(GuiStyles.EmptyMiddleAligned);
            EditorGUILayout.PropertyField(_denoisingFilterRangeProperty, new GUIContent("Range"));
            EditorGUILayout.EndVertical();
            EditorGUI.EndDisabledGroup();

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            GuiHelpers.DrawToggleChecker(ref _enableBlurFilterProperty, "Enable Blur Filter");
            EditorGUI.BeginDisabledGroup(!_enableBlurFilterProperty.boolValue);
            EditorGUILayout.BeginVertical(GuiStyles.EmptyMiddleAligned);
            EditorGUILayout.PropertyField(_blurFilterRangeProperty, new GUIContent("Range"));
            EditorGUILayout.PropertyField(_blurFilterTypeProperty, new GUIContent("Type"));
            if ((BlurFilterType)_blurFilterTypeProperty.enumValueIndex == BlurFilterType.Gaussian)
            {
                GuiHelpers.DrawSlider(ref _blurFilterGaussianDeviationProperty, 0.0f, 0.01f, "Lobe Bulge");
            }
            EditorGUILayout.EndVertical();
            EditorGUI.EndDisabledGroup();

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            EditorGUILayout.BeginVertical();

            GuiHelpers.DrawContextualHelpBox("The \"Light Probes\" allows to compute the world space light probes' data and inject it as contributing light in the volumetric lighting system.");
            GuiHelpers.DrawToggleChecker(ref _enableLightProbesProperty, "Enable Light Probes");
            //if(!IsEditionQualitySettings)
            //{
            //    EditorGUI.BeginDisabledGroup(!_enableLightProbesProperty.boolValue);
            //    EditorGUILayout.BeginVertical(GuiStyles.EmptyMiddleAligned);
            //    _lightProbesProxyGridResolutionProperty.FindPropertyRelative("x").intValue = Mathf.Max(2, EditorGUILayout.IntField("Horizontal", _lightProbesProxyGridResolutionProperty.FindPropertyRelative("x").intValue));
            //    _lightProbesProxyGridResolutionProperty.FindPropertyRelative("y").intValue = Mathf.Max(2, EditorGUILayout.IntField("Vertical", _lightProbesProxyGridResolutionProperty.FindPropertyRelative("y").intValue));
            //    _lightProbesProxyGridResolutionProperty.FindPropertyRelative("z").intValue = Mathf.Max(2, EditorGUILayout.IntField("Depth", _lightProbesProxyGridResolutionProperty.FindPropertyRelative("z").intValue));
            //    EditorGUILayout.Separator();
            //    if (GUILayout.Button("Set Resolution", GuiStyles.ButtonNoHover))
            //    {
            //        _current.SetLightProbesProxyGridResolution(_lightProbesProxyGridResolutionProperty.vector3IntValue);
            //    }
            //    EditorGUILayout.EndVertical();
            //    EditorGUI.EndDisabledGroup();
            //}
            EditorGUILayout.Separator();
            EditorGUILayout.EndVertical();

            EditorGUILayout.EndVertical();

            EditorGUILayout.EndVertical();
        }
        /// <summary>
        /// Displays Shape Settings Area
        /// </summary>
        private void DisplayShapeSettingsArea()
        {
            EditorGUILayout.BeginVertical();
            GuiHelpers.DrawContextualHelpBox("The \"Shape\" parameter allows you to define the volumetric shape of the volume used for injecting Density, Color or Scattering.\n\nYou will also be able to parameter the fading on the borders of the shape, allowing a smooth transition between the inside and the outside of the volume.");
            EditorGUILayout.Separator();
            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("Shape", GuiStyles.Label, GUILayout.MaxWidth(160));
            EditorGUILayout.PropertyField(_volumeShapeProperty, new GUIContent(""));
            EditorGUILayout.EndHorizontal();

            if ((VolumeType)_volumeShapeProperty.enumValueIndex != VolumeType.Global)
            {
                switch ((VolumeType)_volumeShapeProperty.enumValueIndex)
                {
                case VolumeType.Box:
                {
                    EditorGUILayout.Separator();
                    EditorGUILayout.BeginHorizontal();
                    GUILayout.Label("Width Fade", GuiStyles.Label, GUILayout.MaxWidth(160));
                    GuiHelpers.DrawMinMaxSlider(ref _xNegativeCubeFadeProperty, ref _xPositiveCubeFadeProperty, 0, 1, true);
                    EditorGUILayout.EndHorizontal();
                    EditorGUILayout.Separator();
                    EditorGUILayout.BeginHorizontal();
                    GUILayout.Label("Height Fade", GuiStyles.Label, GUILayout.MaxWidth(160));
                    GuiHelpers.DrawMinMaxSlider(ref _yNegativeCubeFadeProperty, ref _yPositiveCubeFadeProperty, 0, 1, true);
                    EditorGUILayout.EndHorizontal();
                    EditorGUILayout.Separator();
                    EditorGUILayout.BeginHorizontal();
                    GUILayout.Label("Depth Fade", GuiStyles.Label, GUILayout.MaxWidth(160));
                    GuiHelpers.DrawMinMaxSlider(ref _zNegativeCubeFadeProperty, ref _zPositiveCubeFadeProperty, 0, 1, true);
                    EditorGUILayout.EndHorizontal();
                }
                break;

                case VolumeType.Cone:
                {
                    EditorGUILayout.Separator();
                    EditorGUILayout.BeginHorizontal();
                    GUILayout.Label("Angular Fade", GuiStyles.Label, GUILayout.MaxWidth(160));
                    GuiHelpers.DrawSlider(ref _angularConeFadeProperty, 0, 1, true);
                    EditorGUILayout.EndHorizontal();
                    EditorGUILayout.Separator();
                    EditorGUILayout.BeginHorizontal();
                    GUILayout.Label("Distance Fade", GuiStyles.Label, GUILayout.MaxWidth(160));
                    GuiHelpers.DrawSlider(ref _distanceConeFadeProperty, 0, 1, true);
                    EditorGUILayout.EndHorizontal();
                }
                break;

                case VolumeType.Cylinder:
                {
                    EditorGUILayout.Separator();
                    EditorGUILayout.BeginHorizontal();
                    GUILayout.Label("Width Fade", GuiStyles.Label, GUILayout.MaxWidth(160));
                    GuiHelpers.DrawSlider(ref _widthCylinderFadeProperty, 0, 1, true);
                    EditorGUILayout.EndHorizontal();
                    EditorGUILayout.Separator();
                    EditorGUILayout.BeginHorizontal();
                    GUILayout.Label("Height Fade", GuiStyles.Label, GUILayout.MaxWidth(160));
                    GuiHelpers.DrawMinMaxSlider(ref _yNegativeCylinderFadeProperty, ref _yPositiveCylinderFadeProperty, 0, 1, true);
                    EditorGUILayout.EndHorizontal();
                }
                break;

                case VolumeType.Sphere:
                {
                    EditorGUILayout.Separator();
                    EditorGUILayout.BeginHorizontal();
                    GUILayout.Label("Distance Fade", GuiStyles.Label, GUILayout.MaxWidth(160));
                    GuiHelpers.DrawSlider(ref _distanceSphereFadeProperty, 0, 1, true);
                    EditorGUILayout.EndHorizontal();
                }
                break;
                }

                EditorGUILayout.Separator();

                GuiHelpers.DrawPositiveOnlyFloatField(ref _falloffFadeProperty, new GUIContent("Fade Falloff", "The curve of the fading"));
            }
            EditorGUILayout.EndVertical();
        }
Beispiel #13
0
        /// <summary>
        /// Displays the content of the "World's Primary Injection" tab
        /// </summary>
        private static void DisplayBaseSettingsArea()
        {
            EditorGUILayout.BeginVertical(GuiStyles.Background);

            EditorGUILayout.BeginVertical(GuiStyles.ButtonNoHover);

            EditorGUILayout.Separator();
            GUILayout.Label(new GUIContent(" Global Injection", Aura.ResourcesCollection.injectionIconTexture), GuiStyles.LabelBoldCenteredBig);
            EditorGUILayout.Separator();

            GuiHelpers.DrawContextualHelpBox("These parameters are the ambient Density, Lighting and Scattering, set globally for the whole surrounding environment.");

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            EditorGUILayout.BeginVertical();
            GuiHelpers.DrawToggleChecker(ref _useDensityProperty, new GUIContent(" Use Global Density", Aura.ResourcesCollection.densityIconTexture, "Injects an ambient density"), true, true);
            if (_useDensityProperty.boolValue)
            {
                //EditorGUI.BeginDisabledGroup(!_useDensityProperty.boolValue);
                EditorGUILayout.BeginVertical(GuiStyles.EmptyMiddleAligned);
                GuiHelpers.DrawPositiveOnlyFloatField(ref _baseDensityProperty, "Global Density");
                EditorGUILayout.Separator();
                EditorGUILayout.EndVertical();
                //EditorGUI.EndDisabledGroup();
            }

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            GuiHelpers.DrawToggleChecker(ref _useScatteringProperty, new GUIContent(" Use Global Scattering", Aura.ResourcesCollection.scatteringIconTexture, "Injects an ambient scattering"), true, true);
            if (_useScatteringProperty.boolValue)
            {
                //EditorGUI.BeginDisabledGroup(!_useScatteringProperty.boolValue);
                EditorGUILayout.BeginVertical(GuiStyles.EmptyMiddleAligned);
                GuiHelpers.DrawSlider(ref _baseScatteringProperty, 0, 1, "Global Scattering");
                EditorGUILayout.Separator();
                EditorGUILayout.EndVertical();
                //EditorGUI.EndDisabledGroup();
            }

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            GuiHelpers.DrawToggleChecker(ref _useAmbientLightingProperty, new GUIContent(" Use Ambient Lighting", Aura.ResourcesCollection.illuminationIconTexture, "Injects the \"Environment lighting\" set in the \"Lighting\" window"), true, true);
            if (_useAmbientLightingProperty.boolValue)
            {
                //EditorGUI.BeginDisabledGroup(!_useAmbientLightingProperty.boolValue);
                EditorGUILayout.BeginVertical(GuiStyles.EmptyMiddleAligned);
                GuiHelpers.DrawPositiveOnlyFloatField(ref _ambientLightingStrengthProperty, "Ambient Strength");
                EditorGUILayout.Separator();
                EditorGUILayout.EndVertical();
                //EditorGUI.EndDisabledGroup();
            }

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            GuiHelpers.DrawToggleChecker(ref _useColorProperty, new GUIContent(" Use Global Light", Aura.ResourcesCollection.colorIconTexture, "Injects an ambient light"), true, true);
            if (_useColorProperty.boolValue)
            {
                //EditorGUI.BeginDisabledGroup(!_useColorProperty.boolValue);
                EditorGUILayout.BeginVertical(GuiStyles.EmptyMiddleAligned);
                EditorGUILayout.PropertyField(_baseColorProperty);
                GuiHelpers.DrawPositiveOnlyFloatField(ref _baseColorStrengthProperty, "Global Light Strength");
                EditorGUILayout.Separator();
                EditorGUILayout.EndVertical();
                //EditorGUI.EndDisabledGroup();
            }

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            GuiHelpers.DrawToggleChecker(ref _useExtinctionProperty, new GUIContent(" Use Extinction", Aura.ResourcesCollection.extinctionIconTexture, "Simulates the depth related decay of light"), true, true);
            if (_useExtinctionProperty.boolValue)
            {
                //EditorGUI.BeginDisabledGroup(!_useExtinctionProperty.boolValue);
                EditorGUILayout.BeginVertical(GuiStyles.EmptyMiddleAligned);
                GuiHelpers.DrawSlider(ref _extinctionProperty, 0, 1, "Global Extinction", true);
                EditorGUILayout.Separator();
                EditorGUILayout.EndVertical();
                //EditorGUI.EndDisabledGroup();
            }

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            EditorGUILayout.EndVertical();

            EditorGUILayout.EndVertical();

            EditorGUILayout.EndVertical();
        }
        /// <summary>
        /// Draws the quality settings area
        /// </summary>
        private void DisplayQualitySettingsArea()
        {
            AuraQualitySettings currentQualitySettings = (AuraQualitySettings)_qualitySettingsProperty.objectReferenceValue;

            if (!ReferenceEquals(_previousQualitySettings, currentQualitySettings))
            {
                _currentAuraComponent.frustumSettings.RaiseOnQualityChanged();
                PopulateExistingQualitySettingsPresetsList();
            }
            _previousQualitySettings = currentQualitySettings;

            EditorGUILayout.BeginVertical(GuiStyles.ButtonNoHover);

            EditorGUILayout.BeginVertical(GuiStyles.Background);

            EditorGUILayout.Separator();
            GUILayout.Label(new GUIContent("Aura <b>Quality Settings</b>", Aura.ResourcesCollection.qualitySettingsPresetIconTexture), new GUIStyle(GuiStyles.LabelCenteredBig)
            {
                fontSize = 15
            });
            EditorGUILayout.Separator();
            GuiHelpers.DrawContextualHelpBox("The \"Quality Settings Preset\" is the asset that holds the quality settings for the data computation.");

            //if (_foundQualitySettingsPresets.Count != AssetDatabase.FindAssets("t:AuraQualitySettings").Length)
            //{
            //    PopulateExistingQualitySettingsPresetsList();
            //}

            if (_foundQualitySettingsPresets.Count > 0)
            {
                EditorGUI.BeginChangeCheck();
                EditorGUILayout.BeginHorizontal();
                GUILayout.Label("Select Existing", GuiStyles.Label, GUILayout.MaxWidth(96));
                _selectedQualitySettingsPresetId = EditorGUILayout.Popup(_selectedQualitySettingsPresetId, _foundQualitySettingsPresetsName);
                EditorGUILayout.EndHorizontal();
                if (EditorGUI.EndChangeCheck())
                {
                    _currentAuraComponent.frustumSettings.LoadQualitySettings(AssetDatabase.LoadAssetAtPath <AuraQualitySettings>(_foundQualitySettingsPresets[_selectedQualitySettingsPresetId]));
                    PopulateExistingQualitySettingsPresetsList();
                }

                EditorGUILayout.Separator();
                EditorGUILayout.Separator();
            }

            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("Preset File", GuiStyles.Label, GUILayout.MaxWidth(80));
            EditorGUILayout.PropertyField(_qualitySettingsProperty, new GUIContent(""));
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            EditorGUILayout.BeginHorizontal();
            //if (GUILayout.Button(new GUIContent("Load Existing", Aura.AuraResourcesCollection.loadIconTexture, "Loads an existing preset file"), GuiStyles.ButtonBigNoBorder))
            //{
            //    _currentAuraComponent.frustumSettings.LoadQualitySettings();
            //}
            //GUILayout.Space(8);
            if (GUILayout.Button(new GUIContent("Save As New Preset", Aura.ResourcesCollection.saveIconTexture, "Saves the current settings in a new file"), GuiStyles.ButtonBigNoBorder))
            {
                _currentAuraComponent.frustumSettings.SaveQualitySettings();
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            EditorGUILayout.EndVertical();

            EditorGUILayout.Separator();
            EditorGUILayout.Separator();
            EditorGUILayout.Separator();

            SerializedObject qualitySettingsObject = new SerializedObject(_currentAuraComponent.frustumSettings.QualitySettings);

            AuraQualitySettingsEditor.DrawCustomEditor(qualitySettingsObject, _currentAuraComponent, false, true);

            EditorGUILayout.EndVertical();

            EditorGUILayout.Separator();
        }