-
Notifications
You must be signed in to change notification settings - Fork 817
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UX pass on APV settings window (#7158)
* rename and UX * Fix mispelling in file name * review * forgot the hdrp asset options * update tests & improve foldouts
- Loading branch information
1 parent
c29748e
commit c60de46
Showing
19 changed files
with
424 additions
and
311 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
...ty.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeReferenceVolumeProfileEditor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
using UnityEngine; | ||
using UnityEngine.Rendering; | ||
|
||
namespace UnityEditor.Rendering | ||
{ | ||
[CanEditMultipleObjects] | ||
[CustomEditor(typeof(ProbeReferenceVolumeProfile))] | ||
internal class ProbeReferenceVolumeProfileEditor : Editor | ||
{ | ||
SerializedProperty m_MinDistanceBetweenProbes; | ||
SerializedProperty m_SimplificationLevels; | ||
SerializedProperty m_MinRendererVolumeSize; | ||
SerializedProperty m_RenderersLayerMask; | ||
ProbeReferenceVolumeProfile profile => target as ProbeReferenceVolumeProfile; | ||
|
||
static class Styles | ||
{ | ||
// TODO: Better tooltip are needed here. | ||
public static readonly GUIContent simplificationLevels = new GUIContent("Simplification levels", "Determine how many bricks are in a streamable unit. Each simplification step adds a brick level above the minimum one."); | ||
public static readonly string simplificationLevelsHighWarning = "High simplification levels have a big memory overhead, they are not recommended except for testing purposes."; | ||
public static readonly GUIContent minDistanceBetweenProbes = new GUIContent("Min Distance Between Probes", "The minimal distance between two probes in meters."); | ||
public static readonly GUIContent indexDimensions = new GUIContent("Index Dimensions", "The dimensions of the index buffer."); | ||
public static readonly GUIContent minRendererVolumeSize = new GUIContent("Min Renderer Volume Size", "Specifies the minimum bounding box volume of renderers to consider placing probes around."); | ||
public static readonly GUIContent renderersLayerMask = new GUIContent("Layer Mask", "Specifies the layer mask for renderers when placing probes."); | ||
public static readonly GUIContent rendererFilterSettings = new GUIContent("Renderers Filter Settings"); | ||
} | ||
|
||
void OnEnable() | ||
{ | ||
m_MinDistanceBetweenProbes = serializedObject.FindProperty(nameof(ProbeReferenceVolumeProfile.minDistanceBetweenProbes)); | ||
m_SimplificationLevels = serializedObject.FindProperty(nameof(ProbeReferenceVolumeProfile.simplificationLevels)); | ||
m_MinRendererVolumeSize = serializedObject.FindProperty(nameof(ProbeReferenceVolumeProfile.minRendererVolumeSize)); | ||
m_RenderersLayerMask = serializedObject.FindProperty(nameof(ProbeReferenceVolumeProfile.renderersLayerMask)); | ||
} | ||
|
||
public override void OnInspectorGUI() | ||
{ | ||
EditorGUI.BeginChangeCheck(); | ||
serializedObject.Update(); | ||
|
||
EditorGUILayout.PropertyField(m_SimplificationLevels, Styles.simplificationLevels); | ||
if (m_SimplificationLevels.intValue == 5) | ||
{ | ||
EditorGUILayout.HelpBox(Styles.simplificationLevelsHighWarning, MessageType.Warning); | ||
} | ||
EditorGUILayout.PropertyField(m_MinDistanceBetweenProbes, Styles.minDistanceBetweenProbes); | ||
EditorGUILayout.HelpBox($"The distance between probes will fluctuate between: {profile.minDistanceBetweenProbes}m and {profile.cellSizeInMeters / 3.0f}m", MessageType.Info); | ||
|
||
EditorGUILayout.Space(); | ||
if (ProbeVolumeBakingWindow.Foldout(Styles.rendererFilterSettings, ProbeVolumeBakingWindow.Expandable.RendererFilterSettings)) | ||
{ | ||
EditorGUI.indentLevel++; | ||
EditorGUILayout.PropertyField(m_RenderersLayerMask, Styles.renderersLayerMask); | ||
EditorGUILayout.PropertyField(m_MinRendererVolumeSize, Styles.minRendererVolumeSize); | ||
EditorGUI.indentLevel--; | ||
} | ||
|
||
if (EditorGUI.EndChangeCheck()) | ||
serializedObject.ApplyModifiedProperties(); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...nder-pipelines.core/Editor/Lighting/ProbeVolume/ProbeReferenceVolumeProfileEditor.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.