Exemple #1
0
        void DrawShadowSettings()
        {
            m_ShadowSettingsFoldout = EditorGUILayout.Foldout(m_ShadowSettingsFoldout, Styles.shadowSettingsText);
            if (m_ShadowSettingsFoldout)
            {
                EditorGUI.indentLevel++;
                m_ShadowDistanceProp.floatValue = Mathf.Max(0.0f, EditorGUILayout.FloatField(Styles.shadowDistanceText, m_ShadowDistanceProp.floatValue));
                CoreEditorUtils.DrawPopup(Styles.shadowCascadesText, m_ShadowCascadesProp, Styles.shadowCascadeOptions);

                ShadowCascadesOption cascades = (ShadowCascadesOption)m_ShadowCascadesProp.intValue;
                if (cascades == ShadowCascadesOption.FourCascades)
                {
                    CoreEditorUtils.DrawCascadeSplitGUI <Vector3>(ref m_ShadowCascade4SplitProp);
                }
                else if (cascades == ShadowCascadesOption.TwoCascades)
                {
                    CoreEditorUtils.DrawCascadeSplitGUI <float>(ref m_ShadowCascade2SplitProp);
                }

                m_ShadowDepthBiasProp.floatValue  = EditorGUILayout.Slider(Styles.shadowDepthBias, m_ShadowDepthBiasProp.floatValue, 0.0f, k_MaxShadowBias);
                m_ShadowNormalBiasProp.floatValue = EditorGUILayout.Slider(Styles.shadowNormalBias, m_ShadowNormalBiasProp.floatValue, 0.0f, k_MaxShadowBias);
                EditorGUILayout.PropertyField(m_SoftShadowsSupportedProp, Styles.supportsSoftShadows);
                EditorGUI.indentLevel--;
                EditorGUILayout.Space();
                EditorGUILayout.Space();
            }
        }
Exemple #2
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            UpdateAnimationValues();
            EditorGUILayout.Space();
            EditorGUILayout.LabelField(Styles.renderingLabel, EditorStyles.boldLabel);
            EditorGUI.indentLevel++;
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField(Styles.renderScaleLabel);
            m_RenderScale.floatValue = EditorGUILayout.Slider(m_RenderScale.floatValue, kMinRenderScale, kMaxRenderScale);
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField(Styles.maxPixelLightsLabel);
            m_MaxPixelLights.intValue = EditorGUILayout.IntSlider(m_MaxPixelLights.intValue, 0, kMaxSupportedPixelLights);
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.PropertyField(m_SupportsVertexLightProp, Styles.enableVertexLightLabel);
            EditorGUILayout.PropertyField(m_RequireDepthTextureProp, Styles.requireDepthTexture);
            DrawAnimatedProperty(m_RequireSoftParticlesProp, Styles.requireSoftParticles, m_ShowSoftParticles);
            EditorGUILayout.PropertyField(m_HDR, Styles.hdrContent);
            EditorGUILayout.PropertyField(m_MSAA, Styles.msaaContent);

            EditorGUI.indentLevel--;
            EditorGUILayout.Space();
            EditorGUILayout.Space();

            EditorGUILayout.LabelField(Styles.shadowLabel, EditorStyles.boldLabel);
            EditorGUI.indentLevel++;
            CoreEditorUtils.DrawPopup(Styles.shadowType, m_ShadowTypeProp, Styles.shadowTypeOptions);
            EditorGUILayout.PropertyField(m_ShadowAtlasResolutionProp, Styles.shadowAtlasResolution);
            EditorGUILayout.PropertyField(m_ShadowNearPlaneOffsetProp, Styles.shadowNearPlaneOffset);
            m_ShadowDistanceProp.floatValue = Mathf.Max(0.0f, EditorGUILayout.FloatField(Styles.shadowDistante, m_ShadowDistanceProp.floatValue));
            CoreEditorUtils.DrawPopup(Styles.shadowCascades, m_ShadowCascadesProp, Styles.shadowCascadeOptions);

            ShadowCascades cascades = (ShadowCascades)m_ShadowCascadesProp.intValue;

            if (cascades == ShadowCascades.FOUR_CASCADES)
            {
                CoreEditorUtils.DrawCascadeSplitGUI <Vector3>(ref m_ShadowCascade4SplitProp);
            }
            else if (cascades == ShadowCascades.TWO_CASCADES)
            {
                CoreEditorUtils.DrawCascadeSplitGUI <float>(ref m_ShadowCascade2SplitProp);
            }

            EditorGUI.indentLevel--;

            EditorGUILayout.Space();
            EditorGUILayout.LabelField(Styles.customeMenu, EditorStyles.boldLabel);
            EditorGUI.indentLevel++;
            int layerMask = GuiLayerMask(m_NoSelfShadowLayerMask.intValue);

            m_NoSelfShadowLayerMask.intValue = layerMask;

            EditorGUI.indentLevel--;


            serializedObject.ApplyModifiedProperties();
        }
Exemple #3
0
        void DrawGeneralSettings()
        {
            EditorGUILayout.LabelField(Styles.generalSettingsLabel, EditorStyles.boldLabel);
            EditorGUI.indentLevel++;
            EditorGUI.BeginDisabledGroup(XRGraphicsConfig.tryEnable); // Begin XR-overridden values
            m_RenderScale.floatValue = EditorGUILayout.Slider(Styles.renderScaleLabel, m_RenderScale.floatValue, k_MinRenderScale, k_MaxRenderScale);
            EditorGUI.EndDisabledGroup();                             // End XR-overridden values
            m_MaxPixelLights.intValue = EditorGUILayout.IntSlider(Styles.maxPixelLightsLabel, m_MaxPixelLights.intValue, 0, k_MaxSupportedPixelLights);
            EditorGUILayout.Space();

            bool directionalShadows = m_DirectionalShadowsSupportedProp.boolValue;

            if (directionalShadows)
            {
                EditorGUILayout.LabelField(Styles.directionalShadowLabel);
                EditorGUI.indentLevel++;
                EditorGUILayout.PropertyField(m_DirectionalShadowAtlasResolutionProp, Styles.directionalShadowAtlasResolution);
                m_ShadowDistanceProp.floatValue = Mathf.Max(0.0f,
                                                            EditorGUILayout.FloatField(Styles.shadowDistance, m_ShadowDistanceProp.floatValue));
                CoreEditorUtils.DrawPopup(Styles.shadowCascades, m_ShadowCascadesProp, Styles.shadowCascadeOptions);

                ShadowCascades cascades = (ShadowCascades)m_ShadowCascadesProp.intValue;
                if (cascades == ShadowCascades.FOUR_CASCADES)
                {
                    CoreEditorUtils.DrawCascadeSplitGUI <Vector3>(ref m_ShadowCascade4SplitProp);
                }
                else if (cascades == ShadowCascades.TWO_CASCADES)
                {
                    CoreEditorUtils.DrawCascadeSplitGUI <float>(ref m_ShadowCascade2SplitProp);
                }

                EditorGUI.indentLevel--;
                EditorGUILayout.Space();
            }

            bool localShadows = m_LocalShadowSupportedProp.boolValue;

            if (localShadows)
            {
                EditorGUILayout.LabelField(Styles.localShadowLabel);
                EditorGUI.indentLevel++;
                EditorGUILayout.PropertyField(m_LocalShadowsAtlasResolutionProp, Styles.localShadowsAtlasResolution);
                EditorGUI.indentLevel--;
                EditorGUILayout.Space();
            }

            if (directionalShadows || localShadows)
            {
                EditorGUILayout.PropertyField(m_SoftShadowsSupportedProp, Styles.supportsSoftShadows);
            }
            EditorGUI.indentLevel--;
            EditorGUILayout.Space();
            EditorGUILayout.Space();
        }
        void DrawShadowSettings()
        {
            EditorGUILayout.LabelField(Styles.shadowLabel, EditorStyles.boldLabel);
            EditorGUI.indentLevel++;

            EditorGUILayout.PropertyField(m_DirectionalShadowsSupportedProp, Styles.supportsDirectionalShadows);
            bool directionalShadows = m_DirectionalShadowsSupportedProp.boolValue;

            if (directionalShadows)
            {
                EditorGUI.indentLevel++;
                EditorGUILayout.PropertyField(m_DirectionalShadowAtlasResolutionProp, Styles.directionalShadowAtlasResolution);
                m_ShadowDistanceProp.floatValue = Mathf.Max(0.0f,
                                                            EditorGUILayout.FloatField(Styles.shadowDistance, m_ShadowDistanceProp.floatValue));
                CoreEditorUtils.DrawPopup(Styles.shadowCascades, m_ShadowCascadesProp, Styles.shadowCascadeOptions);

                ShadowCascades cascades = (ShadowCascades)m_ShadowCascadesProp.intValue;
                if (cascades == ShadowCascades.FOUR_CASCADES)
                {
                    CoreEditorUtils.DrawCascadeSplitGUI <Vector3>(ref m_ShadowCascade4SplitProp);
                }
                else if (cascades == ShadowCascades.TWO_CASCADES)
                {
                    CoreEditorUtils.DrawCascadeSplitGUI <float>(ref m_ShadowCascade2SplitProp);
                }

                EditorGUI.indentLevel--;
                EditorGUILayout.Space();
            }

            EditorGUILayout.PropertyField(m_LocalShadowSupportedProp, Styles.supportsLocalShadows);
            bool localShadows = m_LocalShadowSupportedProp.boolValue;

            if (localShadows)
            {
                EditorGUI.indentLevel++;
                EditorGUILayout.PropertyField(m_LocalShadowsAtlasResolutionProp, Styles.localShadowsAtlasResolution);
                EditorGUI.indentLevel--;
                EditorGUILayout.Space();
            }

            if (directionalShadows || localShadows)
            {
                EditorGUILayout.PropertyField(m_SoftShadowsSupportedProp, Styles.supportsSoftShadows);
            }

            EditorGUI.indentLevel--;
            EditorGUILayout.Space();
            EditorGUILayout.Space();
        }
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        switch (shadowCascades.enumValueIndex)
        {
            case 0: return;
            case 1:
                CoreEditorUtils.DrawCascadeSplitGUI<float>(ref twoCascadeSplit);
                break;
            case 2:
                CoreEditorUtils.DrawCascadeSplitGUI<Vector3>(ref fourCascadeSplit);
                break;
        }
        serializedObject.ApplyModifiedProperties();
    }
        void DrawShadowSettings()
        {
            shadowsSettingsFoldout = EditorGUILayout.Foldout(shadowsSettingsFoldout, Styles.shadowLabel, true);
            if (shadowsSettingsFoldout)
            {
                // Directional Shadows
                EditorGUI.BeginDisabledGroup(!m_DirectionalShadowsSupportedProp.boolValue);
                EditorGUI.indentLevel++;
                EditorGUILayout.LabelField(Styles.directionalShadowLabel);
                EditorGUI.indentLevel++;
                EditorGUILayout.PropertyField(m_DirectionalShadowAtlasResolutionProp, Styles.directionalShadowAtlasResolution);
                m_ShadowDistanceProp.floatValue = Mathf.Max(0.0f,
                                                            EditorGUILayout.FloatField(Styles.shadowDistance, m_ShadowDistanceProp.floatValue));
                CoreEditorUtils.DrawPopup(Styles.shadowCascades, m_ShadowCascadesProp, Styles.shadowCascadeOptions);

                ShadowCascades cascades = (ShadowCascades)m_ShadowCascadesProp.intValue;
                if (cascades == ShadowCascades.FOUR_CASCADES)
                {
                    CoreEditorUtils.DrawCascadeSplitGUI <Vector3>(ref m_ShadowCascade4SplitProp);
                }
                else if (cascades == ShadowCascades.TWO_CASCADES)
                {
                    CoreEditorUtils.DrawCascadeSplitGUI <float>(ref m_ShadowCascade2SplitProp);
                }

                EditorGUI.indentLevel--;
                EditorGUILayout.Space();
                EditorGUI.EndDisabledGroup();

                // Local Shadows
                EditorGUI.BeginDisabledGroup(!m_LocalShadowSupportedProp.boolValue);
                EditorGUILayout.LabelField(Styles.localShadowLabel);
                EditorGUI.indentLevel++;
                EditorGUILayout.PropertyField(m_LocalShadowsAtlasResolutionProp, Styles.localShadowsAtlasResolution);
                EditorGUI.indentLevel--;
                EditorGUI.indentLevel--;
                EditorGUI.EndDisabledGroup();
            }
        }