private void DeveloperBuildEnlightenSettings(SerializedObject so) { if (!Unsupported.IsDeveloperBuild()) { return; } this.m_ShowDevOptions = EditorGUILayout.Foldout(this.m_ShowDevOptions, "Debug [internal]"); if (this.m_ShowDevOptions) { SerializedProperty property = so.FindProperty("m_GISettings.m_BounceScale"); SerializedProperty property2 = so.FindProperty("m_GISettings.m_TemporalCoherenceThreshold"); EditorGUI.indentLevel++; Lightmapping.concurrentJobsType = (Lightmapping.ConcurrentJobsType)EditorGUILayout.IntPopup(LightingWindow.styles.ConcurrentJobs, (int)Lightmapping.concurrentJobsType, this.kConcurrentJobsTypeStrings, this.kConcurrentJobsTypeValues, new GUILayoutOption[0]); Lightmapping.enlightenForceUpdates = EditorGUILayout.Toggle(LightingWindow.styles.ForceUpdates, Lightmapping.enlightenForceUpdates, new GUILayoutOption[0]); Lightmapping.enlightenForceWhiteAlbedo = EditorGUILayout.Toggle(LightingWindow.styles.ForceWhiteAlbedo, Lightmapping.enlightenForceWhiteAlbedo, new GUILayoutOption[0]); Lightmapping.filterMode = (FilterMode)EditorGUILayout.EnumPopup(EditorGUIUtility.TempContent("Filter Mode"), Lightmapping.filterMode, new GUILayoutOption[0]); EditorGUILayout.Slider(property, 0f, 10f, LightingWindow.styles.BounceScale, new GUILayoutOption[0]); EditorGUILayout.Slider(property2, 0f, 1f, LightingWindow.styles.UpdateThreshold, new GUILayoutOption[0]); if (GUILayout.Button("Clear disk cache", new GUILayoutOption[] { GUILayout.Width(this.kButtonWidth) })) { Lightmapping.Clear(); Lightmapping.ClearDiskCache(); } if (GUILayout.Button("Print state to console", new GUILayoutOption[] { GUILayout.Width(this.kButtonWidth) })) { Lightmapping.PrintStateToConsole(); } if (GUILayout.Button("Reset albedo/emissive", new GUILayoutOption[] { GUILayout.Width(this.kButtonWidth) })) { GIDebugVisualisation.ResetRuntimeInputTextures(); } if (GUILayout.Button("Reset environment", new GUILayoutOption[] { GUILayout.Width(this.kButtonWidth) })) { DynamicGI.UpdateEnvironment(); } EditorGUI.indentLevel--; } }
public void DeveloperBuildSettingsGUI() { if (Unsupported.IsDeveloperBuild()) { Lightmapping.concurrentJobsType = (Lightmapping.ConcurrentJobsType)EditorGUILayout.IntPopup(LightingWindowBakeSettings.Styles.ConcurrentJobs, (int)Lightmapping.concurrentJobsType, LightingWindowBakeSettings.Styles.ConcurrentJobsTypeStrings, LightingWindowBakeSettings.Styles.ConcurrentJobsTypeValues, new GUILayoutOption[0]); Lightmapping.enlightenForceUpdates = EditorGUILayout.Toggle(LightingWindowBakeSettings.Styles.ForceUpdates, Lightmapping.enlightenForceUpdates, new GUILayoutOption[0]); Lightmapping.enlightenForceWhiteAlbedo = EditorGUILayout.Toggle(LightingWindowBakeSettings.Styles.ForceWhiteAlbedo, Lightmapping.enlightenForceWhiteAlbedo, new GUILayoutOption[0]); Lightmapping.filterMode = (FilterMode)EditorGUILayout.EnumPopup(EditorGUIUtility.TempContent("Filter Mode"), Lightmapping.filterMode, new GUILayoutOption[0]); EditorGUILayout.Slider(this.m_BounceScale, 0f, 10f, LightingWindowBakeSettings.Styles.BounceScale, new GUILayoutOption[0]); EditorGUILayout.Slider(this.m_UpdateThreshold, 0f, 1f, LightingWindowBakeSettings.Styles.UpdateThreshold, new GUILayoutOption[0]); if (GUILayout.Button("Clear disk cache", new GUILayoutOption[] { GUILayout.Width(150f) })) { Lightmapping.Clear(); Lightmapping.ClearDiskCache(); } if (GUILayout.Button("Print state to console", new GUILayoutOption[] { GUILayout.Width(150f) })) { Lightmapping.PrintStateToConsole(); } if (GUILayout.Button("Reset albedo/emissive", new GUILayoutOption[] { GUILayout.Width(150f) })) { GIDebugVisualisation.ResetRuntimeInputTextures(); } if (GUILayout.Button("Reset environment", new GUILayoutOption[] { GUILayout.Width(150f) })) { DynamicGI.UpdateEnvironment(); } } }
void WorkflowSettingsGUI() { m_ShowWorkflowSettings.value = EditorGUILayout.FoldoutTitlebar(m_ShowWorkflowSettings.value, Styles.workflowSettings, true); if (m_ShowWorkflowSettings.value) { EditorGUI.indentLevel++; // GPU lightmapper device selection. if (Lightmapping.GetLightingSettingsOrDefaultsFallback().lightmapper == LightingSettings.Lightmapper.ProgressiveGPU) { DeviceAndPlatform[] devicesAndPlatforms = Lightmapping.GetLightmappingGpuDevices(); if (devicesAndPlatforms.Length > 0) { int[] lightmappingDeviceIndices = Enumerable.Range(0, devicesAndPlatforms.Length).ToArray(); GUIContent[] lightmappingDeviceStrings = devicesAndPlatforms.Select(x => new GUIContent(x.name)).ToArray(); int bakingDeviceAndPlatform = -1; string configDeviceAndPlatform = EditorUserSettings.GetConfigValue(m_LightmappingDeviceIndex); if (configDeviceAndPlatform != null) { bakingDeviceAndPlatform = Int32.Parse(configDeviceAndPlatform); bakingDeviceAndPlatform = Mathf.Clamp(bakingDeviceAndPlatform, 0, devicesAndPlatforms.Length - 1); // Removing a GPU and rebooting invalidates the saved value. } else { bakingDeviceAndPlatform = Lightmapping.GetLightmapBakeGPUDeviceIndex(); } Debug.Assert(bakingDeviceAndPlatform != -1); EditorGUI.BeginChangeCheck(); using (new EditorGUI.DisabledScope(devicesAndPlatforms.Length < 2)) { bakingDeviceAndPlatform = EditorGUILayout.IntPopup(Styles.progressiveGPUBakingDevice, bakingDeviceAndPlatform, lightmappingDeviceStrings, lightmappingDeviceIndices); } if (EditorGUI.EndChangeCheck()) { if (EditorUtility.DisplayDialog("Warning", Styles.progressiveGPUChangeWarning.text, "OK", "Cancel")) { EditorUserSettings.SetConfigValue(m_LightmappingDeviceIndex, bakingDeviceAndPlatform.ToString()); DeviceAndPlatform selectedDeviceAndPlatform = devicesAndPlatforms[bakingDeviceAndPlatform]; EditorApplication.CloseAndRelaunch(new string[] { "-OpenCL-PlatformAndDeviceIndices", selectedDeviceAndPlatform.platformId.ToString(), selectedDeviceAndPlatform.deviceId.ToString() }); } } } else { // To show when we are still fetching info, so that the UI doesn't pop around too much for no reason using (new EditorGUI.DisabledScope(true)) { EditorGUILayout.IntPopup(Styles.progressiveGPUBakingDevice, 0, Styles.progressiveGPUUnknownDeviceStrings, Styles.progressiveGPUUnknownDeviceValues); } EditorGUILayout.HelpBox(Styles.progressiveGPUUnknownDeviceInfo.text, MessageType.Info); } } m_ShowProbeDebugSettings.value = EditorGUILayout.Foldout(m_ShowProbeDebugSettings.value, Styles.lightProbeVisualization, true); if (m_ShowProbeDebugSettings.value) { EditorGUI.BeginChangeCheck(); EditorGUI.indentLevel++; LightProbeVisualization.lightProbeVisualizationMode = (LightProbeVisualization.LightProbeVisualizationMode)EditorGUILayout.EnumPopup(LightProbeVisualization.lightProbeVisualizationMode); LightProbeVisualization.showInterpolationWeights = EditorGUILayout.Toggle(Styles.displayWeights, LightProbeVisualization.showInterpolationWeights); LightProbeVisualization.showOcclusions = EditorGUILayout.Toggle(Styles.displayOcclusion, LightProbeVisualization.showOcclusions); LightProbeVisualization.highlightInvalidCells = EditorGUILayout.Toggle(Styles.highlightInvalidCells, LightProbeVisualization.highlightInvalidCells); EditorGUI.indentLevel--; if (EditorGUI.EndChangeCheck()) { EditorApplication.SetSceneRepaintDirty(); } } if (Unsupported.IsDeveloperMode()) { Lightmapping.concurrentJobsType = (Lightmapping.ConcurrentJobsType)EditorGUILayout.IntPopup(Styles.concurrentJobs, (int)Lightmapping.concurrentJobsType, Styles.concurrentJobsTypeStrings, Styles.concurrentJobsTypeValues); if (GUILayout.Button("Clear disk cache", GUILayout.Width(Styles.buttonWidth))) { Lightmapping.Clear(); Lightmapping.ClearDiskCache(); } if (GUILayout.Button("Print state to console", GUILayout.Width(Styles.buttonWidth))) { Lightmapping.PrintStateToConsole(); } if (GUILayout.Button("Reset albedo/emissive", GUILayout.Width(Styles.buttonWidth))) { GIDebugVisualisation.ResetRuntimeInputTextures(); } if (GUILayout.Button("Reset environment", GUILayout.Width(Styles.buttonWidth))) { DynamicGI.UpdateEnvironment(); } } EditorGUI.indentLevel--; EditorGUILayout.Space(); } }