static void Drawer_InfluenceShapeBoxSettings(HDReflectionProbeUI s, SerializedHDReflectionProbe p, Editor owner)
        {
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PropertyField(p.boxSize, CoreEditorUtils.GetContent("Box Size|The size of the box in which the reflections will be applied to objects. The value is not affected by the Transform of the Game Object."));
            if (GUILayout.Button(toolbar_Contents[0], GUILayout.Width(28f), GUILayout.Height(EditorGUIUtility.singleLineHeight + 3)))
            {
                EditMode.ChangeEditMode(EditMode.SceneViewEditMode.ReflectionProbeBox, GetBoundsGetter(p)(), owner);
            }
            EditorGUILayout.EndHorizontal();


            EditorGUI.BeginChangeCheck();
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PropertyField(p.boxOffset, CoreEditorUtils.GetContent("Box Offset|The center of the box in which the reflections will be applied to objects. The value is relative to the position of the Game Object."));
            if (GUILayout.Button(toolbar_Contents[3], GUILayout.Width(28f), GUILayout.Height(EditorGUIUtility.singleLineHeight + 3)))
            {
                EditMode.ChangeEditMode(EditMode.SceneViewEditMode.ReflectionProbeOrigin, GetBoundsGetter(p)(), owner);
            }
            EditorGUILayout.EndHorizontal();
            if (EditorGUI.EndChangeCheck())
            {
                var center = p.boxOffset.vector3Value;
                var size   = p.boxSize.vector3Value;
                if (HDReflectionProbeEditorUtility.ValidateAABB(p.target, ref center, ref size))
                {
                    //clamp to contains object center instead of resizing
                    Vector3 projector = (center - p.boxOffset.vector3Value).normalized;
                    p.boxOffset.vector3Value = center + Mathf.Abs(Vector3.Dot((p.boxSize.vector3Value - size) * .5f, projector)) * projector;
                }
            }
        }
Example #2
0
        public override void OnInspectorGUI()
        {
            OnCommonInspectorGUI();

            OnHiZInspectorGUI();
            PropertyField(m_MinSmoothness, CoreEditorUtils.GetContent("Min Smoothness|Minimal value of smoothness at which SSR is activated."));
        }
        static void Drawer_InfluenceAdvancedSwitch(InfluenceVolumeUI s, SerializedInfluenceVolume d, Editor owner)
        {
            using (new EditorGUILayout.HorizontalScope())
            {
                GUILayout.FlexibleSpace();

                bool advanced = d.editorAdvancedModeEnabled.boolValue;
                advanced = !GUILayout.Toggle(!advanced, CoreEditorUtils.GetContent("Normal|Normal parameters mode (only change for box shape)."), EditorStyles.miniButtonLeft, GUILayout.Width(60f), GUILayout.ExpandWidth(false));
                advanced = GUILayout.Toggle(advanced, CoreEditorUtils.GetContent("Advanced|Advanced parameters mode (only change for box shape)."), EditorStyles.miniButtonRight, GUILayout.Width(60f), GUILayout.ExpandWidth(false));
                s.boxInfluenceHandle.allHandleControledByOne = s.boxInfluenceNormalHandle.allHandleControledByOne = !advanced;
                if (d.editorAdvancedModeEnabled.boolValue ^ advanced)
                {
                    d.editorAdvancedModeEnabled.boolValue = advanced;
                    if (advanced)
                    {
                        d.boxInfluencePositiveFade.vector3Value       = d.editorAdvancedModeBlendDistancePositive.vector3Value;
                        d.boxInfluenceNegativeFade.vector3Value       = d.editorAdvancedModeBlendDistanceNegative.vector3Value;
                        d.boxInfluenceNormalPositiveFade.vector3Value = d.editorAdvancedModeBlendNormalDistancePositive.vector3Value;
                        d.boxInfluenceNormalNegativeFade.vector3Value = d.editorAdvancedModeBlendNormalDistanceNegative.vector3Value;
                    }
                    else
                    {
                        d.boxInfluenceNegativeFade.vector3Value       = d.boxInfluencePositiveFade.vector3Value = Vector3.one * d.editorSimplifiedModeBlendDistance.floatValue;
                        d.boxInfluenceNormalNegativeFade.vector3Value = d.boxInfluenceNormalPositiveFade.vector3Value = Vector3.one * d.editorSimplifiedModeBlendNormalDistance.floatValue;
                    }
                    d.Apply();
                }
            }
        }
        void OverridesHeaders()
        {
            using (new EditorGUILayout.HorizontalScope())
            {
                GUILayoutUtility.GetRect(0f, 17f, GUILayout.ExpandWidth(false));
                if (GUILayout.Button(CoreEditorUtils.GetContent("All|Toggle all overrides on. To maximize performances you should only toggle overrides that you actually need."), CoreEditorStyles.miniLabelButton, GUILayout.Width(17f), GUILayout.ExpandWidth(false)))
                {
                    foreach (var field in fields)
                    {
                        if (field.enabled)
                        {
                            field.setter(true);
                        }
                    }
                }

                if (GUILayout.Button(CoreEditorUtils.GetContent("None|Toggle all overrides off."), CoreEditorStyles.miniLabelButton, GUILayout.Width(32f), GUILayout.ExpandWidth(false)))
                {
                    foreach (var field in fields)
                    {
                        if (field.enabled)
                        {
                            field.setter(false);
                        }
                    }
                }

                GUILayout.FlexibleSpace();
            }
        }
Example #5
0
        public override void OnInspectorGUI()
        {
            PropertyField(m_MaxShadowDistance, CoreEditorUtils.GetContent("Max Distance"));

            EditorGUILayout.Space();
            PropertyField(m_CascadeShadowSplitCount, CoreEditorUtils.GetContent("Cascade Count"));

            if (!m_CascadeShadowSplitCount.value.hasMultipleDifferentValues)
            {
                EditorGUI.indentLevel++;
                int splitCount = m_CascadeShadowSplitCount.value.intValue;
                for (int i = 0; i < splitCount - 1; i++)
                {
                    PropertyField(m_CascadeShadowSplits[i], CoreEditorUtils.GetContent(string.Format("Split {0}", i + 1)));
                }

                if (LightLoop.s_UseCascadeBorders)
                {
                    EditorGUILayout.Space();

                    for (int i = 0; i < splitCount; i++)
                    {
                        PropertyField(m_CascadeShadowBorders[i], CoreEditorUtils.GetContent(string.Format("Border {0}", i + 1)));
                    }
                }
                EditorGUI.indentLevel--;
            }
        }
        static void Drawer_SectionShapeBox(InfluenceVolumeUI s, SerializedInfluenceVolume d, Editor o)
        {
            bool advanced        = d.editorAdvancedModeEnabled.boolValue;
            var  maxFadeDistance = d.boxBaseSize.vector3Value * 0.5f;
            var  minFadeDistance = Vector3.zero;

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PropertyField(d.boxBaseSize, _.GetContent("Box Size"));
            PlanarReflectionProbeUI.Drawer_ToolBarButton(0, o, GUILayout.Width(28f), GUILayout.MinHeight(22f));
            EditorGUILayout.EndHorizontal();

            //offset have no meaning for planar reflexion probe
            //EditorGUILayout.PropertyField(d.boxBaseOffset, _.GetContent("Box Offset"));

            EditorGUILayout.BeginHorizontal();
            Drawer_AdvancedBlendDistance(
                d,
                false,
                maxFadeDistance,
                CoreEditorUtils.GetContent("Blend Distance|Area around the probe where it is blended with other probes. Only used in deferred probes.")
                );
            PlanarReflectionProbeUI.Drawer_ToolBarButton(1, o, GUILayout.ExpandHeight(true), GUILayout.Width(28f), GUILayout.MinHeight(22f), GUILayout.MaxHeight((advanced ? 3 : 1) * (EditorGUIUtility.singleLineHeight + 3)));
            EditorGUILayout.EndHorizontal();

            if (advanced)
            {
                CoreEditorUtils.DrawVector6(
                    CoreEditorUtils.GetContent("Face fade|Fade faces of the cubemap."),
                    d.boxPositiveFaceFade, d.boxNegativeFaceFade, Vector3.zero, Vector3.one, HDReflectionProbeEditor.k_handlesColor);
            }
        }
 protected static void Drawer_ReflectionProbeMode(HDProbeUI s, SerializedHDProbe p, Editor owner)
 {
     EditorGUI.BeginChangeCheck();
     EditorGUI.showMixedValue = p.mode.hasMultipleDifferentValues;
     EditorGUILayout.IntPopup(p.mode, k_ModeContents, k_ModeValues, CoreEditorUtils.GetContent("Type|'Baked Cubemap' uses the 'Auto Baking' mode from the Lighting window. If it is enabled then baking is automatic otherwise manual bake is needed (use the bake button below). \n'Custom' can be used if a custom cubemap is wanted. \n'Realtime' can be used to dynamically re-render the cubemap during runtime (via scripting)."));
     EditorGUI.showMixedValue = false;
     if (EditorGUI.EndChangeCheck())
     {
         s.SetModeTarget(p.mode.intValue);
         p.Apply();
     }
 }
        public override void OnInspectorGUI()
        {
            PropertyField(m_ScreenWeightDistance, CoreEditorUtils.GetContent("Screen Edge Fade Distance"));
            PropertyField(m_RayMaxIterations, CoreEditorUtils.GetContent("Max Number of Ray Steps|Affects both correctness and performance."));
            PropertyField(m_DepthBufferThickness, CoreEditorUtils.GetContent("Object Thickness"));
            PropertyField(m_MinSmoothness, CoreEditorUtils.GetContent("Min Smoothness|Smoothness value at which SSR is activated and the smoothness-controlled fade out stops."));
            PropertyField(m_SmoothnessFadeStart, CoreEditorUtils.GetContent("Smoothness Fade Start|Smoothness value at which the smoothness-controlled fade out starts. The fade is in the range [Min Smoothness, Smoothness Fade Start], e.g. [0.8, 0.9]."));

            m_RayMaxIterations.value.intValue       = Mathf.Max(0, m_RayMaxIterations.value.intValue);
            m_DepthBufferThickness.value.floatValue = Mathf.Clamp(m_DepthBufferThickness.value.floatValue, 0.001f, 1.0f);
            m_SmoothnessFadeStart.value.floatValue  = Mathf.Max(m_MinSmoothness.value.floatValue, m_SmoothnessFadeStart.value.floatValue);
        }
        public override void OnInspectorGUI()
        {
            EditorGUILayout.LabelField(CoreEditorUtils.GetContent("HiZ Settings"));
            PropertyField(m_RayMinLevel, CoreEditorUtils.GetContent("Ray Min Level"));
            PropertyField(m_RayMaxLevel, CoreEditorUtils.GetContent("Ray Max Level"));
            PropertyField(m_RayMaxIterations, CoreEditorUtils.GetContent("Ray Max Iterations"));
            PropertyField(m_RayDepthSuccessBias, CoreEditorUtils.GetContent("Ray Depth Success Bias"));

            EditorGUILayout.Separator();
            EditorGUILayout.LabelField(CoreEditorUtils.GetContent("Common Settings"));
            PropertyField(m_ScreenWeightDistance, CoreEditorUtils.GetContent("Screen Weight Distance"));
        }
        void DrawFeatures()
        {
            bool disabledScope = m_LightShape == LightShape.Line || (m_LightShape == LightShape.Rectangle && settings.isRealtime);

            using (new EditorGUI.DisabledScope(disabledScope))
            {
                bool shadowsEnabled = EditorGUILayout.Toggle(CoreEditorUtils.GetContent("Enable Shadows"), settings.shadowsType.enumValueIndex != 0);
                settings.shadowsType.enumValueIndex = shadowsEnabled ? (int)LightShadows.Hard : (int)LightShadows.None;
            }

            EditorGUILayout.PropertyField(m_AdditionalLightData.showAdditionalSettings);
        }
        static void Drawer_CaptureSettings(HDProbeUI s, SerializedHDProbe p, Editor owner)
        {
            var renderPipelineAsset = (HDRenderPipelineAsset)GraphicsSettings.renderPipelineAsset;

            p.resolution.intValue = (int)renderPipelineAsset.GetRenderPipelineSettings().lightLoopSettings.reflectionCubemapSize;
            EditorGUILayout.LabelField(resolutionContent, CoreEditorUtils.GetContent(p.resolution.intValue.ToString()));

            EditorGUILayout.PropertyField(p.shadowDistance, shadowDistanceContent);
            EditorGUILayout.PropertyField(p.cullingMask, cullingMaskContent);
            EditorGUILayout.PropertyField(p.useOcclusionCulling, useOcclusionCullingContent);
            EditorGUILayout.PropertyField(p.nearClip, nearClipCullingContent);
            EditorGUILayout.PropertyField(p.farClip, farClipCullingContent);
        }
        protected static void Drawer_ModeSettingsCustom(HDProbeUI s, SerializedHDProbe p, Editor owner)
        {
            EditorGUILayout.PropertyField(p.renderDynamicObjects, CoreEditorUtils.GetContent("Dynamic Objects|If enabled dynamic objects are also rendered into the cubemap"));

            EditorGUI.showMixedValue = p.customBakedTexture.hasMultipleDifferentValues;
            EditorGUI.BeginChangeCheck();
            var customTexture = EditorGUILayout.ObjectField(CoreEditorUtils.GetContent("Cubemap"), p.customBakedTexture.objectReferenceValue, typeof(Cubemap), false);

            EditorGUI.showMixedValue = false;
            if (EditorGUI.EndChangeCheck())
            {
                p.customBakedTexture.objectReferenceValue = customTexture;
            }
        }
        public override void OnInspectorGUI()
        {
            PropertyField(m_MaxShadowDistance, CoreEditorUtils.GetContent("Max Distance"));
            Rect firstLine = GUILayoutUtility.GetLastRect();

            EditorGUILayout.Space();
            PropertyField(m_CascadeShadowSplitCount, CoreEditorUtils.GetContent("Cascade Count"));

            if (!m_CascadeShadowSplitCount.value.hasMultipleDifferentValues)
            {
                EditorGUI.indentLevel++;
                int splitCount = m_CascadeShadowSplitCount.value.intValue;
                for (int i = 0; i < splitCount - 1; i++)
                {
                    PropertyField(m_CascadeShadowSplits[i], CoreEditorUtils.GetContent(string.Format("Split {0}", i + 1)));
                }

                if (LightLoop.s_UseCascadeBorders)
                {
                    EditorGUILayout.Space();

                    for (int i = 0; i < splitCount; i++)
                    {
                        PropertyField(m_CascadeShadowBorders[i], CoreEditorUtils.GetContent(string.Format("Border {0}", i + 1)));
                    }
                }
                EditorGUI.indentLevel--;
            }

            HDRenderPipeline hdrp = UnityEngine.Rendering.RenderPipelineManager.currentPipeline as HDRenderPipeline;

            if (hdrp == null)
            {
                return;
            }

            firstLine.y      -= EditorGUIUtility.singleLineHeight;
            firstLine.height -= 2;
            firstLine.x      += EditorGUIUtility.labelWidth + 20;
            firstLine.width  -= EditorGUIUtility.labelWidth + 20;
            bool currentCascadeValue = hdrp.showCascade;
            bool newCascadeValue     = GUI.Toggle(firstLine, currentCascadeValue, EditorGUIUtility.TrTextContent("Visualize Cascades"), EditorStyles.miniButton);

            if (currentCascadeValue ^ newCascadeValue)
            {
                hdrp.showCascade = newCascadeValue;
            }
        }
        public override void OnInspectorGUI()
        {
            PropertyField(m_Enable, CoreEditorUtils.GetContent("Enable"));

            if (!m_Enable.value.hasMultipleDifferentValues)
            {
                using (new EditorGUI.DisabledGroupScope(!m_Enable.value.boolValue))
                {
                    PropertyField(m_Length, CoreEditorUtils.GetContent("Length|Length of rays used to gather contact shadows in world units."));
                    PropertyField(m_DistanceScaleFactor, CoreEditorUtils.GetContent("Distance Scale Factor|Contact Shadows are scaled up with distance. Use this parameter to dampen this effect."));
                    PropertyField(m_MaxDistance, CoreEditorUtils.GetContent("Max Distance|Distance from the camera in world units at which contact shadows are faded out to zero."));
                    PropertyField(m_FadeDistance, CoreEditorUtils.GetContent("Fade Distance|Distance in world units over which the contact shadows fade out (see Max Distance)."));
                    PropertyField(m_SampleCount, CoreEditorUtils.GetContent("Sample Count|Number of samples when ray casting."));
                }
            }
        }
 static void Drawer_InfluenceShapeSphereSettings(HDReflectionProbeUI s, SerializedHDReflectionProbe p, Editor owner)
 {
     EditorGUILayout.BeginHorizontal();
     EditorGUILayout.PropertyField(p.influenceSphereRadius, CoreEditorUtils.GetContent("Radius"));
     if (GUILayout.Button(toolbar_Contents[0], GUILayout.ExpandHeight(true), GUILayout.Width(28f), GUILayout.Height(EditorGUIUtility.singleLineHeight + 3)))
     {
         EditMode.ChangeEditMode(EditMode.SceneViewEditMode.ReflectionProbeBox, GetBoundsGetter(p)(), owner);
     }
     EditorGUILayout.EndHorizontal();
     EditorGUILayout.BeginHorizontal();
     EditorGUILayout.PropertyField(p.boxOffset, CoreEditorUtils.GetContent("Sphere Offset|The center of the sphere in which the reflections will be applied to objects. The value is relative to the position of the Game Object."));
     if (GUILayout.Button(toolbar_Contents[3], GUILayout.ExpandHeight(true), GUILayout.Width(28f), GUILayout.Height(EditorGUIUtility.singleLineHeight + 3)))
     {
         EditMode.ChangeEditMode(EditMode.SceneViewEditMode.ReflectionProbeOrigin, GetBoundsGetter(p)(), owner);
     }
     EditorGUILayout.EndHorizontal();
 }
Example #16
0
        void DrawFeatures()
        {
            bool disabledScope = settings.isCompletelyBaked ||
                                 m_LightShape == LightShape.Line ||
                                 m_LightShape == LightShape.Rectangle;

            using (new EditorGUI.DisabledScope(disabledScope))
            {
                bool shadowsEnabled = EditorGUILayout.Toggle(CoreEditorUtils.GetContent("Enable Shadows"), settings.shadowsType.enumValueIndex != 0);
                settings.shadowsType.enumValueIndex = shadowsEnabled ? (int)LightShadows.Hard : (int)LightShadows.None;
                if (settings.lightType.enumValueIndex == (int)LightType.Directional)
                {
                    EditorGUILayout.PropertyField(m_AdditionalShadowData.enableContactShadows, CoreEditorUtils.GetContent("Enable Contact Shadows"));
                }
            }

            EditorGUILayout.PropertyField(m_AdditionalLightData.showAdditionalSettings);
        }
        protected virtual void OnHiZInspectorGUI()
        {
            EditorGUILayout.LabelField(CoreEditorUtils.GetContent("HiZ Settings"));
            PropertyField(m_RayMinLevel, CoreEditorUtils.GetContent("Ray Min Level"));
            PropertyField(m_RayMaxLevel, CoreEditorUtils.GetContent("Ray Max Level"));
            PropertyField(m_RayMaxIterations, CoreEditorUtils.GetContent("Ray Max Iterations"));
            PropertyField(m_DepthBufferThickness, CoreEditorUtils.GetContent("Depth Buffer Thickness"));
            PropertyField(m_RayMaxScreenDistance, CoreEditorUtils.GetContent("Max Raymarched Distance (NDC)"));
            PropertyField(m_RayBlendScreenDistance, CoreEditorUtils.GetContent("Blended Raymarched Distance (NDC)"));
            PropertyField(m_RayMarchBehindObjects, CoreEditorUtils.GetContent("Ray March Behind Objects"));

            m_RayMinLevel.value.intValue              = Mathf.Clamp(m_RayMinLevel.value.intValue, 0, m_RayMaxLevel.value.intValue);
            m_RayMaxLevel.value.intValue              = Mathf.Max(0, m_RayMaxLevel.value.intValue);
            m_RayMaxIterations.value.intValue         = Mathf.Max(0, m_RayMaxIterations.value.intValue);
            m_DepthBufferThickness.value.floatValue   = Mathf.Max(0.001f, m_DepthBufferThickness.value.floatValue);
            m_RayMaxScreenDistance.value.floatValue   = Mathf.Clamp(m_RayMaxScreenDistance.value.floatValue, 0.001f, 1.0f);
            m_RayBlendScreenDistance.value.floatValue = Mathf.Clamp(m_RayBlendScreenDistance.value.floatValue, 0.0f, m_RayMaxScreenDistance.value.floatValue);
        }
        static void Drawer_InfluenceSphereSettings(HDReflectionProbeUI s, SerializedHDReflectionProbe p, Editor owner)
        {
            var maxBlendDistance = HDReflectionProbeEditorUtility.CalculateSphereMaxBlendDistance(s, p, owner);

            var blendDistance = p.blendDistancePositive.vector3Value.x;

            EditorGUILayout.BeginHorizontal();
            EditorGUI.BeginChangeCheck();
            EditorGUI.showMixedValue = p.blendDistancePositive.hasMultipleDifferentValues;
            blendDistance            = EditorGUILayout.Slider(CoreEditorUtils.GetContent("Blend Distance|Area around the probe where it is blended with other probes. Only used in deferred probes."), blendDistance, 0, maxBlendDistance);
            if (EditorGUI.EndChangeCheck())
            {
                p.blendDistancePositive.vector3Value = Vector3.one * blendDistance;
                p.blendDistanceNegative.vector3Value = Vector3.one * blendDistance;
            }
            if (GUILayout.Button(toolbar_Contents[1], GUILayout.Width(28f), GUILayout.Height(EditorGUIUtility.singleLineHeight + 3)))
            {
                EditMode.ChangeEditMode(k_Toolbar_SceneViewEditModes[1], GetBoundsGetter(p)(), owner);
            }
            EditorGUILayout.EndHorizontal();

            var blendNormalDistance = p.blendNormalDistancePositive.vector3Value.x;

            EditorGUILayout.BeginHorizontal();
            EditorGUI.BeginChangeCheck();
            EditorGUI.showMixedValue = p.blendNormalDistancePositive.hasMultipleDifferentValues;
            blendNormalDistance      = EditorGUILayout.Slider(CoreEditorUtils.GetContent("Blend Normal Distance|Area around the probe where the normals influence the probe. Only used in deferred probes."), blendNormalDistance, 0, maxBlendDistance);
            if (EditorGUI.EndChangeCheck())
            {
                p.blendNormalDistancePositive.vector3Value = Vector3.one * blendNormalDistance;
                p.blendNormalDistanceNegative.vector3Value = Vector3.one * blendNormalDistance;
            }
            if (GUILayout.Button(toolbar_Contents[2], GUILayout.Width(28f), GUILayout.Height(EditorGUIUtility.singleLineHeight + 3)))
            {
                EditMode.ChangeEditMode(k_Toolbar_SceneViewEditModes[2], GetBoundsGetter(p)(), owner);
            }
            EditorGUILayout.EndHorizontal();
            EditorGUI.showMixedValue = false;
        }
        static void Drawer_InfluenceShape(HDReflectionProbeUI s, SerializedHDReflectionProbe p, Editor owner)
        {
            EditorGUI.BeginChangeCheck();
            EditorGUI.showMixedValue = p.influenceShape.hasMultipleDifferentValues;
            EditorGUILayout.PropertyField(p.influenceShape, CoreEditorUtils.GetContent("Shape"));
            EditorGUI.showMixedValue = false;
            if (EditorGUI.EndChangeCheck())
            {
                s.SetShapeTarget(p.influenceShape.intValue);
            }

            switch ((ShapeType)p.influenceShape.enumValueIndex)
            {
            case ShapeType.Box:
                Drawer_InfluenceShapeBoxSettings(s, p, owner);
                break;

            case ShapeType.Sphere:
                Drawer_InfluenceShapeSphereSettings(s, p, owner);
                break;
            }
        }
        protected static void Drawer_SectionCaptureSettings(HDProbeUI s, SerializedHDProbe d, Editor o)
        {
            SerializedPlanarReflectionProbe serialized = (SerializedPlanarReflectionProbe)d;
            var hdrp = GraphicsSettings.renderPipelineAsset as HDRenderPipelineAsset;

            GUI.enabled = false;
            EditorGUILayout.LabelField(
                CoreEditorUtils.GetContent("Probe Texture Size (Set By HDRP)"),
                CoreEditorUtils.GetContent(hdrp.renderPipelineSettings.lightLoopSettings.planarReflectionTextureSize.ToString()),
                EditorStyles.label);
            EditorGUILayout.Toggle(
                CoreEditorUtils.GetContent("Probe Compression (Set By HDRP)"),
                hdrp.renderPipelineSettings.lightLoopSettings.planarReflectionCacheCompressed);
            GUI.enabled = true;

            bool on = serialized.overrideFieldOfView.boolValue;

            EditorGUI.BeginChangeCheck();
            on = EditorGUILayout.Toggle(overrideFieldOfViewContent, on);
            if (on)
            {
                serialized.fieldOfViewOverride.floatValue = EditorGUILayout.FloatField(fieldOfViewSolidAngleContent, serialized.fieldOfViewOverride.floatValue);
            }
            if (EditorGUI.EndChangeCheck())
            {
                serialized.overrideFieldOfView.boolValue = on;
                serialized.Apply();
            }

            //GUI.enabled = false;
            //EditorGUILayout.LabelField(resolutionContent, CoreEditorUtils.GetContent(((int)hdrp.GetRenderPipelineSettings().lightLoopSettings.reflectionCubemapSize).ToString()));
            //EditorGUILayout.LabelField(shadowDistanceContent, EditorStyles.label);
            //EditorGUILayout.LabelField(cullingMaskContent, EditorStyles.label);
            //EditorGUILayout.LabelField(useOcclusionCullingContent, EditorStyles.label);
            //EditorGUILayout.LabelField(nearClipCullingContent, EditorStyles.label);
            //EditorGUILayout.LabelField(farClipCullingContent, EditorStyles.label);
            //GUI.enabled = true;
        }
        static void Drawer_InfluenceBoxSettings(HDReflectionProbeUI s, SerializedHDReflectionProbe p, Editor owner)
        {
            bool advanced         = p.editorAdvancedModeEnabled.boolValue;
            var  maxBlendDistance = HDReflectionProbeEditorUtility.CalculateBoxMaxBlendDistance(s, p, owner);

            EditorGUILayout.BeginHorizontal();
            Drawer_AdvancedBlendDistance(
                p,
                false,
                maxBlendDistance,
                CoreEditorUtils.GetContent("Blend Distance|Area around the probe where it is blended with other probes. Only used in deferred probes.")
                );
            if (GUILayout.Button(toolbar_Contents[1], GUILayout.ExpandHeight(true), GUILayout.Width(28f), GUILayout.MinHeight(22f), GUILayout.MaxHeight((advanced ? 3 : 1) * (EditorGUIUtility.singleLineHeight + 3))))
            {
                EditMode.ChangeEditMode(k_Toolbar_SceneViewEditModes[1], GetBoundsGetter(p)(), owner);
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            Drawer_AdvancedBlendDistance(
                p,
                true,
                maxBlendDistance,
                CoreEditorUtils.GetContent("Blend Normal Distance|Area around the probe where the normals influence the probe. Only used in deferred probes.")
                );
            if (GUILayout.Button(toolbar_Contents[2], GUILayout.ExpandHeight(true), GUILayout.Width(28f), GUILayout.MinHeight(22f), GUILayout.MaxHeight((advanced ? 3 : 1) * (EditorGUIUtility.singleLineHeight + 3))))
            {
                EditMode.ChangeEditMode(k_Toolbar_SceneViewEditModes[2], GetBoundsGetter(p)(), owner);
            }
            EditorGUILayout.EndHorizontal();

            if (advanced)
            {
                CoreEditorUtils.DrawVector6(
                    CoreEditorUtils.GetContent("Face fade|Fade faces of the cubemap."),
                    p.boxSideFadePositive, p.boxSideFadeNegative, Vector3.zero, Vector3.one, HDReflectionProbeEditor.k_handlesColor);
            }
        }
        static void Drawer_AdditionalSettings(HDReflectionProbeUI s, SerializedHDReflectionProbe p, Editor owner)
        {
            EditorGUILayout.PropertyField(p.weight, CoreEditorUtils.GetContent("Influence Volume Weight|Blending weight to use while interpolating between influence volume. (Reminder: Sky is an Influence Volume too)."));

            EditorGUI.BeginChangeCheck();
            EditorGUILayout.PropertyField(p.multiplier, CoreEditorUtils.GetContent("Multiplier|Tweeking option to enhance reflection."));
            if (EditorGUI.EndChangeCheck())
            {
                p.multiplier.floatValue = Mathf.Max(0.0f, p.multiplier.floatValue);
            }

            if (p.so.targetObjects.Length == 1)
            {
                var probe = p.target;
                if (probe.mode == ReflectionProbeMode.Custom && probe.customBakedTexture != null)
                {
                    var cubemap = probe.customBakedTexture as Cubemap;
                    if (cubemap && cubemap.mipmapCount == 1)
                    {
                        EditorGUILayout.HelpBox("No mipmaps in the cubemap, Smoothness value in Standard shader will be ignored.", MessageType.Warning);
                    }
                }
            }
        }
 protected override void OnCommonInspectorGUI()
 {
     base.OnCommonInspectorGUI();
     PropertyField(m_DeferredProjectionModel, CoreEditorUtils.GetContent("Projection Model"));
 }
 protected virtual void OnCommonInspectorGUI()
 {
     EditorGUILayout.LabelField(CoreEditorUtils.GetContent("Common Settings"));
     PropertyField(m_ScreenWeightDistance, CoreEditorUtils.GetContent("Screen Weight Distance"));
 }
Example #25
0
		public override void OnInspectorGUI()
		{
			serializedObject.Update();

			if ( _Properties == null )
			{
				_Properties = serializedObject.FindProperty( "Properties" );
			}

			if ( _Properties != null && _Shader != null )
			{
				if ( _Properties.arraySize > 0 )
				{
					List<SerializedProperty> finalProps = new List<SerializedProperty>();
					for ( int i = 0; i < _Properties.arraySize; i++ )
					{
						SerializedProperty prop = _Properties.GetArrayElementAtIndex( i );

						if ( prop != null && prop.FindPropertyRelative( "Name" ) != null )
						{
							if ( ShaderUtilExtensions.HasShaderProperty( _Shader, prop.FindPropertyRelative( "Name" ).stringValue ) )
							{
								finalProps.Add( prop );
							}
						}
					}
					finalProps = finalProps.OrderBy( x => ShaderUtilExtensions.GetShaderPropertyNames( _Shader ).IndexOf( x.FindPropertyRelative( "Name" ).stringValue ) ).ToList();

					EditorGUILayout.Space();

					for ( int j = 0; j < finalProps.Count; j++ )
					{
						SerializedProperty prop = finalProps[j];
						string name = prop.FindPropertyRelative( "Name" ).stringValue;
						string desc = prop.FindPropertyRelative( "Desc" ).stringValue;
						string type = prop.FindPropertyRelative( "Type" ).stringValue;
						bool change = prop.FindPropertyRelative( "Change" ).boolValue;
						string[] attrs = ShaderUtilExtensions.GetShaderPropertyAttributes( _Shader, name ) ?? new string[0];
						SerializedProperty p = prop.FindPropertyRelative( $"{type}Value" );
						GUIContent label = new GUIContent( desc, name );

						EditorGUILayout.BeginHorizontal();

						EditorGUI.BeginChangeCheck();
						var overrideRect = GUILayoutUtility.GetRect( 17f, 17f, GUILayout.ExpandWidth( false ) );
						overrideRect.yMin += 4f;
						bool chnge = GUI.Toggle( overrideRect, change, CoreEditorUtils.GetContent( "|Override this property for this object." ), CoreEditorStyles.smallTickbox );
						if ( EditorGUI.EndChangeCheck() )
						{
							prop.FindPropertyRelative( "Change" ).boolValue = chnge;
						}

						EditorGUI.BeginDisabledGroup( !change );

						switch ( type )
						{
							case "Color":
								EditorGUI.BeginChangeCheck();
								Color valColor = EditorGUILayout.ColorField( label, p.colorValue, true, true, true );
								if ( EditorGUI.EndChangeCheck() )
								{
									p.colorValue = valColor;
								}
								break;

							case "Texture":
								EditorGUI.BeginChangeCheck();
								Texture valTexture = (Texture) EditorGUILayout.ObjectField( label, p.objectReferenceValue, typeof( Texture ), false );
								if ( EditorGUI.EndChangeCheck() )
								{
									p.objectReferenceValue = valTexture;
								}
								break;

							case "Float":
								EditorGUI.BeginChangeCheck();
								float valFloat = attrs.Contains( "Toggle", StringComparer.OrdinalIgnoreCase ) ? Convert.ToSingle( EditorGUILayout.Toggle( label,
								                 Convert.ToBoolean( Mathf.Clamp01( p.floatValue ) ) ) ) : EditorGUILayout.FloatField( label, p.floatValue );
								if ( EditorGUI.EndChangeCheck() )
								{
									p.floatValue = valFloat;
								}
								break;

							case "Vector":
								EditorGUI.BeginChangeCheck();
								Vector4 valVector = EditorGUILayout.Vector4Field( label, p.vector4Value );
								if ( EditorGUI.EndChangeCheck() )
								{
									p.vector4Value = valVector;
								}
								break;
						}

						EditorGUI.EndDisabledGroup();

						EditorGUILayout.EndHorizontal();
					}
				}
			}

			serializedObject.ApplyModifiedProperties();
		}
 static void Drawer_InfluenceSettings(HDReflectionProbeUI s, SerializedHDReflectionProbe p, Editor owner)
 {
     EditorGUILayout.PropertyField(p.boxProjection, CoreEditorUtils.GetContent("Parallax Correction|Parallax Correction causes reflections to appear to change based on the object's position within the probe's box, while still using a single probe as the source of the reflection. This works well for reflections on objects that are moving through enclosed spaces such as corridors and rooms. Setting Parallax Correction to False and the cubemap reflection will be treated as coming from infinitely far away. Note that this feature can be globally disabled from Graphics Settings -> Tier Settings"));
 }
 static void Drawer_IntensityMultiplier(HDReflectionProbeUI s, SerializedHDReflectionProbe p, Editor owner)
 {
     EditorGUILayout.PropertyField(p.intensityMultiplier, CoreEditorUtils.GetContent("Intensity"));
 }
 static void Drawer_ModeSettingsRealtime(HDReflectionProbeUI s, SerializedHDReflectionProbe p, Editor owner)
 {
     EditorGUILayout.PropertyField(p.refreshMode, CoreEditorUtils.GetContent("Refresh Mode|Controls how this probe refreshes in the Player"));
     EditorGUILayout.PropertyField(p.timeSlicingMode, CoreEditorUtils.GetContent("Time Slicing|If enabled this probe will update over several frames, to help reduce the impact on the frame rate"));
 }
 public override void OnInspectorGUI()
 {
     PropertyField(m_ScreenFadeDistance, CoreEditorUtils.GetContent("Screen Weight Distance"));
 }
Example #30
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            // Lazy init because domain reload, undo/redo, etc...
            UpdateSkyIntPopupData();

            EditorGUILayout.PropertyField(m_VolumeProfile);
            using (new EditorGUI.DisabledScope(m_SkyClassNames.Count == 1)) // Only "None"
            {
                EditorGUILayout.IntPopup(m_SkyUniqueID, m_SkyClassNames.ToArray(), m_SkyUniqueIDs.ToArray(), CoreEditorUtils.GetContent("Baking Sky|Specify which kind of sky you want to use for baking in the referenced profile."));
            }

            serializedObject.ApplyModifiedProperties();
        }