private void DrawStates()
        {
            FrameDebuggerBlendState  frameBlendState  = FrameDebuggerUtility.GetFrameBlendState();
            FrameDebuggerRasterState frameRasterState = FrameDebuggerUtility.GetFrameRasterState();
            FrameDebuggerDepthState  frameDepthState  = FrameDebuggerUtility.GetFrameDepthState();
            string str = string.Empty;

            if (frameBlendState.renderTargetWriteMask == 0)
            {
                str = "0";
            }
            else
            {
                if ((frameBlendState.renderTargetWriteMask & 2) != 0)
                {
                    str = str + "R";
                }
                if ((frameBlendState.renderTargetWriteMask & 4) != 0)
                {
                    str = str + "G";
                }
                if ((frameBlendState.renderTargetWriteMask & 8) != 0)
                {
                    str = str + "B";
                }
                if ((frameBlendState.renderTargetWriteMask & 1) != 0)
                {
                    str = str + "A";
                }
            }
            object[] args = new object[] { frameBlendState.srcBlend, frameBlendState.dstBlend, frameBlendState.srcBlendAlpha, frameBlendState.dstBlendAlpha, str };
            GUILayout.Label(string.Format("Blend {0} {1}, {2} {3} ColorMask {4}", args), EditorStyles.miniLabel, new GUILayoutOption[0]);
            object[] objArray2 = new object[] { frameDepthState.depthFunc, (frameDepthState.depthWrite != 0) ? "On" : "Off", frameRasterState.cullMode, frameRasterState.slopeScaledDepthBias, frameRasterState.depthBias };
            GUILayout.Label(string.Format("ZTest {0} ZWrite {1} Cull {2} Offset {3}, {4}", objArray2), EditorStyles.miniLabel, new GUILayoutOption[0]);
        }
示例#2
0
        private void DrawStates(FrameDebuggerEventData curEventData)
        {
            FrameDebuggerBlendState  blendState  = curEventData.blendState;
            FrameDebuggerRasterState rasterState = curEventData.rasterState;
            FrameDebuggerDepthState  depthState  = curEventData.depthState;
            string str = string.Empty;

            if ((int)blendState.renderTargetWriteMask == 0)
            {
                str = "0";
            }
            else
            {
                if (((int)blendState.renderTargetWriteMask & 2) != 0)
                {
                    str += "R";
                }
                if (((int)blendState.renderTargetWriteMask & 4) != 0)
                {
                    str += "G";
                }
                if (((int)blendState.renderTargetWriteMask & 8) != 0)
                {
                    str += "B";
                }
                if (((int)blendState.renderTargetWriteMask & 1) != 0)
                {
                    str += "A";
                }
            }
            GUILayout.Label(string.Format("Blend {0} {1}, {2} {3} ColorMask {4}", (object)blendState.srcBlend, (object)blendState.dstBlend, (object)blendState.srcBlendAlpha, (object)blendState.dstBlendAlpha, (object)str), EditorStyles.miniLabel, new GUILayoutOption[0]);
            GUILayout.Label(string.Format("ZTest {0} ZWrite {1} Cull {2} Offset {3}, {4}", (object)depthState.depthFunc, (object)(depthState.depthWrite != 0 ? "On" : "Off"), (object)rasterState.cullMode, (object)rasterState.slopeScaledDepthBias, (object)rasterState.depthBias), EditorStyles.miniLabel, new GUILayoutOption[0]);
        }
        private void DrawStates(FrameDebuggerEventData curEventData)
        {
            FrameDebuggerBlendState  blendState  = curEventData.blendState;
            FrameDebuggerRasterState rasterState = curEventData.rasterState;
            FrameDebuggerDepthState  depthState  = curEventData.depthState;
            string text = string.Format("Blend {0} {1}", blendState.srcBlend, blendState.dstBlend);

            if (blendState.srcBlendAlpha != blendState.srcBlend || blendState.dstBlendAlpha != blendState.dstBlend)
            {
                text += string.Format(", {0} {1}", blendState.srcBlendAlpha, blendState.dstBlendAlpha);
            }
            if (blendState.blendOp != BlendOp.Add || blendState.blendOpAlpha != BlendOp.Add)
            {
                if (blendState.blendOp == blendState.blendOpAlpha)
                {
                    text += string.Format(" BlendOp {0}", blendState.blendOp);
                }
                else
                {
                    text += string.Format(" BlendOp {0}, {1}", blendState.blendOp, blendState.blendOpAlpha);
                }
            }
            if (blendState.writeMask != 15u)
            {
                text += " ColorMask ";
                if (blendState.writeMask == 0u)
                {
                    text += '0';
                }
                else
                {
                    if ((blendState.writeMask & 2u) != 0u)
                    {
                        text += 'R';
                    }
                    if ((blendState.writeMask & 4u) != 0u)
                    {
                        text += 'G';
                    }
                    if ((blendState.writeMask & 8u) != 0u)
                    {
                        text += 'B';
                    }
                    if ((blendState.writeMask & 1u) != 0u)
                    {
                        text += 'A';
                    }
                }
            }
            GUILayout.Label(text, EditorStyles.miniLabel, new GUILayoutOption[0]);
            string text2 = string.Format("ZTest {0} ZWrite {1} Cull {2}", depthState.depthFunc, (depthState.depthWrite != 0) ? "On" : "Off", rasterState.cullMode);

            if (rasterState.slopeScaledDepthBias != 0f || rasterState.depthBias != 0)
            {
                text2 += string.Format(" Offset {0}, {1}", rasterState.slopeScaledDepthBias, rasterState.depthBias);
            }
            GUILayout.Label(text2, EditorStyles.miniLabel, new GUILayoutOption[0]);
        }
        private void DrawStates(FrameDebuggerEventData curEventData)
        {
            FrameDebuggerBlendState  blendState  = curEventData.blendState;
            FrameDebuggerRasterState rasterState = curEventData.rasterState;
            FrameDebuggerDepthState  depthState  = curEventData.depthState;
            string text = string.Empty;

            if (blendState.renderTargetWriteMask == 0u)
            {
                text = "0";
            }
            else
            {
                if ((blendState.renderTargetWriteMask & 2u) != 0u)
                {
                    text += "R";
                }
                if ((blendState.renderTargetWriteMask & 4u) != 0u)
                {
                    text += "G";
                }
                if ((blendState.renderTargetWriteMask & 8u) != 0u)
                {
                    text += "B";
                }
                if ((blendState.renderTargetWriteMask & 1u) != 0u)
                {
                    text += "A";
                }
            }
            GUILayout.Label(string.Format("Blend {0} {1}, {2} {3} ColorMask {4}", new object[]
            {
                blendState.srcBlend,
                blendState.dstBlend,
                blendState.srcBlendAlpha,
                blendState.dstBlendAlpha,
                text
            }), EditorStyles.miniLabel, new GUILayoutOption[0]);
            GUILayout.Label(string.Format("ZTest {0} ZWrite {1} Cull {2} Offset {3}, {4}", new object[]
            {
                depthState.depthFunc,
                (depthState.depthWrite != 0) ? "On" : "Off",
                rasterState.cullMode,
                rasterState.slopeScaledDepthBias,
                rasterState.depthBias
            }), EditorStyles.miniLabel, new GUILayoutOption[0]);
        }
示例#5
0
        private void DrawStates(FrameDebuggerEventData curEventData)
        {
            FrameDebuggerBlendState  blendState  = curEventData.blendState;
            FrameDebuggerRasterState rasterState = curEventData.rasterState;
            FrameDebuggerDepthState  depthState  = curEventData.depthState;
            string text = string.Format("{0} {1}", blendState.srcBlend, blendState.dstBlend);

            if (blendState.srcBlendAlpha != blendState.srcBlend || blendState.dstBlendAlpha != blendState.dstBlend)
            {
                text += string.Format(", {0} {1}", blendState.srcBlendAlpha, blendState.dstBlendAlpha);
            }
            EditorGUILayout.LabelField("Blend", text, new GUILayoutOption[0]);
            if (blendState.blendOp != BlendOp.Add || blendState.blendOpAlpha != BlendOp.Add)
            {
                string label;
                if (blendState.blendOp == blendState.blendOpAlpha)
                {
                    label = blendState.blendOp.ToString();
                }
                else
                {
                    label = string.Format("{0}, {1}", blendState.blendOp, blendState.blendOpAlpha);
                }
                EditorGUILayout.LabelField("BlendOp", label, new GUILayoutOption[0]);
            }
            if (blendState.writeMask != 15u)
            {
                string text2 = "";
                if (blendState.writeMask == 0u)
                {
                    text2 += '0';
                }
                else
                {
                    if ((blendState.writeMask & 2u) != 0u)
                    {
                        text2 += 'R';
                    }
                    if ((blendState.writeMask & 4u) != 0u)
                    {
                        text2 += 'G';
                    }
                    if ((blendState.writeMask & 8u) != 0u)
                    {
                        text2 += 'B';
                    }
                    if ((blendState.writeMask & 1u) != 0u)
                    {
                        text2 += 'A';
                    }
                }
                EditorGUILayout.LabelField("ColorMask", text2, new GUILayoutOption[0]);
            }
            EditorGUILayout.LabelField("ZTest", depthState.depthFunc.ToString(), new GUILayoutOption[0]);
            EditorGUILayout.LabelField("ZWrite", (depthState.depthWrite != 0) ? "On" : "Off", new GUILayoutOption[0]);
            EditorGUILayout.LabelField("Cull", rasterState.cullMode.ToString(), new GUILayoutOption[0]);
            if (rasterState.slopeScaledDepthBias != 0f || rasterState.depthBias != 0)
            {
                string label2 = string.Format("{0}, {1}", rasterState.slopeScaledDepthBias, rasterState.depthBias);
                EditorGUILayout.LabelField("Offset", label2, new GUILayoutOption[0]);
            }
        }