@@ -78,13 +78,18 @@ private enum EnabledState
7878
7979 const int maxShowRecent = 5 ;
8080 readonly string textGizmoVisible = L10n . Tr ( "Show/Hide Gizmo" ) ;
81+ GUIContent generalContent = EditorGUIUtility . TrTextContent ( "General" ) ;
8182 GUIContent iconToggleContent = EditorGUIUtility . TrTextContent ( "" , "Show/Hide Icon" ) ;
8283 GUIContent iconSelectContent = EditorGUIUtility . TrTextContent ( "" , "Select Icon" ) ;
8384 GUIContent icon3dGizmoContent = EditorGUIUtility . TrTextContent ( "3D Icons" ) ;
8485 GUIContent terrainDebugWarnings = EditorGUIUtility . TrTextContent ( "Terrain Debug Warnings" ) ;
8586 GUIContent showOutlineContent = EditorGUIUtility . TrTextContent ( "Selection Outline" ) ;
8687 GUIContent showWireframeContent = EditorGUIUtility . TrTextContent ( "Selection Wire" ) ;
8788 GUIContent fadeGizmosContent = EditorGUIUtility . TrTextContent ( "Fade Gizmos" , "Fade out and stop rendering gizmos that are small on screen" ) ;
89+ GUIContent lightProbeVisualizationContent = EditorGUIUtility . TrTextContent ( "Light Probe Visualization" ) ;
90+ GUIContent displayWeightsContent = EditorGUIUtility . TrTextContent ( "Display Weights" ) ;
91+ GUIContent displayOcclusionContent = EditorGUIUtility . TrTextContent ( "Display Occlusion" ) ;
92+ GUIContent highlightInvalidCellsContent = EditorGUIUtility . TrTextContent ( "Highlight Invalid Cells" , "Highlight the invalid cells that cannot be used for probe interpolation." ) ;
8893 private bool m_IsGameView ;
8994
9095 string m_SearchFilter = string . Empty ;
@@ -130,7 +135,18 @@ static public void IconChanged()
130135
131136 float GetTopSectionHeight ( )
132137 {
133- const int numberOfControls = 5 ;
138+ const int numberOfGeneralControls = 6 ;
139+
140+ int numberOfLightProbeVisualizationControls = 0 ;
141+ if ( ! UnityEngine . Rendering . SupportedRenderingFeatures . active . overridesLightProbeSystem )
142+ {
143+ if ( LightProbeVisualization . lightProbeVisualizationMode == LightProbeVisualization . LightProbeVisualizationMode . None )
144+ numberOfLightProbeVisualizationControls = 3 ;
145+ else
146+ numberOfLightProbeVisualizationControls = 5 ;
147+ }
148+
149+ int numberOfControls = numberOfGeneralControls + numberOfLightProbeVisualizationControls ;
134150 return EditorGUI . kSingleLineHeight * numberOfControls + EditorGUI . kControlVerticalSpacing * ( numberOfControls - 1 ) + EditorStyles . inspectorBig . padding . bottom ;
135151 }
136152
@@ -307,8 +323,13 @@ void DrawTopSection(float topSectionHeight)
307323 float labelWidth = m_Styles . listHeaderStyle . CalcSize ( terrainDebugWarnings ) . x + GUI . skin . toggle . CalcSize ( GUIContent . none ) . x + 1 ;
308324 float rowHeight = 18 ;
309325
310- // 3D icons toggle & slider
326+ // General section
311327 Rect toggleRect = new Rect ( margin , curY , labelWidth , rowHeight ) ;
328+ GUI . Label ( toggleRect , generalContent , EditorStyles . boldLabel ) ;
329+ curY += rowHeight ;
330+
331+ // 3D icons toggle & slider
332+ toggleRect = new Rect ( margin , curY , labelWidth , rowHeight ) ;
312333 AnnotationUtility . use3dGizmos = GUI . Toggle ( toggleRect , AnnotationUtility . use3dGizmos , icon3dGizmoContent ) ;
313334 using ( new EditorGUI . DisabledScope ( ! AnnotationUtility . use3dGizmos ) )
314335 {
@@ -347,17 +368,47 @@ void DrawTopSection(float topSectionHeight)
347368 // Selection outline/wire
348369 toggleRect = new Rect ( margin , curY , labelWidth , rowHeight ) ;
349370 AnnotationUtility . showSelectionOutline = GUI . Toggle ( toggleRect , AnnotationUtility . showSelectionOutline , showOutlineContent ) ;
371+ curY += rowHeight ;
350372
351- toggleRect . y += rowHeight ;
373+ toggleRect = new Rect ( margin , curY , labelWidth , rowHeight ) ;
352374 AnnotationUtility . showSelectionWire = GUI . Toggle ( toggleRect , AnnotationUtility . showSelectionWire , showWireframeContent ) ;
375+ curY += rowHeight ;
353376
354377 // TODO: Change to Debug Errors & Debug Warnings
355- toggleRect . y += rowHeight ;
378+ toggleRect = new Rect ( margin , curY , labelWidth , rowHeight ) ;
356379 EditorGUI . BeginChangeCheck ( ) ;
357380 s_ShowTerrainDebugWarnings . value = GUI . Toggle ( toggleRect , s_ShowTerrainDebugWarnings . value , terrainDebugWarnings ) ;
358381 if ( EditorGUI . EndChangeCheck ( ) )
359382 SceneView . RepaintAll ( ) ;
360383 }
384+ curY += rowHeight ;
385+
386+ // Light probe section
387+ if ( ! UnityEngine . Rendering . SupportedRenderingFeatures . active . overridesLightProbeSystem )
388+ {
389+ curY += rowHeight ;
390+ toggleRect = new Rect ( margin , curY , labelWidth , rowHeight ) ;
391+ GUI . Label ( toggleRect , lightProbeVisualizationContent , EditorStyles . boldLabel ) ;
392+ curY += rowHeight ;
393+
394+ toggleRect = new Rect ( margin , curY , position . width - margin * 2 , rowHeight ) ;
395+ LightProbeVisualization . lightProbeVisualizationMode = ( LightProbeVisualization . LightProbeVisualizationMode ) EditorGUI . EnumPopup ( toggleRect , LightProbeVisualization . lightProbeVisualizationMode ) ;
396+ curY += rowHeight ;
397+
398+ if ( LightProbeVisualization . lightProbeVisualizationMode != LightProbeVisualization . LightProbeVisualizationMode . None )
399+ {
400+ toggleRect = new Rect ( margin , curY , labelWidth , rowHeight ) ;
401+ LightProbeVisualization . showInterpolationWeights = GUI . Toggle ( toggleRect , LightProbeVisualization . showInterpolationWeights , displayWeightsContent ) ;
402+ curY += rowHeight ;
403+
404+ toggleRect = new Rect ( margin , curY , labelWidth , rowHeight ) ;
405+ LightProbeVisualization . showOcclusions = GUI . Toggle ( toggleRect , LightProbeVisualization . showOcclusions , displayOcclusionContent ) ;
406+ curY += rowHeight ;
407+
408+ toggleRect = new Rect ( margin , curY , labelWidth , rowHeight ) ;
409+ LightProbeVisualization . highlightInvalidCells = GUI . Toggle ( toggleRect , LightProbeVisualization . highlightInvalidCells , highlightInvalidCellsContent ) ;
410+ }
411+ }
361412 }
362413
363414 // ------------------------------------
0 commit comments