示例#1
0
        /// <summary>
        /// Displays the content of the base injection tab
        /// </summary>
        private void DisplayBaseInjectionArea()
        {
            EditorGUILayout.BeginVertical(EditorStyles.miniButton);

            GUILayout.Button(new GUIContent(" Ambient Injection", injectionIconTexture), GuiStyles.areaTitleBarStyle);
            GuiHelpers.DrawContextualHelpBox("The \"Ambient Injection\" parameters set the starting Density, Color and Anisotropy of the environment.");

            EditorGUILayout.BeginVertical();

            EditorGUILayout.Separator();

            GuiHelpers.DrawPositiveOnlyFloatField(ref _baseDensityProperty, "Ambient Density");

            EditorGUILayout.Separator();

            GuiHelpers.DrawSlider(ref _baseAnisotropyProperty, 0, 1, "Ambient Anisotropy");

            EditorGUILayout.Separator();

            EditorGUILayout.LabelField("Ambient Light");
            EditorGUILayout.PropertyField(_baseColorProperty);

            GuiHelpers.DrawPositiveOnlyFloatField(ref _baseColorStrengthProperty, "Ambient Light Strength");

            EditorGUILayout.Separator();

            EditorGUILayout.EndVertical();

            EditorGUILayout.EndVertical();

            EditorGUILayout.Separator();
        }
示例#2
0
        /// <summary>
        /// Displays distance fadeout parameters for spot/point lights
        /// </summary>
        private void DisplayLightDistanceAttenuationParameters()
        {
            EditorGUILayout.BeginVertical();

            EditorGUILayout.LabelField("Distance Attenuation", EditorStyles.boldLabel);

            GuiHelpers.DrawContextualHelpBox("The \"Threshold\" parameter is the normalized distance when the fade will start, until 1.");
            GuiHelpers.DrawSlider(ref _customDistanceFalloffThresholdProperty, 0.0f, 1.0f, "Threshold");

            GuiHelpers.DrawContextualHelpBox("The \"Exponent\" parameter is the curve of the fading.");
            GuiHelpers.DrawPositiveOnlyFloatField(ref _customDistanceFalloffPowerProperty, "Exponent");

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

            EditorGUILayout.EndVertical();
        }
示例#3
0
        /// <summary>
        /// Displays distance fadein parameters for spot/point lights' cookies
        /// </summary>
        private void DisplayCookieDistanceAttenuationParameters()
        {
            EditorGUILayout.BeginVertical();

            EditorGUILayout.LabelField("Cookie Fade-In Attenuation", EditorStyles.boldLabel);

            GuiHelpers.DrawContextualHelpBox("The \"Thresholds\" parameters are the normalized range where the cookie will fade in.");
            GuiHelpers.DrawMinMaxSlider(ref _customCookieDistanceFalloffLowThresholdProperty, ref _customCookieDistanceFalloffHiThresholdProperty, 0.0f, 1.0f, "Fade-In Thresholds");

            GuiHelpers.DrawContextualHelpBox("The \"Exponent\" parameter is the curve of the fading.");
            GuiHelpers.DrawPositiveOnlyFloatField(ref _customCookieDistanceFalloffPowerProperty, "Exponent");

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

            EditorGUILayout.EndVertical();
        }
        /// <summary>
        /// Displays Shape Settings Area
        /// </summary>
        private void DisplayShapeSettingsArea()
        {
            EditorGUILayout.BeginVertical();

            GUILayout.Button(new GUIContent(" Volume Shape", volumeShapeIconTexture), GuiStyles.areaTitleBarStyle);
            GuiHelpers.DrawContextualHelpBox("The \"Shape\" parameter allows you to define the volumetric shape of the volume used for injecting Density, Color or Anisotropy.\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.BeginVertical();

            EditorGUILayout.Separator();

            EditorGUILayout.PropertyField(_volumeShapeProperty, new GUIContent("Shape of the volume"));

            if ((VolumeTypeEnum)_volumeShapeProperty.enumValueIndex != VolumeTypeEnum.Global)
            {
                GUILayout.Button("Parameters", EditorStyles.boldLabel);
                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                switch ((VolumeTypeEnum)_volumeShapeProperty.enumValueIndex)
                {
                case VolumeTypeEnum.Box:
                {
                    GuiHelpers.DrawMinMaxSlider(ref _xNegativeCubeFadeProperty, ref _xPositiveCubeFadeProperty, 0, 1, "Width border attenuation", true);
                    GuiHelpers.DrawMinMaxSlider(ref _yNegativeCubeFadeProperty, ref _yPositiveCubeFadeProperty, 0, 1, "Height border attenuation", true);
                    GuiHelpers.DrawMinMaxSlider(ref _zNegativeCubeFadeProperty, ref _zPositiveCubeFadeProperty, 0, 1, "Depth border attenuation", true);
                }
                break;

                case VolumeTypeEnum.Cone:
                {
                    GuiHelpers.DrawSlider(ref _angularConeFadeProperty, 0, 1, "Angular border attenuation", true);
                    GuiHelpers.DrawSlider(ref _distanceConeFadeProperty, 0, 1, "Distance border attenuation", true);
                }
                break;

                case VolumeTypeEnum.Cylinder:
                {
                    GuiHelpers.DrawSlider(ref _widthCylinderFadeProperty, 0, 1, "Width border attenuation", true);
                    GuiHelpers.DrawMinMaxSlider(ref _yNegativeCylinderFadeProperty, ref _yPositiveCylinderFadeProperty, 0, 1, "Height border attenuation", true);
                }
                break;

                case VolumeTypeEnum.Planar:
                {
                    GuiHelpers.DrawSlider(ref _heightPlaneFadeProperty, 0, 1, "Height attenuation");
                }
                break;

                case VolumeTypeEnum.Sphere:
                {
                    GuiHelpers.DrawSlider(ref _distanceSphereFadeProperty, 0, 1, "Distance attenuation", true);
                }
                break;
                }

                EditorGUILayout.Separator();

                GuiHelpers.DrawPositiveOnlyFloatField(ref _falloffFadeProperty, "Falloff Exponent");

                EditorGUILayout.EndVertical();
            }

            EditorGUILayout.Separator();

            EditorGUILayout.EndVertical();

            EditorGUILayout.EndVertical();
        }
示例#5
0
        /// <summary>
        /// Displays the content of the settings tab
        /// </summary>
        private void DisplaySettingsTab()
        {
            EditorGUILayout.BeginVertical(EditorStyles.miniButton);
            GUILayout.Button(new GUIContent(" Grid", gridIconTexture), GuiStyles.areaTitleBarStyle);
            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.BeginVertical();

            EditorGUILayout.Separator();

            _gridSettingsResolutionProperty.FindPropertyRelative("x").intValue = EditorGUILayout.IntField("Horizontal", _gridSettingsResolutionProperty.FindPropertyRelative("x").intValue);
            _gridSettingsResolutionProperty.FindPropertyRelative("y").intValue = EditorGUILayout.IntField("Vertical", _gridSettingsResolutionProperty.FindPropertyRelative("y").intValue);
            _gridSettingsResolutionProperty.FindPropertyRelative("z").intValue = EditorGUILayout.IntField("Depth", _gridSettingsResolutionProperty.FindPropertyRelative("z").intValue);
            if (GUILayout.Button("Set Resolution"))
            {
                ((Aura)serializedObject.targetObject).frustum.SetResolution(((Aura)serializedObject.targetObject).frustum.settings.resolution);
            }

            EditorGUILayout.Separator();

            GuiHelpers.DrawPositiveOnlyFloatField(ref _gridSettingsFarPlaneProperty, "Range");
            if (_gridSettingsFarPlaneProperty.floatValue < Aura.CameraComponent.nearClipPlane)
            {
                EditorGUILayout.HelpBox("\nATTENTION : \nRange must be bigger than the camera near clip distance.\n", MessageType.Warning);
            }

            EditorGUILayout.Separator();

            EditorGUILayout.EndVertical();

            EditorGUILayout.EndVertical();

            EditorGUILayout.Separator();

            EditorGUILayout.BeginVertical(EditorStyles.miniButton);
            GUILayout.Button(new GUIContent(" Contibution", injectionContributionIconTexture), GuiStyles.areaTitleBarStyle);
            GuiHelpers.DrawContextualHelpBox("The \"Selective Contribution\" parameters allow you to enable/disable what type of contribution will be allowed to be computed.\n\nNote that the existence of the different contributions are handled by the system at runtime.");

            EditorGUILayout.BeginVertical();

            EditorGUILayout.Separator();

            _applyAsPostProcessProperty.boolValue = EditorGUILayout.ToggleLeft("Apply as PostProcess", _applyAsPostProcessProperty.boolValue);

            //EditorGUILayout.Separator();
            //
            //executeInEditModeProperty.boolValue = EditorGUILayout.ToggleLeft("Execute in Edit Mode", executeInEditModeProperty.boolValue);

            EditorGUILayout.Separator();

            _enableVolumesProperty.boolValue            = EditorGUILayout.BeginToggleGroup("Enable Volumes", _enableVolumesProperty.boolValue);
            _enableVolumesTextureMaskProperty.boolValue = EditorGUILayout.ToggleLeft("Enable Texture Mask", _enableVolumesTextureMaskProperty.boolValue);
            _enableVolumesNoiseMaskProperty.boolValue   = EditorGUILayout.ToggleLeft("Enable Noise Mask", _enableVolumesNoiseMaskProperty.boolValue);
            EditorGUILayout.EndToggleGroup();

            EditorGUILayout.Separator();

            _enableDirectionalLightsProperty.boolValue        = EditorGUILayout.BeginToggleGroup("Enable Directional Lights", _enableDirectionalLightsProperty.boolValue);
            _enableDirectionalLightsShadowsProperty.boolValue = EditorGUILayout.ToggleLeft("Enable Shadows", _enableDirectionalLightsShadowsProperty.boolValue);
            EditorGUILayout.EndToggleGroup();

            EditorGUILayout.Separator();

            _enableSpotLightsProperty.boolValue        = EditorGUILayout.BeginToggleGroup("Enable Spot Lights", _enableSpotLightsProperty.boolValue);
            _enableSpotLightsShadowsProperty.boolValue = EditorGUILayout.ToggleLeft("Enable Shadows", _enableSpotLightsShadowsProperty.boolValue);
            EditorGUILayout.EndToggleGroup();

            EditorGUILayout.Separator();

            _enablePointLightsProperty.boolValue        = EditorGUILayout.BeginToggleGroup("Enable Point Lights", _enablePointLightsProperty.boolValue);
            _enablePointLightsShadowsProperty.boolValue = EditorGUILayout.ToggleLeft("Enable Shadows", _enablePointLightsShadowsProperty.boolValue);
            EditorGUILayout.EndToggleGroup();

            EditorGUILayout.Separator();

            EditorGUI.BeginDisabledGroup(!_enableSpotLightsProperty.boolValue && !_enableSpotLightsProperty.boolValue && !_enableDirectionalLightsProperty.boolValue);
            _enableLightsCookiesProperty.boolValue = EditorGUILayout.ToggleLeft("Enable Cookies", _enableLightsCookiesProperty.boolValue);
            EditorGUI.EndDisabledGroup();

            EditorGUILayout.Separator();

            EditorGUILayout.EndVertical();

            EditorGUILayout.EndVertical();

            EditorGUILayout.Separator();

            EditorGUILayout.BeginVertical(EditorStyles.miniButton);
            GUILayout.Button(new GUIContent(" Experimental Features", experimentalFeaturesIconTexture), GuiStyles.areaTitleBarStyle);
            EditorGUILayout.HelpBox("\nATTENTION : \n\nThe following features are still at experimental stage.\n\nThis means that, although stable, they can lead to visual artifacts.\n\nFeel free to contact me if you have any comment about them.\n", MessageType.Warning);

            EditorGUILayout.BeginVertical();

            EditorGUILayout.Separator();

            _enableOcclusionCullingProperty.boolValue = EditorGUILayout.BeginToggleGroup("Enable Occlusion Culling", _enableOcclusionCullingProperty.boolValue);
            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.");
            EditorGUILayout.PropertyField(_occlusionCullingAccuracyProperty, new GUIContent("Accuracy"));
            EditorGUILayout.EndToggleGroup();

            EditorGUILayout.Separator();

            _enableTemporalReprojectionProperty.boolValue = EditorGUILayout.BeginToggleGroup("Enable Reprojection", _enableTemporalReprojectionProperty.boolValue);
            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.DrawSlider(ref _temporalReprojectionFactorProperty, 0, 1, "Reprojector factor");
            EditorGUILayout.EndToggleGroup();

            EditorGUILayout.Separator();

            EditorGUILayout.EndVertical();

            EditorGUILayout.EndVertical();

            EditorGUILayout.Separator();
        }