Skip to content

Commit eb76807

Browse files
authored
Merge pull request #8073 from Unity-Technologies/internal/master
Internal/master
2 parents 3dba009 + afa89a7 commit eb76807

File tree

654 files changed

+34884
-9112
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

654 files changed

+34884
-9112
lines changed
4.42 KB
Loading
19.1 KB
Loading
17.2 KB
Loading
10.1 KB
Loading

Packages/com.unity.render-pipelines.core/Documentation~/User-Render-Requests.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,7 @@ public class StandardRenderRequest : MonoBehaviour
8989
}
9090
```
9191

92+
## Other useful information
93+
94+
- On [Universal Render Pipeline (URP)](https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@latest/User-Render-Requests.html).
95+
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Advanced Properties
2+
3+
Unity Render Pipelines components expose standard properties by default that are suitable for most use-cases.
4+
However, there are components and Volume Overrides that include **advanced properties** which you can use to fine-tune the behavior of the component.
5+
6+
There is a global state per user that stores if Unity displays **advanced properties** or not.
7+
8+
## Exposing advanced properties within the inspector
9+
10+
Not every component or Volume Override includes advanced properties.
11+
If one does, it has a contextual menu to the right of each property section header that includes additional properties. To expose advanced properties for that section, open the contextual menu and click **Advanced Properties**.
12+
13+
For an example, see the **Water Surface** component in [High Definition Render Pipeline (HDRP)](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest).
14+
15+
By default only standard properties are shown.
16+
17+
![](Images/Preferences/HDRP_WaterSurface_General.png)
18+
19+
When you select **Advanced Properties**:
20+
21+
![](Images/Preferences/PopUpAdvanced.png)
22+
23+
**Advanced Properties** become visible:
24+
25+
![](Images/Preferences/HDRP_WaterSurface_General_Visible.png)
26+
27+
For Volume Overrides, the already existing contextual menu has a **Advanced Properties** toggle as well.
28+
29+
## Exposing advanced properties on preferences
30+
31+
You can also access to this global preference by:
32+
33+
1. Open the **Graphics** tab in the **Preferences** window (menu: **Edit > Preferences > Graphics**).
34+
2. Under **Properties**. Set **Advanced Properties** to **All Visible**.
35+
36+
![](Images/Preferences/AdvancedProperties_Settings.png)

Packages/com.unity.render-pipelines.core/Editor/AdditionalPropertiesPreferences.cs

Lines changed: 0 additions & 104 deletions
This file was deleted.

Packages/com.unity.render-pipelines.core/Editor/CoreEditorDrawers.cs

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -180,20 +180,12 @@ void IDrawer.Draw(TData data, Editor owner)
180180
if (m_Enabler != null && !m_Enabler(data, owner))
181181
return;
182182

183-
if (m_Anim != null)
184-
CoreEditorUtils.BeginAdditionalPropertiesHighlight(m_Anim);
185-
186-
for (var i = 0; i < m_ActionDrawers.Length; i++)
187-
m_ActionDrawers[i](data, owner);
188-
189-
if (m_Anim != null)
183+
if (AdvancedProperties.BeginGroup(m_Anim))
190184
{
191-
CoreEditorUtils.EndAdditionalPropertiesHighlight();
192-
193-
// While the highlight is being changed, force the Repaint of the editor
194-
if (m_Anim.value > 0.0f)
195-
owner?.Repaint();
185+
for (var i = 0; i < m_ActionDrawers.Length; i++)
186+
m_ActionDrawers[i](data, owner);
196187
}
188+
AdvancedProperties.EndGroup();
197189
}
198190

199191
bool IDrawer.Expand(int mask) => DefaultExpand(m_ActionDrawers, mask);
@@ -888,6 +880,7 @@ public static IDrawer AdditionalPropertiesFoldoutGroup<TEnum, TAPEnum>(GUIConten
888880
where TEnum : struct, IConvertible
889881
where TAPEnum : struct, IConvertible
890882
{
883+
additionalContent ??= Group((s, o) => { });
891884
return AdditionalPropertiesFoldoutGroup(foldoutTitle, foldoutMask, foldoutState, additionalPropertiesMask, additionalPropertiesState, normalContent.Draw, additionalContent.Draw, options, customMenuContextAction, otherDocumentation);
892885
}
893886

@@ -972,7 +965,10 @@ void SwitchEnabler(TData data, Editor owner)
972965

973966
return FoldoutGroup(foldoutTitle, foldoutMask, foldoutState, options, customMenuContextAction, Enabler, SwitchEnabler,
974967
otherDocumentation, normalContent,
975-
ConditionalWithAdditionalProperties((serialized, owner) => additionalPropertiesState[additionalPropertiesMask] && foldoutState[foldoutMask], additionalPropertiesState.GetAnimation(additionalPropertiesMask), additionalContent).Draw
968+
ConditionalWithAdditionalProperties(
969+
(serialized, owner) => additionalPropertiesState[additionalPropertiesMask] && foldoutState[foldoutMask],
970+
AdvancedProperties.s_AnimFloat,
971+
additionalContent).Draw
976972
);
977973
}
978974
}

Packages/com.unity.render-pipelines.core/Editor/CoreEditorUtils.cs

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -822,14 +822,14 @@ static Action<Vector2> CreateMenuContextAction(Action<Vector2> contextAction, Fu
822822
{
823823
if (contextAction == null && (hasMoreOptions != null || customMenuContextAction != null))
824824
{
825-
// If no contextual menu add one for the additional properties.
825+
// If no contextual menu add one for the advanced properties.
826826
contextAction = pos =>
827827
{
828828
var menu = new GenericMenu();
829829
if (customMenuContextAction != null)
830830
customMenuContextAction(menu);
831831
if (hasMoreOptions != null)
832-
AddAdditionalPropertiesContext(menu, hasMoreOptions, toggleMoreOptions);
832+
menu.AddAdvancedPropertiesBoolMenuItem(hasMoreOptions, toggleMoreOptions);
833833
menu.DropDown(new Rect(pos, Vector2.zero));
834834
};
835835
}
@@ -877,12 +877,6 @@ static void ShowHelpButton(Rect contextMenuRect, string documentationURL, GUICon
877877
Help.BrowseURL(documentationURL);
878878
}
879879

880-
static void AddAdditionalPropertiesContext(GenericMenu menu, Func<bool> hasMoreOptions, Action toggleMoreOptions)
881-
{
882-
menu.AddItem(EditorGUIUtility.TrTextContent("Show Additional Properties"), hasMoreOptions.Invoke(), () => toggleMoreOptions.Invoke());
883-
menu.AddItem(EditorGUIUtility.TrTextContent("Show All Additional Properties..."), false, () => CoreRenderPipelinePreferences.Open());
884-
}
885-
886880
/// <summary>
887881
/// Draw a Color Field but convert the color to gamma space before displaying it in the shader.
888882
/// Using SetColor on a material does the conversion, but setting the color as vector3 in a constant buffer doesn't
@@ -1387,19 +1381,6 @@ internal static void TryToFixFilterMode(float pixelsPerPoint, Texture2D icon)
13871381

13881382
#endregion
13891383

1390-
internal static void BeginAdditionalPropertiesHighlight(AnimFloat animation)
1391-
{
1392-
var oldColor = GUI.color;
1393-
GUI.color = Color.Lerp(CoreEditorStyles.backgroundColor * oldColor, CoreEditorStyles.backgroundHighlightColor, animation.value);
1394-
EditorGUILayout.BeginVertical(CoreEditorStyles.additionalPropertiesHighlightStyle);
1395-
GUI.color = oldColor;
1396-
}
1397-
1398-
internal static void EndAdditionalPropertiesHighlight()
1399-
{
1400-
EditorGUILayout.EndVertical();
1401-
}
1402-
14031384
internal static T CreateAssetAt<T>(Scene scene, string targetName) where T : ScriptableObject
14041385
{
14051386
string path;

Packages/com.unity.render-pipelines.core/Editor/CoreRenderPipelinePreferences.cs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Reflection;
4+
using UnityEngine.Rendering;
45

56
namespace UnityEditor.Rendering
67
{
@@ -12,7 +13,7 @@ public static class CoreRenderPipelinePreferences
1213
/// <summary>
1314
/// Path to the Render Pipeline Preferences
1415
/// </summary>
15-
public static readonly string corePreferencePath = "Preferences/Core Render Pipeline";
16+
public static readonly string corePreferencePath = "Preferences/Graphics";
1617

1718
private static readonly List<ICoreRenderPipelinePreferencesProvider> s_Providers = new();
1819

@@ -25,6 +26,14 @@ static void InitPreferenceProviders()
2526
continue;
2627
s_Providers.Add(Activator.CreateInstance(provider) as ICoreRenderPipelinePreferencesProvider);
2728
}
29+
30+
s_Providers.Sort((x, y) => GetDisplayInfoOrder(x.GetType()).CompareTo(GetDisplayInfoOrder(y.GetType())));
31+
}
32+
33+
static int GetDisplayInfoOrder(Type type)
34+
{
35+
var attribute = type.GetCustomAttribute<DisplayInfoAttribute>();
36+
return attribute?.order ?? int.MaxValue;
2837
}
2938

3039
[SettingsProvider]
@@ -38,8 +47,11 @@ static SettingsProvider PreferenceGUI()
3847
{
3948
foreach (var providers in s_Providers)
4049
{
41-
EditorGUILayout.LabelField(providers.header, EditorStyles.boldLabel);
42-
providers.PreferenceGUI();
50+
if (providers.header != null)
51+
{
52+
EditorGUILayout.LabelField(providers.header, EditorStyles.boldLabel);
53+
providers.PreferenceGUI();
54+
}
4355
}
4456
}
4557
}

0 commit comments

Comments
 (0)