/// <summary>
 /// Displays Texture3D Mask Area
 /// </summary>
 private void DisplayTexture3DMaskArea()
 {
     EditorGUILayout.BeginVertical(GuiStyles.Background);
     GuiHelpers.DrawToggleChecker(ref _texture3DMaskBoolProperty, new GUIContent("Texture3D Mask", Aura.ResourcesCollection.texture3DIconTexture, "The \"Texture Mask\" allows to assign a texture mask to the volume.\nRGB -> Will multiply the \"Strength\" parameter of the Color Injection.\nA -> Will multiply the \"Strength\" parameter of the Density and Scattering Injection"), true, true);
     if (_texture3DMaskBoolProperty.boolValue)
     {
         //EditorGUI.BeginDisabledGroup(!_texture3DMaskBoolProperty.boolValue);
         EditorGUILayout.BeginVertical(GuiStyles.EmptyMiddleAligned);
         GUILayout.Label(new GUIContent(" Experimental Feature (PREVIEW)", Aura.ResourcesCollection.experimentalIconTexture), GuiStyles.LabelBoldCentered);
         EditorGUILayout.BeginHorizontal();
         GUILayout.Label("Texture3D Mask", GuiStyles.Label, GUILayout.MaxWidth(100));
         EditorGUILayout.PropertyField(_texture3DMaskTextureProperty, new GUIContent(""));
         EditorGUILayout.EndHorizontal();
         Texture3D textureMask = (Texture3D)_texture3DMaskTextureProperty.objectReferenceValue;
         if (textureMask != null)
         {
             if (textureMask.width != VolumesCommonDataManager.texture3DMaskSize || textureMask.height != VolumesCommonDataManager.texture3DMaskSize || textureMask.depth != VolumesCommonDataManager.texture3DMaskSize)
             {
                 GuiHelpers.DrawHelpBox("The Texture3D mask \"" + textureMask.name + "\" of \"" + _currentVolume.name + "\" volume is not of the required size, which is " + VolumesCommonDataManager.texture3DMaskSize + "³", HelpBoxType.Warning);
             }
         }
         EditorGUILayout.Separator();
         EditorGUILayout.Separator();
         GuiHelpers.DrawTransformField(ref _texture3DMaskTransformProperty);
         EditorGUILayout.EndVertical();
         //EditorGUI.EndDisabledGroup();
     }
     EditorGUILayout.EndVertical();
 }
示例#2
0
        /// <summary>
        /// Draws the settings area
        /// </summary>
        private void DisplayEditionSettingsArea()
        {
            EditorGUILayout.BeginVertical(GuiStyles.Background);
            GUILayout.Label(new GUIContent(" Edition Settings", Aura.ResourcesCollection.settingsIconTexture), GuiStyles.LabelBoldCenteredBig);
            EditorGUILayout.Separator();
            EditorGUI.BeginChangeCheck();
            AuraEditorPrefs.DisplayCameraSlicesInEdition = GuiHelpers.DrawToggleChecker(AuraEditorPrefs.DisplayCameraSlicesInEdition, " Show slices on Cameras when selected");
            if (EditorGUI.EndChangeCheck())
            {
                SceneView.RepaintAll();
            }
            EditorGUILayout.Separator();
            //EditorGUI.BeginChangeCheck();
            EditorGUI.BeginDisabledGroup(true);
            GuiHelpers.DrawToggleChecker(AuraEditorPrefs.DisplayAuraGuiInParentComponents, " Display Aura buttons in Camera/Light components");
            EditorGUI.EndDisabledGroup();
            //if (EditorGUI.EndChangeCheck())
            //{
            //    AuraEditorPrefs.DisplayAuraGuiInParentComponents = !AuraEditorPrefs.DisplayAuraGuiInParentComponents;
            //}
            EditorGUILayout.Separator();
            EditorGUI.BeginChangeCheck();
            GuiHelpers.DrawToggleChecker(AuraEditorPrefs.DisplayGizmosOnCameras, " Display gizmos on Cameras");
            if (EditorGUI.EndChangeCheck())
            {
                AuraEditorPrefs.DisplayGizmosOnCameras = !AuraEditorPrefs.DisplayGizmosOnCameras;
            }
            EditorGUILayout.Separator();
            EditorGUI.BeginChangeCheck();
            GuiHelpers.DrawToggleChecker(AuraEditorPrefs.DisplayGizmosOnLights, " Display gizmos on Lights");
            if (EditorGUI.EndChangeCheck())
            {
                AuraEditorPrefs.DisplayGizmosOnLights = !AuraEditorPrefs.DisplayGizmosOnLights;
            }
            EditorGUILayout.Separator();
            EditorGUI.BeginChangeCheck();
            GuiHelpers.DrawToggleChecker(AuraEditorPrefs.DisplayGizmosOnVolumes, " Display gizmos on Volumes");
            if (EditorGUI.EndChangeCheck())
            {
                AuraEditorPrefs.DisplayGizmosOnVolumes = !AuraEditorPrefs.DisplayGizmosOnVolumes;
            }
            EditorGUILayout.Separator();
            EditorGUI.BeginChangeCheck();
            GuiHelpers.DrawToggleChecker(AuraEditorPrefs.DisplayGizmosWhenSelected, " Display gizmos when objects are selected");
            if (EditorGUI.EndChangeCheck())
            {
                AuraEditorPrefs.DisplayGizmosWhenSelected = !AuraEditorPrefs.DisplayGizmosWhenSelected;
            }
            EditorGUILayout.Separator();
            EditorGUI.BeginChangeCheck();
            GuiHelpers.DrawToggleChecker(AuraEditorPrefs.DisplayGizmosWhenUnselected, " Display gizmos when objects are unselected");
            if (EditorGUI.EndChangeCheck())
            {
                AuraEditorPrefs.DisplayGizmosWhenUnselected = !AuraEditorPrefs.DisplayGizmosWhenUnselected;
            }
            EditorGUILayout.Separator();
            EditorGUI.BeginChangeCheck();
            GuiHelpers.DrawToggleChecker(AuraEditorPrefs.DisplayButtonsInHierarchy, " Display buttons in the hierarchy");
            if (EditorGUI.EndChangeCheck())
            {
                AuraEditorPrefs.DisplayButtonsInHierarchy = !AuraEditorPrefs.DisplayButtonsInHierarchy;
            }
            EditorGUILayout.EndVertical();

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

            EditorGUILayout.BeginVertical(GuiStyles.Background);
            GUILayout.Label(new GUIContent(" Toolbox Settings", Aura.ResourcesCollection.debugIconTexture), GuiStyles.LabelBoldCenteredBig);
            EditorGUILayout.Separator();
            EditorGUI.BeginChangeCheck();
            EditorGUI.BeginChangeCheck();
            GuiHelpers.DrawToggleChecker(SceneViewToolbox.IsVisible, " Display Toolbox");
            if (EditorGUI.EndChangeCheck())
            {
                SceneViewToolbox.Display(!SceneViewToolbox.IsVisible);
            }
            EditorGUILayout.Separator();
            EditorGUI.BeginChangeCheck();
            GuiHelpers.DrawToggleChecker(SceneViewToolbox.IsExpanded, " Expand Toolbox");
            if (EditorGUI.EndChangeCheck())
            {
                SceneViewToolbox.Expand(!SceneViewToolbox.IsExpanded);
            }
            EditorGUILayout.Separator();
            EditorGUILayout.Separator();
            EditorGUILayout.BeginHorizontal();
            if (GUILayout.Button("Display Toolbox on Left", AuraEditorPrefs.ToolboxPosition == 0 ? GuiStyles.ButtonPressed : GuiStyles.Button))
            {
                AuraEditorPrefs.ToolboxPosition = 0;
            }
            if (GUILayout.Button("Display Toolbox on Right", AuraEditorPrefs.ToolboxPosition == 1 ? GuiStyles.ButtonPressed : GuiStyles.Button))
            {
                AuraEditorPrefs.ToolboxPosition = 1;
            }
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.Separator();
            EditorGUILayout.Separator();
            AuraEditorPrefs.DisplayDebugPanelInToolbox = GuiHelpers.DrawToggleChecker(AuraEditorPrefs.DisplayDebugPanelInToolbox, " Show DEBUG panel");
            EditorGUILayout.Separator();
            EditorGUI.BeginChangeCheck();
            GuiHelpers.DrawToggleChecker(SceneViewToolbox.DisplayNotifications, " Display Notifications");
            if (EditorGUI.EndChangeCheck())
            {
                SceneViewToolbox.DisplayNotifications = !SceneViewToolbox.DisplayNotifications;
            }
            EditorGUILayout.Separator();
            EditorGUI.BeginChangeCheck();
            GuiHelpers.DrawToggleChecker(SceneViewToolbox.EnableAnimations, " Enable Animations");
            if (EditorGUI.EndChangeCheck())
            {
                SceneViewToolbox.EnableAnimations = !SceneViewToolbox.EnableAnimations;
            }
            EditorGUILayout.Separator();
            EditorGUILayout.Separator();
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.BeginVertical(GUILayout.MaxWidth(160));
            GUILayout.Space(6);
            GUILayout.Label("Presets Previews Layout", GuiStyles.Label);
            EditorGUILayout.EndVertical();
            if (GUILayout.Button(new GUIContent("List", Aura.ResourcesCollection.listIconTexture), SceneViewToolbox.PresetsPreviewsPerRow == 1 ? GuiStyles.ButtonPressedNoBorder : GuiStyles.ButtonNoBorder))
            {
                SceneViewToolbox.PresetsPreviewsPerRow = 1;
            }
            if (GUILayout.Button(new GUIContent("Grid", Aura.ResourcesCollection.gridIconTexture), SceneViewToolbox.PresetsPreviewsPerRow == 2 ? GuiStyles.ButtonPressedNoBorder : GuiStyles.ButtonNoBorder))
            {
                SceneViewToolbox.PresetsPreviewsPerRow = 2;
            }
            EditorGUILayout.EndHorizontal();
            if (EditorGUI.EndChangeCheck())
            {
                SceneView.RepaintAll();
            }
            EditorGUILayout.Separator();
            EditorGUILayout.EndVertical();

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

            EditorGUILayout.BeginVertical(GuiStyles.Background);
            GUILayout.Label(new GUIContent(" SceneView Visualization", Aura.ResourcesCollection.cameraIconTexture), GuiStyles.LabelBoldCenteredBig);
            EditorGUILayout.Separator();
            EditorGUI.BeginChangeCheck();

            AuraEditorPrefs.EnableAuraInSceneView = GuiHelpers.DrawToggleChecker(AuraEditorPrefs.EnableAuraInSceneView, "Enable visualization in SceneView");

            EditorGUILayout.Separator();
            GuiHelpers.DrawHelpBox("Enabling Aura in the SceneView may break the SceneView rendering when loading a scene or building player.\n\nTo get the SceneView rendering back, <b>disable then re-enable back</b> post-effects rendering in the toggle dropdown located in the top border of the SceneView.", HelpBoxType.Experimental);
            EditorGUILayout.Separator();

            if (EditorGUI.EndChangeCheck())
            {
                if (AuraEditorPrefs.EnableAuraInSceneView)
                {
                    SceneViewVisualization.EnableAuraInSceneView();
                }
                else
                {
                    SceneViewVisualization.DisableAuraInSceneView();
                }
            }

            EditorGUI.BeginDisabledGroup(!AuraEditorPrefs.EnableAuraInSceneView);
            AuraQualitySettingsEditor.DrawCustomEditor(EditionCameraQualitySettingsObject, null, false, true);
            EditorGUI.EndDisabledGroup();

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

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

            EditorGUILayout.BeginVertical(GuiStyles.Background);
            GUILayout.Label(new GUIContent(" Introduction Screens", Aura.ResourcesCollection.questionIconTexture), GuiStyles.LabelBoldCenteredBig);
            EditorGUILayout.Separator();
            if (GUILayout.Button("Show Main Introduction Screen", GuiStyles.Button))
            {
                AuraEditorPrefs.DisplayMainIntroductionScreen = true;
                SceneView.RepaintAll();
            }
            EditorGUILayout.Separator();
            EditorGUILayout.Separator();
            if (GUILayout.Button("Show Camera Introduction Screen", GuiStyles.Button))
            {
                AuraEditorPrefs.DisplayCameraIntroductionScreen = true;
                SceneView.RepaintAll();
            }
            EditorGUILayout.Separator();
            EditorGUILayout.Separator();
            if (GUILayout.Button("Show Light Introduction Screen", GuiStyles.Button))
            {
                AuraEditorPrefs.DisplayLightIntroductionScreen = true;
                SceneView.RepaintAll();
            }
            EditorGUILayout.Separator();
            EditorGUILayout.Separator();
            if (GUILayout.Button("Show Volume Introduction Screen", GuiStyles.Button))
            {
                AuraEditorPrefs.DisplayVolumeIntroductionScreen = true;
                SceneView.RepaintAll();
            }
            EditorGUILayout.Separator();
            EditorGUILayout.EndVertical();
        }
示例#3
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();
        }
示例#5
0
        private void OnGUI()
        {
            _scrollPosition = EditorGUILayout.BeginScrollView(_scrollPosition);

            EditorGUILayout.BeginVertical(GuiStyles.Background);
            EditorGUILayout.Separator();
            EditorGUILayout.BeginVertical(GuiStyles.ButtonNoHover);
            EditorGUILayout.Separator();

            EditorGUILayout.BeginHorizontal(GuiStyles.BackgroundNoBorder);
            EditorGUILayout.LabelField(new GUIContent(" Aura <b>Texture3D Tool</b>", Aura.ResourcesCollection.logoIconTexture), new GUIStyle(GuiStyles.LabelCenteredBig)
            {
                fontSize = 24
            });
            EditorGUILayout.EndHorizontal();

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

            EditorGUILayout.Separator();

            EditorGUILayout.BeginVertical(GuiStyles.Background);
            GUILayout.Label(new GUIContent(" Create Texture3D", Aura.ResourcesCollection.texture3DIconTexture, "Create a composite Texture3D from a Texture2D"), GuiStyles.LabelBoldCenteredBig);
            EditorGUILayout.Separator();

            EditorGUILayout.BeginHorizontal();
            GUILayout.Label(new GUIContent("Source Texture2D", "Source texture used to build the Texture3D"), GuiStyles.Label);
            _sourceTexture = (Texture2D)EditorGUILayout.ObjectField(_sourceTexture, typeof(Texture2D), false);
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.Separator();

            if (_sourceTexture != null)
            {
                _sourceTexturePath = AssetDatabase.GetAssetPath(_sourceTexture);
                TextureImporter textureImporter = (TextureImporter)AssetImporter.GetAtPath(_sourceTexturePath);

                if (textureImporter.isReadable)
                {
                    if (textureImporter.textureCompression == TextureImporterCompression.Uncompressed)
                    {
                        EditorGUILayout.Separator();

                        _referenceSize = EditorGUILayout.DelayedIntField(new GUIContent("Reference Size", "Target size of the 3D texture"), _referenceSize);
                        _referenceSize = Mathf.Max(_referenceSize, 2);
                        _referenceSize = Mathf.ClosestPowerOfTwo(_referenceSize);

                        EditorGUILayout.Separator();

                        GuiHelpers.DrawHelpBox("Horizontal tiles count : " + HorizontalTilesCount + "\nVertical tiles count : " + VerticalTilesCount + "\n\nTotal amount of tiles : " + TotalTilesCount, HelpBoxType.Question);

                        EditorGUILayout.Separator();

                        if (AreParametersValid)
                        {
                            EditorGUILayout.BeginHorizontal();
                            GUILayout.Label(new GUIContent("Reading Order", "The order of which the tiles should be assembled to create the 3D texture (should we assemble line by line or column by column?)"), GuiStyles.Label);
                            _readingOrder = (Texture2DReadingOrder)EditorGUILayout.EnumPopup(_readingOrder);
                            EditorGUILayout.EndHorizontal();

                            EditorGUILayout.Separator();

                            if (GUILayout.Button(new GUIContent("Generate", "Generates a new Texture3D from the source texture"), GuiStyles.ButtonBigBold))
                            {
                                GenerateVolumetricTexture(_sourceTexture);
                            }
                        }
                        else
                        {
                            GuiHelpers.DrawHelpBox("The total amount of tiles should be equal to the reference tile size.\nIn this case : " + _referenceSize, HelpBoxType.Warning);
                        }
                    }
                    else
                    {
                        GuiHelpers.DrawHelpBox("The source Texture2D asset should not use texture compression", HelpBoxType.Warning);
                        EditorGUILayout.Separator();
                        if (GUILayout.Button(new GUIContent("Disable texture compression"), GuiStyles.ButtonBigBold))
                        {
                            textureImporter.textureCompression = TextureImporterCompression.Uncompressed;
                            textureImporter.SaveAndReimport();
                        }
                    }
                }
                else
                {
                    GuiHelpers.DrawHelpBox("The source Texture2D asset should be marked as \"READABLE\"", HelpBoxType.Warning);
                    EditorGUILayout.Separator();
                    if (GUILayout.Button(new GUIContent("Mark As \"READABLE\""), GuiStyles.ButtonBigBold))
                    {
                        textureImporter.isReadable = true;
                        textureImporter.SaveAndReimport();
                    }
                }

                EditorGUILayout.Separator();
            }

            EditorGUILayout.EndVertical();

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

            EditorGUILayout.EndScrollView();
        }