HasShadowCasterPass() private method

private HasShadowCasterPass ( Shader s ) : bool
s UnityEngine.Shader
return bool
コード例 #1
0
        public override void OnInspectorGUI()
        {
            var s = target as Shader;

            if (s == null)
            {
                return;
            }

            GUI.enabled = true;

            EditorGUI.indentLevel = 0;

            ShowShaderCodeArea(s);

            if (s.isSupported)
            {
                EditorGUILayout.LabelField("Cast shadows", (ShaderUtil.HasShadowCasterPass(s)) ? "yes" : "no");
                EditorGUILayout.LabelField("Render queue", ShaderUtil.GetRenderQueue(s).ToString(CultureInfo.InvariantCulture));
                EditorGUILayout.LabelField("LOD", ShaderUtil.GetLOD(s).ToString(CultureInfo.InvariantCulture));
                EditorGUILayout.LabelField("Ignore projector", ShaderUtil.DoesIgnoreProjector(s) ? "yes" : "no");
                string disableBatchingString;
                switch (s.disableBatching)
                {
                case DisableBatchingType.False:
                    disableBatchingString = "no";
                    break;

                case DisableBatchingType.True:
                    disableBatchingString = "yes";
                    break;

                case DisableBatchingType.WhenLODFading:
                    disableBatchingString = "when LOD fading is on";
                    break;

                default:
                    disableBatchingString = "unknown";
                    break;
                }
                EditorGUILayout.LabelField("Disable batching", disableBatchingString);
                ShowKeywords(s);

                // If any SRP is active, then display the SRP Batcher compatibility status
                if (RenderPipelineManager.currentPipeline != null)
                {
                    var mat = new Material(s);
                    mat.SetPass(0);                 // NOTE: Force the shader compilation to ensure GetSRPBatcherCompatibilityCode will be up to date
                    int    subShader  = ShaderUtil.GetShaderActiveSubshaderIndex(s);
                    int    SRPErrCode = ShaderUtil.GetSRPBatcherCompatibilityCode(s, subShader);
                    string result     = (0 == SRPErrCode) ? "compatible" : "not compatible";
                    EditorGUILayout.LabelField("SRP Batcher", result);
                    if (SRPErrCode != 0)
                    {
                        EditorGUILayout.HelpBox(ShaderUtil.GetSRPBatcherCompatibilityIssueReason(s, subShader, SRPErrCode), MessageType.Info);
                    }
                }
                ShowShaderProperties(s);
            }
        }
コード例 #2
0
        public override void OnInspectorGUI()
        {
            var s = target as Shader;

            if (s == null)
            {
                return;
            }

            GUI.enabled = true;

            EditorGUI.indentLevel = 0;

            ShowShaderCodeArea(s);

            if (s.isSupported)
            {
                EditorGUILayout.LabelField("Cast shadows", (ShaderUtil.HasShadowCasterPass(s)) ? "yes" : "no");
                EditorGUILayout.LabelField("Render queue", ShaderUtil.GetRenderQueue(s).ToString(CultureInfo.InvariantCulture));
                EditorGUILayout.LabelField("LOD", ShaderUtil.GetLOD(s).ToString(CultureInfo.InvariantCulture));
                EditorGUILayout.LabelField("Ignore projector", ShaderUtil.DoesIgnoreProjector(s) ? "yes" : "no");
                string disableBatchingString;
                switch (s.disableBatching)
                {
                case DisableBatchingType.False:
                    disableBatchingString = "no";
                    break;

                case DisableBatchingType.True:
                    disableBatchingString = "yes";
                    break;

                case DisableBatchingType.WhenLODFading:
                    disableBatchingString = "when LOD fading is on";
                    break;

                default:
                    disableBatchingString = "unknown";
                    break;
                }
                EditorGUILayout.LabelField("Disable batching", disableBatchingString);
                ShowShaderProperties(s);
            }
        }
コード例 #3
0
        public override void OnInspectorGUI()
        {
            Shader target = this.target as Shader;

            if ((UnityEngine.Object)target == (UnityEngine.Object)null)
            {
                return;
            }
            GUI.enabled           = true;
            EditorGUI.indentLevel = 0;
            this.ShowShaderCodeArea(target);
            if (!target.isSupported)
            {
                return;
            }
            EditorGUILayout.LabelField("Cast shadows", !ShaderUtil.HasShadowCasterPass(target) ? "no" : "yes", new GUILayoutOption[0]);
            EditorGUILayout.LabelField("Render queue", ShaderUtil.GetRenderQueue(target).ToString((IFormatProvider)CultureInfo.InvariantCulture), new GUILayoutOption[0]);
            EditorGUILayout.LabelField("LOD", ShaderUtil.GetLOD(target).ToString((IFormatProvider)CultureInfo.InvariantCulture), new GUILayoutOption[0]);
            EditorGUILayout.LabelField("Ignore projector", !ShaderUtil.DoesIgnoreProjector(target) ? "no" : "yes", new GUILayoutOption[0]);
            string label2;

            switch (target.disableBatching)
            {
            case DisableBatchingType.False:
                label2 = "no";
                break;

            case DisableBatchingType.True:
                label2 = "yes";
                break;

            case DisableBatchingType.WhenLODFading:
                label2 = "when LOD fading is on";
                break;

            default:
                label2 = "unknown";
                break;
            }
            EditorGUILayout.LabelField("Disable batching", label2, new GUILayoutOption[0]);
            ShaderInspector.ShowShaderProperties(target);
        }
コード例 #4
0
        public override void OnInspectorGUI()
        {
            Shader shader = base.target as Shader;

            if (!(shader == null))
            {
                GUI.enabled           = true;
                EditorGUI.indentLevel = 0;
                this.ShowShaderCodeArea(shader);
                if (shader.isSupported)
                {
                    EditorGUILayout.LabelField("Cast shadows", (!ShaderUtil.HasShadowCasterPass(shader)) ? "no" : "yes", new GUILayoutOption[0]);
                    EditorGUILayout.LabelField("Render queue", ShaderUtil.GetRenderQueue(shader).ToString(CultureInfo.InvariantCulture), new GUILayoutOption[0]);
                    EditorGUILayout.LabelField("LOD", ShaderUtil.GetLOD(shader).ToString(CultureInfo.InvariantCulture), new GUILayoutOption[0]);
                    EditorGUILayout.LabelField("Ignore projector", (!ShaderUtil.DoesIgnoreProjector(shader)) ? "no" : "yes", new GUILayoutOption[0]);
                    string label;
                    switch (shader.disableBatching)
                    {
                    case DisableBatchingType.False:
                        label = "no";
                        break;

                    case DisableBatchingType.True:
                        label = "yes";
                        break;

                    case DisableBatchingType.WhenLODFading:
                        label = "when LOD fading is on";
                        break;

                    default:
                        label = "unknown";
                        break;
                    }
                    EditorGUILayout.LabelField("Disable batching", label, new GUILayoutOption[0]);
                    ShaderInspector.ShowShaderProperties(shader);
                }
            }
        }