Пример #1
0
 private void DrawRenderTargetControls(FrameDebuggerEvent cur)
 {
     if ((cur.rtWidth > 0) && (cur.rtHeight > 0))
     {
         bool  disabled = (cur.rtFormat == 1) || (cur.rtFormat == 3);
         bool  flag2    = cur.rtHasDepthTexture != 0;
         short rtCount  = cur.rtCount;
         if (flag2)
         {
             rtCount = (short)(rtCount + 1);
         }
         GUILayout.Label("RenderTarget: " + cur.rtName, EditorStyles.boldLabel, new GUILayoutOption[0]);
         GUILayout.BeginHorizontal(EditorStyles.toolbar, new GUILayoutOption[0]);
         EditorGUI.BeginChangeCheck();
         EditorGUI.BeginDisabledGroup(rtCount <= 1);
         GUIContent[] displayedOptions = new GUIContent[rtCount];
         for (int i = 0; i < cur.rtCount; i++)
         {
             displayedOptions[i] = Styles.mrtLabels[i];
         }
         if (flag2)
         {
             displayedOptions[cur.rtCount] = Styles.depthLabel;
         }
         int  num3  = Mathf.Clamp(this.m_RTIndex, 0, rtCount - 1);
         bool flag3 = num3 != this.m_RTIndex;
         this.m_RTIndex = num3;
         GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.Width(70f) };
         this.m_RTIndex = EditorGUILayout.Popup(this.m_RTIndex, displayedOptions, EditorStyles.toolbarPopup, options);
         EditorGUI.EndDisabledGroup();
         GUILayout.Space(10f);
         EditorGUI.BeginDisabledGroup(disabled);
         GUILayout.Label(Styles.channelHeader, EditorStyles.miniLabel, new GUILayoutOption[0]);
         this.m_RTChannel = GUILayout.Toolbar(this.m_RTChannel, Styles.channelLabels, EditorStyles.toolbarButton, new GUILayoutOption[0]);
         EditorGUI.EndDisabledGroup();
         GUILayout.Space(10f);
         GUILayout.Label(Styles.levelsHeader, EditorStyles.miniLabel, new GUILayoutOption[0]);
         GUILayoutOption[] optionArray2 = new GUILayoutOption[] { GUILayout.MaxWidth(200f) };
         EditorGUILayout.MinMaxSlider(ref this.m_RTBlackLevel, ref this.m_RTWhiteLevel, 0f, 1f, optionArray2);
         if (EditorGUI.EndChangeCheck() || flag3)
         {
             Vector4 zero = Vector4.zero;
             if (this.m_RTChannel == 1)
             {
                 zero.x = 1f;
             }
             else if (this.m_RTChannel == 2)
             {
                 zero.y = 1f;
             }
             else if (this.m_RTChannel == 3)
             {
                 zero.z = 1f;
             }
             else if (this.m_RTChannel == 4)
             {
                 zero.w = 1f;
             }
             else
             {
                 zero = Vector4.one;
             }
             int rTIndex = this.m_RTIndex;
             if (rTIndex >= cur.rtCount)
             {
                 rTIndex = -1;
             }
             FrameDebuggerUtility.SetRenderTargetDisplayOptions(rTIndex, zero, this.m_RTBlackLevel, this.m_RTWhiteLevel);
             this.RepaintAllNeededThings();
         }
         GUILayout.FlexibleSpace();
         GUILayout.EndHorizontal();
         GUILayout.Label(string.Format("{0}x{1} {2}", cur.rtWidth, cur.rtHeight, (RenderTextureFormat)cur.rtFormat), new GUILayoutOption[0]);
         if (cur.rtDim == 4)
         {
             GUILayout.Label("Rendering into cubemap", new GUILayoutOption[0]);
         }
         if ((cur.rtFormat == 3) && SystemInfo.graphicsDeviceVersion.StartsWith("Direct3D 9"))
         {
             EditorGUILayout.HelpBox("Rendering into shadowmap on DX9, can't visualize it in the game view properly", MessageType.Info, true);
         }
     }
 }
Пример #2
0
 private void DrawRenderTargetControls(FrameDebuggerEventData cur)
 {
     if (cur.rtWidth > 0 && cur.rtHeight > 0)
     {
         bool  disabled = cur.rtFormat == 1 || cur.rtFormat == 3;
         bool  flag     = cur.rtHasDepthTexture != 0;
         short num      = cur.rtCount;
         if (flag)
         {
             num += 1;
         }
         EditorGUILayout.LabelField("RenderTarget", cur.rtName, new GUILayoutOption[0]);
         GUILayout.BeginHorizontal(EditorStyles.toolbar, new GUILayoutOption[0]);
         EditorGUI.BeginChangeCheck();
         bool flag2;
         using (new EditorGUI.DisabledScope(num <= 1))
         {
             GUIContent[] array = new GUIContent[(int)num];
             for (int i = 0; i < (int)cur.rtCount; i++)
             {
                 array[i] = FrameDebuggerWindow.Styles.mrtLabels[i];
             }
             if (flag)
             {
                 array[(int)cur.rtCount] = FrameDebuggerWindow.Styles.depthLabel;
             }
             int num2 = Mathf.Clamp(this.m_RTIndex, 0, (int)(num - 1));
             flag2          = (num2 != this.m_RTIndex);
             this.m_RTIndex = num2;
             this.m_RTIndex = EditorGUILayout.Popup(this.m_RTIndex, array, EditorStyles.toolbarPopup, new GUILayoutOption[]
             {
                 GUILayout.Width(70f)
             });
         }
         GUILayout.Space(10f);
         using (new EditorGUI.DisabledScope(disabled))
         {
             GUILayout.Label(FrameDebuggerWindow.Styles.channelHeader, EditorStyles.miniLabel, new GUILayoutOption[0]);
             this.m_RTChannel = GUILayout.Toolbar(this.m_RTChannel, FrameDebuggerWindow.Styles.channelLabels, EditorStyles.toolbarButton, new GUILayoutOption[0]);
         }
         GUILayout.Space(10f);
         GUILayout.Label(FrameDebuggerWindow.Styles.levelsHeader, EditorStyles.miniLabel, new GUILayoutOption[0]);
         EditorGUILayout.MinMaxSlider(ref this.m_RTBlackLevel, ref this.m_RTWhiteLevel, 0f, 1f, new GUILayoutOption[]
         {
             GUILayout.MaxWidth(200f)
         });
         if (EditorGUI.EndChangeCheck() || flag2)
         {
             Vector4 channels = Vector4.zero;
             if (this.m_RTChannel == 1)
             {
                 channels.x = 1f;
             }
             else if (this.m_RTChannel == 2)
             {
                 channels.y = 1f;
             }
             else if (this.m_RTChannel == 3)
             {
                 channels.z = 1f;
             }
             else if (this.m_RTChannel == 4)
             {
                 channels.w = 1f;
             }
             else
             {
                 channels = Vector4.one;
             }
             int num3 = this.m_RTIndex;
             if (num3 >= (int)cur.rtCount)
             {
                 num3 = -1;
             }
             FrameDebuggerUtility.SetRenderTargetDisplayOptions(num3, channels, this.m_RTBlackLevel, this.m_RTWhiteLevel);
             this.RepaintAllNeededThings();
         }
         GUILayout.FlexibleSpace();
         GUILayout.EndHorizontal();
         GUILayout.Label(string.Format("{0}x{1} {2}", cur.rtWidth, cur.rtHeight, (RenderTextureFormat)cur.rtFormat), new GUILayoutOption[0]);
         if (cur.rtDim == 4)
         {
             GUILayout.Label("Rendering into cubemap", new GUILayoutOption[0]);
         }
         if (cur.rtFormat == 3 && SystemInfo.graphicsDeviceVersion.StartsWith("Direct3D 9"))
         {
             EditorGUILayout.HelpBox("Rendering into shadowmap on DX9, can't visualize it in the game view properly", MessageType.Info, true);
         }
     }
 }
Пример #3
0
        private void DrawRenderTargetControls(FrameDebuggerEventData cur)
        {
            if (cur.rtWidth <= 0 || cur.rtHeight <= 0)
            {
                return;
            }
            bool  disabled = cur.rtFormat == 1 || cur.rtFormat == 3;
            bool  flag1    = (int)cur.rtHasDepthTexture != 0;
            short rtCount  = cur.rtCount;

            if (flag1)
            {
                ++rtCount;
            }
            GUILayout.Label("RenderTarget: " + cur.rtName, EditorStyles.boldLabel, new GUILayoutOption[0]);
            GUILayout.BeginHorizontal(EditorStyles.toolbar, new GUILayoutOption[0]);
            EditorGUI.BeginChangeCheck();
            EditorGUI.BeginDisabledGroup((int)rtCount <= 1);
            GUIContent[] displayedOptions = new GUIContent[(int)rtCount];
            for (int index = 0; index < (int)cur.rtCount; ++index)
            {
                displayedOptions[index] = FrameDebuggerWindow.Styles.mrtLabels[index];
            }
            if (flag1)
            {
                displayedOptions[(int)cur.rtCount] = FrameDebuggerWindow.Styles.depthLabel;
            }
            int  num   = Mathf.Clamp(this.m_RTIndex, 0, (int)rtCount - 1);
            bool flag2 = num != this.m_RTIndex;

            this.m_RTIndex = num;
            this.m_RTIndex = EditorGUILayout.Popup(this.m_RTIndex, displayedOptions, EditorStyles.toolbarPopup, new GUILayoutOption[1]
            {
                GUILayout.Width(70f)
            });
            EditorGUI.EndDisabledGroup();
            GUILayout.Space(10f);
            EditorGUI.BeginDisabledGroup(disabled);
            GUILayout.Label(FrameDebuggerWindow.Styles.channelHeader, EditorStyles.miniLabel, new GUILayoutOption[0]);
            this.m_RTChannel = GUILayout.Toolbar(this.m_RTChannel, FrameDebuggerWindow.Styles.channelLabels, EditorStyles.toolbarButton, new GUILayoutOption[0]);
            EditorGUI.EndDisabledGroup();
            GUILayout.Space(10f);
            GUILayout.Label(FrameDebuggerWindow.Styles.levelsHeader, EditorStyles.miniLabel, new GUILayoutOption[0]);
            EditorGUILayout.MinMaxSlider(ref this.m_RTBlackLevel, ref this.m_RTWhiteLevel, 0.0f, 1f, GUILayout.MaxWidth(200f));
            if (EditorGUI.EndChangeCheck() || flag2)
            {
                Vector4 channels = Vector4.zero;
                if (this.m_RTChannel == 1)
                {
                    channels.x = 1f;
                }
                else if (this.m_RTChannel == 2)
                {
                    channels.y = 1f;
                }
                else if (this.m_RTChannel == 3)
                {
                    channels.z = 1f;
                }
                else if (this.m_RTChannel == 4)
                {
                    channels.w = 1f;
                }
                else
                {
                    channels = Vector4.one;
                }
                int rtIndex = this.m_RTIndex;
                if (rtIndex >= (int)cur.rtCount)
                {
                    rtIndex = -1;
                }
                FrameDebuggerUtility.SetRenderTargetDisplayOptions(rtIndex, channels, this.m_RTBlackLevel, this.m_RTWhiteLevel);
                this.RepaintAllNeededThings();
            }
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
            GUILayout.Label(string.Format("{0}x{1} {2}", (object)cur.rtWidth, (object)cur.rtHeight, (object)(RenderTextureFormat)cur.rtFormat));
            if (cur.rtDim == 4)
            {
                GUILayout.Label("Rendering into cubemap");
            }
            if (cur.rtFormat != 3 || !SystemInfo.graphicsDeviceVersion.StartsWith("Direct3D 9"))
            {
                return;
            }
            EditorGUILayout.HelpBox("Rendering into shadowmap on DX9, can't visualize it in the game view properly", MessageType.Info, true);
        }