private void LightmapPerformanceStats(int index)
        {
            GUILayout.BeginVertical(new GUILayoutOption[0]);
            GUILayout.Label("Index: " + index, EditorStyles.miniLabel, new GUILayoutOption[0]);
            LightmapConvergence lightmapConvergence = Lightmapping.GetLightmapConvergence(index);

            if (lightmapConvergence.IsValid())
            {
                GUILayout.Label("Occupied: " + InternalEditorUtility.CountToString((ulong)((long)lightmapConvergence.occupiedTexelCount)), EditorStyles.miniLabel, new GUILayoutOption[0]);
                GUIContent content = EditorGUIUtility.TrTextContent(string.Concat(new object[]
                {
                    "Direct: ",
                    lightmapConvergence.minDirectSamples,
                    " / ",
                    lightmapConvergence.maxDirectSamples,
                    " / ",
                    lightmapConvergence.avgDirectSamples,
                    ""
                }), "min / max / avg samples per texel", null);
                GUILayout.Label(content, EditorStyles.miniLabel, new GUILayoutOption[0]);
                GUIContent content2 = EditorGUIUtility.TrTextContent(string.Concat(new object[]
                {
                    "GI: ",
                    lightmapConvergence.minGISamples,
                    " / ",
                    lightmapConvergence.maxGISamples,
                    " / ",
                    lightmapConvergence.avgGISamples,
                    ""
                }), "min / max / avg samples per texel", null);
                GUILayout.Label(content2, EditorStyles.miniLabel, new GUILayoutOption[0]);
            }
            else
            {
                GUILayout.Label("Occupied: N/A", EditorStyles.miniLabel, new GUILayoutOption[0]);
                GUILayout.Label("Direct: N/A", EditorStyles.miniLabel, new GUILayoutOption[0]);
                GUILayout.Label("GI: N/A", EditorStyles.miniLabel, new GUILayoutOption[0]);
            }
            float lightmapBakePerformance = Lightmapping.GetLightmapBakePerformance(index);

            if ((double)lightmapBakePerformance >= 0.0)
            {
                GUILayout.Label(lightmapBakePerformance.ToString("0.00") + " mrays/sec", EditorStyles.miniLabel, new GUILayoutOption[0]);
            }
            else
            {
                GUILayout.Label("N/A mrays/sec", EditorStyles.miniLabel, new GUILayoutOption[0]);
            }
            GUILayout.EndVertical();
        }
예제 #2
0
        void LightmapPerformanceStats(int index)
        {
            GUILayout.BeginVertical();

            GUILayout.Label("Index: " + index, EditorStyles.miniLabel);

            LightmapConvergence lc = Lightmapping.GetLightmapConvergence(index);

            if (lc.IsValid())
            {
                GUILayout.Label("Occupied: " + InternalEditorUtility.CountToString((ulong)lc.occupiedTexelCount), EditorStyles.miniLabel);

                GUIContent direct = EditorGUIUtility.TrTextContent("Direct: " + lc.minDirectSamples + " / " + lc.maxDirectSamples + " / " + lc.avgDirectSamples + "", "min / max / avg samples per texel");
                GUILayout.Label(direct, EditorStyles.miniLabel);

                GUIContent gi = EditorGUIUtility.TrTextContent("GI: " + lc.minGISamples + " / " + lc.maxGISamples + " / " + lc.avgGISamples + "", "min / max / avg samples per texel");
                GUILayout.Label(gi, EditorStyles.miniLabel);
            }
            else
            {
                GUILayout.Label("Occupied: N/A", EditorStyles.miniLabel);
                GUILayout.Label("Direct: N/A", EditorStyles.miniLabel);
                GUILayout.Label("GI: N/A", EditorStyles.miniLabel);
            }
            float mraysPerSec = Lightmapping.GetLightmapBakePerformance(index);

            if (mraysPerSec >= 0.0)
            {
                GUILayout.Label(mraysPerSec.ToString("0.00") + " mrays/sec", EditorStyles.miniLabel);
            }
            else
            {
                GUILayout.Label("N/A mrays/sec", EditorStyles.miniLabel);
            }

            GUILayout.EndVertical();
        }
예제 #3
0
        void Summary()
        {
            GUILayout.BeginVertical(EditorStyles.helpBox);

            long totalMemorySize            = 0;
            int  lightmapCount              = 0;
            Dictionary <Vector2, int> sizes = new Dictionary <Vector2, int>();
            bool directionalLightmapsMode   = false;
            bool shadowmaskMode             = false;

            foreach (LightmapData ld in LightmapSettings.lightmaps)
            {
                if (ld.lightmapColor == null)
                {
                    continue;
                }
                lightmapCount++;

                Vector2 texSize = new Vector2(ld.lightmapColor.width, ld.lightmapColor.height);
                if (sizes.ContainsKey(texSize))
                {
                    sizes[texSize]++;
                }
                else
                {
                    sizes.Add(texSize, 1);
                }

                totalMemorySize += TextureUtil.GetStorageMemorySizeLong(ld.lightmapColor);
                if (ld.lightmapDir)
                {
                    totalMemorySize         += TextureUtil.GetStorageMemorySizeLong(ld.lightmapDir);
                    directionalLightmapsMode = true;
                }
                if (ld.shadowMask)
                {
                    totalMemorySize += TextureUtil.GetStorageMemorySizeLong(ld.shadowMask);
                    shadowmaskMode   = true;
                }
            }
            StringBuilder sizesString = new StringBuilder();

            sizesString.Append(lightmapCount);
            sizesString.Append((directionalLightmapsMode ? " Directional" : " Non-Directional"));
            sizesString.Append(" Lightmap");
            if (lightmapCount != 1)
            {
                sizesString.Append("s");
            }
            if (shadowmaskMode)
            {
                sizesString.Append(" with Shadowmask");
                if (lightmapCount != 1)
                {
                    sizesString.Append("s");
                }
            }

            bool first = true;

            foreach (var s in sizes)
            {
                sizesString.Append(first ? ": " : ", ");
                first = false;
                if (s.Value > 1)
                {
                    sizesString.Append(s.Value);
                    sizesString.Append("x");
                }
                sizesString.Append(s.Key.x.ToString(CultureInfo.InvariantCulture.NumberFormat));
                sizesString.Append("x");
                sizesString.Append(s.Key.y.ToString(CultureInfo.InvariantCulture.NumberFormat));
                sizesString.Append("px");
            }
            sizesString.Append(" ");

            GUILayout.BeginHorizontal();

            GUILayout.BeginVertical();
            GUILayout.Label(sizesString.ToString(), Styles.LabelStyle);
            GUILayout.EndVertical();

            GUILayout.BeginVertical();
            GUILayout.Label(EditorUtility.FormatBytes(totalMemorySize), Styles.LabelStyle);
            GUILayout.Label((lightmapCount == 0 ? "No Lightmaps" : ""), Styles.LabelStyle);
            GUILayout.EndVertical();

            GUILayout.EndHorizontal();

            if (LightmapEditorSettings.lightmapper != LightmapEditorSettings.Lightmapper.Enlighten)
            {
                GUILayout.BeginVertical();
                GUILayout.Label("Occupied Texels: " + InternalEditorUtility.CountToString(Lightmapping.occupiedTexelCount), Styles.LabelStyle);
                if (Lightmapping.isRunning)
                {
                    int numLightmapsInView             = 0;
                    int numConvergedLightmapsInView    = 0;
                    int numNotConvergedLightmapsInView = 0;

                    int numLightmapsNotInView             = 0;
                    int numConvergedLightmapsNotInView    = 0;
                    int numNotConvergedLightmapsNotInView = 0;

                    int numLightmaps = LightmapSettings.lightmaps.Length;
                    for (int i = 0; i < numLightmaps; ++i)
                    {
                        LightmapConvergence lc = Lightmapping.GetLightmapConvergence(i);
                        if (!lc.IsValid())
                        {
                            continue;
                        }

                        if (Lightmapping.GetVisibleTexelCount(i) > 0)
                        {
                            numLightmapsInView++;
                            if (lc.IsConverged())
                            {
                                numConvergedLightmapsInView++;
                            }
                            else
                            {
                                numNotConvergedLightmapsInView++;
                            }
                        }
                        else
                        {
                            numLightmapsNotInView++;
                            if (lc.IsConverged())
                            {
                                numConvergedLightmapsNotInView++;
                            }
                            else
                            {
                                numNotConvergedLightmapsNotInView++;
                            }
                        }
                    }
                    if (Lightmapping.atlasCount > 0)
                    {
                        int convergedMaps = numConvergedLightmapsInView + numConvergedLightmapsNotInView;
                        GUILayout.Label("Lightmap convergence: (" + convergedMaps + "/" + Lightmapping.atlasCount + ")", Styles.LabelStyle);
                    }
                    EditorGUILayout.LabelField("Lightmaps in view: " + numLightmapsInView, Styles.LabelStyle);
                    EditorGUI.indentLevel += 1;
                    EditorGUILayout.LabelField("Converged: " + numConvergedLightmapsInView, Styles.LabelStyle);
                    EditorGUILayout.LabelField("Not Converged: " + numNotConvergedLightmapsInView, Styles.LabelStyle);
                    EditorGUI.indentLevel -= 1;
                    EditorGUILayout.LabelField("Lightmaps not in view: " + numLightmapsNotInView, Styles.LabelStyle);
                    EditorGUI.indentLevel += 1;
                    EditorGUILayout.LabelField("Converged: " + numConvergedLightmapsNotInView, Styles.LabelStyle);
                    EditorGUILayout.LabelField("Not Converged: " + numNotConvergedLightmapsNotInView, Styles.LabelStyle);
                    EditorGUI.indentLevel -= 1;

                    LightProbesConvergence lpc = Lightmapping.GetLightProbesConvergence();
                    if (lpc.IsValid() && lpc.probeSetCount > 0)
                    {
                        GUILayout.Label("Light Probes convergence: (" + lpc.convergedProbeSetCount + "/" + lpc.probeSetCount + ")", Styles.LabelStyle);
                    }
                }
                float bakeTime    = Lightmapping.GetLightmapBakeTimeTotal();
                float mraysPerSec = Lightmapping.GetLightmapBakePerformanceTotal();
                if (mraysPerSec >= 0.0)
                {
                    GUILayout.Label("Bake Performance: " + mraysPerSec.ToString("0.00", CultureInfo.InvariantCulture.NumberFormat) + " mrays/sec", Styles.LabelStyle);
                }
                if (!Lightmapping.isRunning)
                {
                    float bakeTimeRaw = Lightmapping.GetLightmapBakeTimeRaw();
                    if (bakeTime >= 0.0)
                    {
                        int time  = (int)bakeTime;
                        int timeH = time / 3600;
                        time -= 3600 * timeH;
                        int timeM = time / 60;
                        time -= 60 * timeM;
                        int timeS = time;

                        int timeRaw  = (int)bakeTimeRaw;
                        int timeRawH = timeRaw / 3600;
                        timeRaw -= 3600 * timeRawH;
                        int timeRawM = timeRaw / 60;
                        timeRaw -= 60 * timeRawM;
                        int timeRawS = timeRaw;

                        int oHeadTime  = Math.Max(0, (int)(bakeTime - bakeTimeRaw));
                        int oHeadTimeH = oHeadTime / 3600;
                        oHeadTime -= 3600 * oHeadTimeH;
                        int oHeadTimeM = oHeadTime / 60;
                        oHeadTime -= 60 * oHeadTimeM;
                        int oHeadTimeS = oHeadTime;


                        GUILayout.Label("Total Bake Time: " + timeH.ToString("0") + ":" + timeM.ToString("00") + ":" + timeS.ToString("00"), Styles.LabelStyle);
                        if (Unsupported.IsDeveloperBuild())
                        {
                            GUILayout.Label("(Raw Bake Time: " + timeRawH.ToString("0") + ":" + timeRawM.ToString("00") + ":" + timeRawS.ToString("00") + ", Overhead: " + oHeadTimeH.ToString("0") + ":" + oHeadTimeM.ToString("00") + ":" + oHeadTimeS.ToString("00") + ")", Styles.LabelStyle);
                        }
                    }
                }
                string deviceName = Lightmapping.GetLightmapBakeGPUDeviceName();
                if (deviceName.Length > 0)
                {
                    GUILayout.Label("Baking device: " + deviceName, Styles.LabelStyle);
                }
                GUILayout.EndVertical();
            }

            GUILayout.EndVertical();
        }
예제 #4
0
        private void LightmapDebugInfo(int index)
        {
            if (!showDebugInfo)
            {
                return;
            }

            GUILayout.Space(5);
            GUILayout.BeginVertical();

            LightmapConvergence lc = Lightmapping.GetLightmapConvergence(index);

            if (lc.IsValid())
            {
                GUILayout.Label("Occupied: " + InternalEditorUtility.CountToString((ulong)lc.occupiedTexelCount), EditorStyles.miniLabel);

                GUIContent direct = EditorGUIUtility.TrTextContent("Direct: " + lc.minDirectSamples + " / " + lc.maxDirectSamples + " / " + lc.avgDirectSamples + "", "min / max / avg samples per texel");
                GUILayout.Label(direct, EditorStyles.miniLabel);

                GUIContent gi = EditorGUIUtility.TrTextContent("GI: " + lc.minGISamples + " / " + lc.maxGISamples + " / " + lc.avgGISamples + "", "min / max / avg samples per texel");
                GUILayout.Label(gi, EditorStyles.miniLabel);
            }
            else
            {
                GUILayout.Label("Occupied: N/A", EditorStyles.miniLabel);
                GUILayout.Label("Direct: N/A", EditorStyles.miniLabel);
                GUILayout.Label("GI: N/A", EditorStyles.miniLabel);
            }
            float mraysPerSec = Lightmapping.GetLightmapBakePerformance(index);

            if (mraysPerSec >= 0.0)
            {
                GUILayout.Label(mraysPerSec.ToString("0.00") + " mrays/sec", EditorStyles.miniLabel);
            }
            else
            {
                GUILayout.Label("N/A mrays/sec", EditorStyles.miniLabel);
            }

            LightmapMemory lightmapMemory = Lightmapping.GetLightmapMemory(index);

            GUILayout.Label("Lightmap data: " + SizeString(lightmapMemory.lightmapDataSizeCPU), EditorStyles.miniLabel);

            GUILayout.EndVertical();
            GUILayout.Space(5);
            GUILayout.BeginVertical();

            GUIContent lightmapTexturesSizeContent = null;

            if (lightmapMemory.lightmapTexturesSize > 0.0f)
            {
                lightmapTexturesSizeContent = EditorGUIUtility.TrTextContent("Lightmap textures: " + SizeString(lightmapMemory.lightmapTexturesSize));
            }
            else
            {
                lightmapTexturesSizeContent = EditorGUIUtility.TrTextContent("Lightmap textures: N/A", "This lightmap has converged and is not owned by the Progressive Lightmapper anymore.");
            }
            GUILayout.Label(lightmapTexturesSizeContent, EditorStyles.miniLabel);

            GUIContent GPUSizeContent = null;

            if (lightmapMemory.lightmapDataSizeGPU > 0.0f)
            {
                GPUSizeContent = EditorGUIUtility.TrTextContent("GPU memory: " + SizeString(lightmapMemory.lightmapDataSizeGPU));
            }
            else
            {
                GPUSizeContent = EditorGUIUtility.TrTextContent("GPU memory: N/A");
            }
            GUILayout.Label(GPUSizeContent, EditorStyles.miniLabel);

            GUILayout.EndVertical();
        }
예제 #5
0
        private void Summary()
        {
            GUILayout.BeginVertical(EditorStyles.helpBox, new GUILayoutOption[0]);
            long num  = 0L;
            int  num2 = 0;
            Dictionary <Vector2, int> dictionary = new Dictionary <Vector2, int>();
            bool flag  = false;
            bool flag2 = false;

            LightmapData[] lightmaps = LightmapSettings.lightmaps;
            for (int i = 0; i < lightmaps.Length; i++)
            {
                LightmapData lightmapData = lightmaps[i];
                if (!(lightmapData.lightmapColor == null))
                {
                    num2++;
                    Vector2 vector = new Vector2((float)lightmapData.lightmapColor.width, (float)lightmapData.lightmapColor.height);
                    if (dictionary.ContainsKey(vector))
                    {
                        Dictionary <Vector2, int> dictionary2;
                        Vector2 key;
                        (dictionary2 = dictionary)[key = vector] = dictionary2[key] + 1;
                    }
                    else
                    {
                        dictionary.Add(vector, 1);
                    }
                    num += TextureUtil.GetStorageMemorySizeLong(lightmapData.lightmapColor);
                    if (lightmapData.lightmapDir)
                    {
                        num += TextureUtil.GetStorageMemorySizeLong(lightmapData.lightmapDir);
                        flag = true;
                    }
                    if (lightmapData.shadowMask)
                    {
                        num  += TextureUtil.GetStorageMemorySizeLong(lightmapData.shadowMask);
                        flag2 = true;
                    }
                }
            }
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append(num2);
            stringBuilder.Append((!flag) ? " non-directional" : " directional");
            stringBuilder.Append(" lightmap");
            if (num2 != 1)
            {
                stringBuilder.Append("s");
            }
            if (flag2)
            {
                stringBuilder.Append(" with shadowmask");
                if (num2 != 1)
                {
                    stringBuilder.Append("s");
                }
            }
            bool flag3 = true;

            foreach (KeyValuePair <Vector2, int> current in dictionary)
            {
                stringBuilder.Append((!flag3) ? ", " : ": ");
                flag3 = false;
                if (current.Value > 1)
                {
                    stringBuilder.Append(current.Value);
                    stringBuilder.Append("x");
                }
                stringBuilder.Append(current.Key.x);
                stringBuilder.Append("x");
                stringBuilder.Append(current.Key.y);
                stringBuilder.Append("px");
            }
            stringBuilder.Append(" ");
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayout.BeginVertical(new GUILayoutOption[0]);
            GUILayout.Label(stringBuilder.ToString(), LightingWindow.Styles.labelStyle, new GUILayoutOption[0]);
            GUILayout.EndVertical();
            GUILayout.BeginVertical(new GUILayoutOption[0]);
            GUILayout.Label(EditorUtility.FormatBytes(num), LightingWindow.Styles.labelStyle, new GUILayoutOption[0]);
            GUILayout.Label((num2 != 0) ? "" : "No Lightmaps", LightingWindow.Styles.labelStyle, new GUILayoutOption[0]);
            GUILayout.EndVertical();
            GUILayout.EndHorizontal();
            if (LightmapEditorSettings.giBakeBackend == LightmapEditorSettings.GIBakeBackend.PathTracer)
            {
                GUILayout.BeginVertical(new GUILayoutOption[0]);
                GUILayout.Label("Occupied texels: " + InternalEditorUtility.CountToString(Lightmapping.occupiedTexelCount), LightingWindow.Styles.labelStyle, new GUILayoutOption[0]);
                if (Lightmapping.isRunning)
                {
                    int num3  = 0;
                    int num4  = 0;
                    int num5  = 0;
                    int num6  = 0;
                    int num7  = 0;
                    int num8  = 0;
                    int num9  = 0;
                    int num10 = LightmapSettings.lightmaps.Length;
                    for (int j = 0; j < num10; j++)
                    {
                        LightmapConvergence lightmapConvergence = Lightmapping.GetLightmapConvergence(j);
                        if (!lightmapConvergence.IsValid())
                        {
                            num9++;
                        }
                        else if (Lightmapping.GetVisibleTexelCount(j) > 0uL)
                        {
                            num3++;
                            if (lightmapConvergence.IsConverged())
                            {
                                num4++;
                            }
                            else
                            {
                                num5++;
                            }
                        }
                        else
                        {
                            num6++;
                            if (lightmapConvergence.IsConverged())
                            {
                                num7++;
                            }
                            else
                            {
                                num8++;
                            }
                        }
                    }
                    EditorGUILayout.LabelField("Lightmaps in view: " + num3, LightingWindow.Styles.labelStyle, new GUILayoutOption[0]);
                    EditorGUI.indentLevel++;
                    EditorGUILayout.LabelField("converged: " + num4, LightingWindow.Styles.labelStyle, new GUILayoutOption[0]);
                    EditorGUILayout.LabelField("not converged: " + num5, LightingWindow.Styles.labelStyle, new GUILayoutOption[0]);
                    EditorGUI.indentLevel--;
                    EditorGUILayout.LabelField("Lightmaps out of view: " + num6, LightingWindow.Styles.labelStyle, new GUILayoutOption[0]);
                    EditorGUI.indentLevel++;
                    EditorGUILayout.LabelField("converged: " + num7, LightingWindow.Styles.labelStyle, new GUILayoutOption[0]);
                    EditorGUILayout.LabelField("not converged: " + num8, LightingWindow.Styles.labelStyle, new GUILayoutOption[0]);
                    EditorGUI.indentLevel--;
                }
                float lightmapBakeTimeTotal        = Lightmapping.GetLightmapBakeTimeTotal();
                float lightmapBakePerformanceTotal = Lightmapping.GetLightmapBakePerformanceTotal();
                if ((double)lightmapBakePerformanceTotal >= 0.0)
                {
                    GUILayout.Label("Bake performance: " + lightmapBakePerformanceTotal.ToString("0.00") + " mrays/sec", LightingWindow.Styles.labelStyle, new GUILayoutOption[0]);
                }
                if (!Lightmapping.isRunning)
                {
                    float lightmapBakeTimeRaw = Lightmapping.GetLightmapBakeTimeRaw();
                    if ((double)lightmapBakeTimeTotal >= 0.0)
                    {
                        int num11 = (int)lightmapBakeTimeTotal;
                        int num12 = num11 / 3600;
                        num11 -= 3600 * num12;
                        int num13 = num11 / 60;
                        num11 -= 60 * num13;
                        int num14 = num11;
                        int num15 = (int)lightmapBakeTimeRaw;
                        int num16 = num15 / 3600;
                        num15 -= 3600 * num16;
                        int num17 = num15 / 60;
                        num15 -= 60 * num17;
                        int num18 = num15;
                        int num19 = Math.Max(0, (int)(lightmapBakeTimeTotal - lightmapBakeTimeRaw));
                        int num20 = num19 / 3600;
                        num19 -= 3600 * num20;
                        int num21 = num19 / 60;
                        num19 -= 60 * num21;
                        int num22 = num19;
                        GUILayout.Label(string.Concat(new string[]
                        {
                            "Total bake time: ",
                            num12.ToString("0"),
                            ":",
                            num13.ToString("00"),
                            ":",
                            num14.ToString("00")
                        }), LightingWindow.Styles.labelStyle, new GUILayoutOption[0]);
                        if (Unsupported.IsDeveloperBuild())
                        {
                            GUILayout.Label(string.Concat(new string[]
                            {
                                "(Raw bake time: ",
                                num16.ToString("0"),
                                ":",
                                num17.ToString("00"),
                                ":",
                                num18.ToString("00"),
                                ", overhead:",
                                num20.ToString("0"),
                                ":",
                                num21.ToString("00"),
                                ":",
                                num22.ToString("00"),
                                ")"
                            }), LightingWindow.Styles.labelStyle, new GUILayoutOption[0]);
                        }
                    }
                }
                GUILayout.EndVertical();
            }
            GUILayout.EndVertical();
        }
예제 #6
0
        private void LightmapDebugInfo(int index)
        {
            if (!showDebugInfo)
            {
                return;
            }

            GUILayout.Space(5);
            GUILayout.BeginVertical();

            LightmapConvergence lc = Lightmapping.GetLightmapConvergence(index);

            if (lc.IsValid())
            {
                ulong occupiedTexels = (ulong)lc.occupiedTexelCount;
                if (lc.tilingMode > 0)
                {
                    // Make sure we display the total amount of occupied texels once lightmap is converged
                    // If tiling is on, and lightmap is not converged, display the occupied texel count in current tile
                    if (lc.IsConverged())
                    {
                        GUILayout.Label("Occupied: " + InternalEditorUtility.CountToString(occupiedTexels), EditorStyles.miniLabel);
                        GUILayout.Label("Baked using " + lc.GetTileCount() + " tiles", EditorStyles.miniLabel);
                    }
                    else
                    {
                        occupiedTexels = (ulong)lc.occupiedTexelCountInCurrentTile;
                        GUILayout.Label("Occupied (in tile): " + InternalEditorUtility.CountToString(occupiedTexels), EditorStyles.miniLabel);
                        GUILayout.Label("Baking pass (#tile): " + (lc.tilingPassNum + 1) + "/" + lc.GetTileCount(), EditorStyles.miniLabel);
                    }
                }
                else
                {
                    GUILayout.Label("Occupied: " + InternalEditorUtility.CountToString(occupiedTexels), EditorStyles.miniLabel);
                }
                GUIContent direct = EditorGUIUtility.TrTextContent("Direct: " + lc.minDirectSamples + " / " + lc.maxDirectSamples + " / " + lc.avgDirectSamples + "", "min / max / avg samples per texel");
                GUILayout.Label(direct, EditorStyles.miniLabel);

                GUIContent gi = EditorGUIUtility.TrTextContent("GI: " + lc.minGISamples + " / " + lc.maxGISamples + " / " + lc.avgGISamples + "", "min / max / avg samples per texel");
                GUILayout.Label(gi, EditorStyles.miniLabel);

                GUIContent env = EditorGUIUtility.TrTextContent("Environment: " + lc.minEnvSamples + " / " + lc.maxEnvSamples + " / " + lc.avgEnvSamples + "", "min / max / avg samples per texel");
                GUILayout.Label(env, EditorStyles.miniLabel);
            }
            else
            {
                GUILayout.Label("Occupied: N/A", EditorStyles.miniLabel);
                GUILayout.Label("Direct: N/A", EditorStyles.miniLabel);
                GUILayout.Label("GI: N/A", EditorStyles.miniLabel);
                GUILayout.Label("Environment: N/A", EditorStyles.miniLabel);
            }
            float mraysPerSec = Lightmapping.GetLightmapBakePerformance(index);

            if (mraysPerSec >= 0.0)
            {
                GUILayout.Label(mraysPerSec.ToString("0.00", CultureInfo.InvariantCulture.NumberFormat) + " mrays/sec", EditorStyles.miniLabel);
            }
            else
            {
                GUILayout.Label("N/A mrays/sec", EditorStyles.miniLabel);
            }

            GUILayout.EndVertical();
            GUILayout.Space(5);
            GUILayout.BeginVertical();

            LightmapMemory lightmapMemory = Lightmapping.GetLightmapMemory(index);

            GUILayout.Label("Lightmap data: " + SizeString(lightmapMemory.lightmapDataSizeCPU), EditorStyles.miniLabel);

            GUIContent lightmapTexturesSizeContent = null;

            if (lightmapMemory.lightmapTexturesSize > 0.0f)
            {
                lightmapTexturesSizeContent = EditorGUIUtility.TrTextContent("Lightmap textures: " + SizeString(lightmapMemory.lightmapTexturesSize));
            }
            else
            {
                lightmapTexturesSizeContent = EditorGUIUtility.TrTextContent("Lightmap textures: N/A", "This lightmap has converged and is not owned by the Progressive Lightmapper anymore.");
            }
            GUILayout.Label(lightmapTexturesSizeContent, EditorStyles.miniLabel);

            GUIContent GPUSizeContent = null;

            if (lightmapMemory.lightmapDataSizeGPU > 0.0f)
            {
                GPUSizeContent = EditorGUIUtility.TrTextContent("GPU memory: " + SizeString(lightmapMemory.lightmapDataSizeGPU));
            }
            else
            {
                GPUSizeContent = EditorGUIUtility.TrTextContent("GPU memory: N/A");
            }
            GUILayout.Label(GPUSizeContent, EditorStyles.miniLabel);

            GUILayout.EndVertical();
        }
 public void Maps()
 {
     if (LightingWindowLightmapPreviewTab.s_Styles == null)
     {
         LightingWindowLightmapPreviewTab.s_Styles = new LightingWindowLightmapPreviewTab.Styles();
     }
     GUI.changed = false;
     if (Lightmapping.giWorkflowMode == Lightmapping.GIWorkflowMode.OnDemand)
     {
         SerializedObject   serializedObject = new SerializedObject(LightmapEditorSettings.GetLightmapSettings());
         SerializedProperty property         = serializedObject.FindProperty("m_LightingDataAsset");
         EditorGUILayout.PropertyField(property, LightingWindowLightmapPreviewTab.s_Styles.LightingDataAsset, new GUILayoutOption[0]);
         serializedObject.ApplyModifiedProperties();
     }
     GUILayout.Space(10f);
     LightmapData[] lightmaps = LightmapSettings.lightmaps;
     this.m_ScrollPositionMaps = GUILayout.BeginScrollView(this.m_ScrollPositionMaps, new GUILayoutOption[0]);
     using (new EditorGUI.DisabledScope(true))
     {
         bool           flag  = false;
         bool           flag2 = false;
         LightmapData[] array = lightmaps;
         for (int i = 0; i < array.Length; i++)
         {
             LightmapData lightmapData = array[i];
             if (lightmapData.lightmapDir != null)
             {
                 flag = true;
             }
             if (lightmapData.shadowMask != null)
             {
                 flag2 = true;
             }
         }
         for (int j = 0; j < lightmaps.Length; j++)
         {
             GUILayout.BeginHorizontal(new GUILayoutOption[0]);
             GUILayout.Space(5f);
             lightmaps[j].lightmapColor = this.LightmapField(lightmaps[j].lightmapColor, j);
             if (flag)
             {
                 GUILayout.Space(10f);
                 lightmaps[j].lightmapDir = this.LightmapField(lightmaps[j].lightmapDir, j);
             }
             if (flag2)
             {
                 GUILayout.Space(10f);
                 lightmaps[j].shadowMask = this.LightmapField(lightmaps[j].shadowMask, j);
             }
             GUILayout.Space(5f);
             LightmapConvergence lightmapConvergence = Lightmapping.GetLightmapConvergence(j);
             GUILayout.BeginVertical(new GUILayoutOption[0]);
             GUILayout.Label("Index: " + j, EditorStyles.miniBoldLabel, new GUILayoutOption[0]);
             if (lightmapConvergence.IsValid())
             {
                 GUILayout.Label("Occupied: " + InternalEditorUtility.CountToString((ulong)((long)lightmapConvergence.occupiedTexelCount)), EditorStyles.miniLabel, new GUILayoutOption[0]);
                 GUIContent content = EditorGUIUtility.TextContent(string.Concat(new object[]
                 {
                     "Direct: ",
                     lightmapConvergence.minDirectSamples,
                     " / ",
                     lightmapConvergence.maxDirectSamples,
                     " / ",
                     lightmapConvergence.avgDirectSamples,
                     "|min / max / avg samples per texel"
                 }));
                 GUILayout.Label(content, EditorStyles.miniLabel, new GUILayoutOption[0]);
                 GUIContent content2 = EditorGUIUtility.TextContent(string.Concat(new object[]
                 {
                     "GI: ",
                     lightmapConvergence.minGISamples,
                     " / ",
                     lightmapConvergence.maxGISamples,
                     " / ",
                     lightmapConvergence.avgGISamples,
                     "|min / max / avg samples per texel"
                 }));
                 GUILayout.Label(content2, EditorStyles.miniLabel, new GUILayoutOption[0]);
             }
             else
             {
                 GUILayout.Label("Occupied: N/A", EditorStyles.miniLabel, new GUILayoutOption[0]);
                 GUILayout.Label("Direct: N/A", EditorStyles.miniLabel, new GUILayoutOption[0]);
                 GUILayout.Label("GI: N/A", EditorStyles.miniLabel, new GUILayoutOption[0]);
             }
             float lightmapBakePerformance = Lightmapping.GetLightmapBakePerformance(j);
             if ((double)lightmapBakePerformance >= 0.0)
             {
                 GUILayout.Label(lightmapBakePerformance.ToString("0.00") + " mrays/sec", EditorStyles.miniLabel, new GUILayoutOption[0]);
             }
             else
             {
                 GUILayout.Label("N/A mrays/sec", EditorStyles.miniLabel, new GUILayoutOption[0]);
             }
             GUILayout.EndVertical();
             GUILayout.FlexibleSpace();
             GUILayout.EndHorizontal();
         }
     }
     GUILayout.EndScrollView();
 }