Skip to content

Commit ddab622

Browse files
authored
Merge pull request #8149 from Unity-Technologies/internal/master
Internal/master
2 parents 83bc343 + 4084c58 commit ddab622

560 files changed

Lines changed: 67133 additions & 4440 deletions

File tree

Some content is hidden

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

.gitattributes

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ Repositories.ini eol=lf
6464
*.[mM][sS][iI] filter=lfs diff=lfs merge=lfs -text
6565
*.[aA][rR][cC] filter=lfs diff=lfs merge=lfs -text
6666

67+
# media files
68+
*.[mM][pP]4 filter=lfs diff=lfs merge=lfs -text
69+
*.[mM][oO][vV] filter=lfs diff=lfs merge=lfs -text
70+
*.[wW][eE][bB][mM] filter=lfs diff=lfs merge=lfs -text
71+
6772
# executables and libraries
6873
*.[aA] filter=lfs diff=lfs merge=lfs -text
6974
*.[oO] filter=lfs diff=lfs merge=lfs -text
@@ -361,6 +366,12 @@ Editor/Resources/unity[[:space:]]editor[[:space:]]resources filter=lfs diff=lfs
361366
**/GfxTestProjectFolder/**/*.[pP][rR][xX] filter=lfs diff=lfs merge=lfs -text
362367
**/GfxTestProjectFolder/**/*.[dD][fF][oO][nN][tT] filter=lfs diff=lfs merge=lfs -text
363368

369+
# Video tests
370+
# ---
371+
# `.ts` is used for MPEG Transport Stream files. This rule is very specific to a certain video
372+
# package because the `.ts` extension clashes with the TypeScript file extension.
373+
**/EditModeAndPlayModeTests/Video/**/HLS/**/*.[tT][sS] filter=lfs diff=lfs merge=lfs -text
374+
364375
# memoryprofiler test snapshots
365376
**/com.unity.memoryprofiler.tests/**/*.[sS][nN][aA][pP] filter=lfs diff=lfs merge=lfs -text
366377

Packages/com.unity.render-pipelines.core/Documentation~/customize-ui-for-a-setting.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,16 @@ public class MySettingsPropertyDrawer : PropertyDrawer
5555

5656
To add items to the **More** (⋮) menu of a settings group, follow these steps:
5757

58-
1. Create a class that implements the [`IRenderPipelineGraphicsSettingsContextMenu`](https://docs.unity3d.com/6000.1/Documentation/ScriptReference/Rendering.IRenderPipelineGraphicsSettingsContextMenu.html) interface.
58+
1. Create a class that implements the [`IRenderPipelineGraphicsSettingsContextMenu2<T>`](https://docs.unity3d.com/6000.1/Documentation/ScriptReference/Rendering.IRenderPipelineGraphicsSettingsContextMenu2_1.html) interface.
5959
2. Implement the `PopulateContextMenu` method.
6060
3. To add an item, use the `AddItem` API.
6161

6262
For example:
6363

6464
```c#
65-
public class MySettingsContextMenu : IRenderPipelineGraphicsSettingsContextMenu<MySettings>
65+
public class MySettingsContextMenu : IRenderPipelineGraphicsSettingsContextMenu2<MySettings>
6666
{
67-
void IRenderPipelineGraphicsSettingsContextMenu<MySettings>.PopulateContextMenu(MySettings setting, PropertyDrawer _, ref GenericMenu menu)
67+
void IRenderPipelineGraphicsSettingsContextMenu2<MySettings>.PopulateContextMenu(MySettings setting, SerializedProperty _, ref GenericMenu menu)
6868
{
6969
menu.AddItem(new GUIContent("My custom menu item"), false, () => { Debug.Log("Menu item was selected."); });
7070
}
@@ -74,4 +74,5 @@ public class MySettingsContextMenu : IRenderPipelineGraphicsSettingsContextMenu<
7474
## Additional resources
7575

7676
- [PropertyDrawer](xref:UnityEditor.PropertyDrawer)
77-
- [IRenderPipelineGraphicsSettingsContextMenu](https://docs.unity3d.com/6000.1/Documentation/ScriptReference/Rendering.IRenderPipelineGraphicsSettingsContextMenu.html)
77+
- [IRenderPipelineGraphicsSettingsContextMenu2](https://docs.unity3d.com/6000.2/Documentation/ScriptReference/Rendering.IRenderPipelineGraphicsSettingsContextMenu2.html)
78+
- [IRenderPipelineGraphicsSettingsContextMenu2<T>](https://docs.unity3d.com/6000.2/Documentation/ScriptReference/Rendering.IRenderPipelineGraphicsSettingsContextMenu2_1.html)

Packages/com.unity.render-pipelines.core/Documentation~/srp-creating-render-pipeline-asset-and-render-pipeline-instance.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,14 @@ The following example shows how to create a script for a basic custom Render Pip
4545
```lang-csharp
4646
using UnityEngine;
4747
using UnityEngine.Rendering;
48+
using System.Collections.Generic;
4849
4950
public class ExampleRenderPipelineInstance : RenderPipeline
5051
{
5152
public ExampleRenderPipelineInstance() {
5253
}
5354
54-
protected override void Render (ScriptableRenderContext context, Camera[] cameras) {
55+
protected override void Render (ScriptableRenderContext context, List<Camera> cameras) {
5556
// This is where you can write custom rendering code. Customize this method to customize your SRP.
5657
}
5758
}
@@ -98,6 +99,7 @@ The following example shows how to create a `RenderPipelineAsset` script that de
9899
```lang-csharp
99100
using UnityEngine;
100101
using UnityEngine.Rendering;
102+
using System.Collections.Generic;
101103
102104
public class ExampleRenderPipelineInstance : RenderPipeline
103105
{
@@ -119,4 +121,4 @@ The following example shows how to create a `RenderPipelineAsset` script that de
119121
120122
```
121123
122-
5. In the Project view, either click the add (+) button, or open the context menu and navigate to **Create**, and then choose **Rendering** > **Example Render Pipeline Asset**. Unity creates a new Render Pipeline Asset in the Project view.
124+
5. In the Project view, either click the add (+) button, or open the context menu and navigate to **Create**, and then choose **Rendering** > **Example Render Pipeline Asset**. Unity creates a new Render Pipeline Asset in the Project view.

Packages/com.unity.render-pipelines.core/Documentation~/srp-creating-simple-render-loop.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,13 @@ It shows the clearest workflow, rather than the most efficient runtime performan
131131
132132
using UnityEngine;
133133
using UnityEngine.Rendering;
134+
using System.Collections.Generic;
134135
135136
public class ExampleRenderPipeline : RenderPipeline {
136137
public ExampleRenderPipeline() {
137138
}
138139
139-
protected override void Render (ScriptableRenderContext context, Camera[] cameras) {
140+
protected override void Render(ScriptableRenderContext context, List<Camera> cameras) {
140141
// Create and schedule a command to clear the current render target
141142
var cmd = new CommandBuffer();
142143
cmd.ClearRenderTarget(true, true, Color.black);
@@ -172,12 +173,13 @@ It shows the clearest workflow, rather than the most efficient runtime performan
172173
173174
using UnityEngine;
174175
using UnityEngine.Rendering;
176+
using System.Collections.Generic;
175177
176178
public class ExampleRenderPipeline : RenderPipeline {
177179
public ExampleRenderPipeline() {
178180
}
179181
180-
protected override void Render (ScriptableRenderContext context, Camera[] cameras) {
182+
protected override void Render(ScriptableRenderContext context, List<Camera> cameras) {
181183
// Create and schedule a command to clear the current render target
182184
var cmd = new CommandBuffer();
183185
cmd.ClearRenderTarget(true, true, Color.black);
@@ -225,12 +227,13 @@ It shows the clearest workflow, rather than the most efficient runtime performan
225227
226228
using UnityEngine;
227229
using UnityEngine.Rendering;
230+
using System.Collections.Generic;
228231
229232
public class ExampleRenderPipeline : RenderPipeline {
230233
public ExampleRenderPipeline() {
231234
}
232235
233-
protected override void Render (ScriptableRenderContext context, Camera[] cameras) {
236+
protected override void Render(ScriptableRenderContext context, List<Camera> cameras) {
234237
// Create and schedule a command to clear the current render target
235238
var cmd = new CommandBuffer();
236239
cmd.ClearRenderTarget(true, true, Color.black);

Packages/com.unity.render-pipelines.core/Documentation~/srp-using-scriptable-render-context.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@ This example code demonstrates how to schedule and perform a command to clear th
2626
```lang-csharp
2727
using UnityEngine;
2828
using UnityEngine.Rendering;
29+
using System.Collections.Generic;
2930
3031
public class ExampleRenderPipeline : RenderPipeline
3132
{
32-
public ExampleRenderPipeline() {
33-
}
33+
public ExampleRenderPipeline() {
34+
}
3435
3536
protected override void Render(ScriptableRenderContext context, List<Camera> cameras) {
3637
// Create and schedule a command to clear the current render target

Packages/com.unity.render-pipelines.core/Editor/Debugging/DebugUIDrawer.Builtins.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,14 +477,16 @@ static void DisplayColumns(Rect drawRect, List<GUIContent> rowContents)
477477
/// <param name="state">Debug State associated with the Debug Item.</param>
478478
public override void Begin(DebugUI.Widget widget, DebugState state)
479479
{
480+
CoreEditorUtils.DrawSplitter();
481+
480482
var w = Cast<DebugUI.Foldout>(widget);
481483
var s = Cast<DebugStateBool>(state);
482484

483485
var title = EditorGUIUtility.TrTextContent(w.displayName, w.tooltip);
484486

485487
Action<GenericMenu> fillContextMenuAction = null;
486488

487-
if (w.contextMenuItems != null)
489+
if (w.contextMenuItems is { Count: > 0 })
488490
{
489491
fillContextMenuAction = menu =>
490492
{
@@ -495,7 +497,7 @@ public override void Begin(DebugUI.Widget widget, DebugState state)
495497
};
496498
}
497499

498-
bool previousValue = (bool)w.GetValue();
500+
bool previousValue = w.GetValue();
499501
bool value = CoreEditorUtils.DrawHeaderFoldout(title, previousValue, isTitleHeader: w.isHeader, customMenuContextAction: fillContextMenuAction, documentationURL: w.documentationUrl);
500502
if (previousValue != value)
501503
Apply(w, s, value);

Packages/com.unity.render-pipelines.core/Editor/Debugging/DebugWindow.cs

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ static void Init()
132132
{
133133
var window = GetWindow<DebugWindow>();
134134
window.titleContent = Styles.windowTitle;
135+
window.minSize = new Vector2(800f, 300f);
135136
}
136137

137138
[MenuItem("Window/Analysis/Rendering Debugger", validate = true)]
@@ -409,16 +410,6 @@ void OnGUI()
409410
return;
410411
}
411412

412-
// Background color
413-
var wrect = position;
414-
wrect.x = 0;
415-
wrect.y = 0;
416-
var oldColor = GUI.color;
417-
GUI.color = s_Styles.skinBackgroundColor;
418-
GUI.DrawTexture(wrect, EditorGUIUtility.whiteTexture);
419-
GUI.color = oldColor;
420-
421-
422413
GUILayout.BeginHorizontal(EditorStyles.toolbar);
423414
GUILayout.FlexibleSpace();
424415
if (GUILayout.Button(Styles.resetButtonContent, EditorStyles.toolbarButton))
@@ -513,8 +504,14 @@ void OnGUI()
513504

514505
using (var scrollScope = new EditorGUILayout.ScrollViewScope(m_ContentScroll))
515506
{
507+
const float scrollViewTopMargin = 4f;
508+
GUILayout.Space(scrollViewTopMargin);
509+
516510
TraverseContainerGUI(selectedPanel);
517511
m_ContentScroll = scrollScope.scrollPosition;
512+
513+
const float scrollViewBottomMargin = 10f;
514+
GUILayout.Space(scrollViewBottomMargin);
518515
}
519516
}
520517

@@ -567,8 +564,6 @@ void OnWidgetGUI(DebugUI.Widget widget)
567564
return;
568565
}
569566

570-
GUILayout.Space(4);
571-
572567
if (!s_WidgetDrawerMap.TryGetValue(widget.GetType(), out DebugUIDrawer drawer))
573568
{
574569
foreach (var pair in s_WidgetDrawerMap)
@@ -635,8 +630,6 @@ public class Styles
635630
public readonly GUIStyle sectionScrollView = "PreferencesSectionBox";
636631
public readonly GUIStyle sectionElement = new GUIStyle("PreferencesSection");
637632
public readonly GUIStyle selected = "OL SelectedRow";
638-
public readonly GUIStyle sectionHeader = new GUIStyle(EditorStyles.largeLabel);
639-
public readonly Color skinBackgroundColor;
640633

641634
public static GUIStyle centeredLeft = new GUIStyle(EditorStyles.label) { alignment = TextAnchor.MiddleLeft };
642635
public static GUIStyle centeredLeftAlternate = new GUIStyle(EditorStyles.label) { alignment = TextAnchor.MiddleLeft };
@@ -646,35 +639,23 @@ public class Styles
646639

647640
public Styles()
648641
{
649-
Color textColorDarkSkin = new Color32(210, 210, 210, 255);
650-
Color textColorLightSkin = new Color32(102, 102, 102, 255);
651-
Color backgroundColorDarkSkin = new Color32(38, 38, 38, 128);
652-
Color backgroundColorLightSkin = new Color32(128, 128, 128, 96);
653-
654642
centeredLeftAlternate.normal.background = CoreEditorUtils.CreateColoredTexture2D(
655643
EditorGUIUtility.isProSkin
656644
? new Color(63 / 255.0f, 63 / 255.0f, 63 / 255.0f, 255 / 255.0f)
657-
: new Color(202 / 255.0f, 202 / 255.0f, 202 / 255.0f, 255 / 255.0f),
645+
: new Color(211 / 255.0f, 211 / 255.0f, 211 / 255.0f, 211 / 255.0f),
658646
"centeredLeftAlternate Background");
659647

660648
sectionScrollView = new GUIStyle(sectionScrollView);
661649
sectionScrollView.overflow.bottom += 1;
662650

663651
sectionElement.alignment = TextAnchor.MiddleLeft;
664652

665-
sectionHeader.fontStyle = FontStyle.Bold;
666-
sectionHeader.fontSize = 18;
667-
sectionHeader.margin.top = 10;
668-
sectionHeader.margin.left += 1;
669-
sectionHeader.normal.textColor = EditorGUIUtility.isProSkin ? textColorDarkSkin : textColorLightSkin;
670-
skinBackgroundColor = EditorGUIUtility.isProSkin ? backgroundColorDarkSkin : backgroundColorLightSkin;
671-
672653
labelWithZeroValueStyle.normal.textColor = Color.gray;
673654

674655
// Make sure that textures are unloaded on domain reloads.
675656
void OnBeforeAssemblyReload()
676657
{
677-
UnityEngine.Object.DestroyImmediate(centeredLeftAlternate.normal.background);
658+
DestroyImmediate(centeredLeftAlternate.normal.background);
678659
AssemblyReloadEvents.beforeAssemblyReload -= OnBeforeAssemblyReload;
679660
}
680661

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Generic;
33
using UnityEngine;
44
using UnityEngine.Rendering;
5+
using UnityEngine.UIElements;
56

67
namespace UnityEditor.Rendering
78
{
@@ -182,7 +183,28 @@ public DefaultVolumeProfileEditor(Editor baseEditor, VolumeProfile profile)
182183
}
183184
}
184185

186+
public abstract partial class DefaultVolumeProfileSettingsPropertyDrawer
187+
{
188+
/// <summary>
189+
/// Context menu implementation for Default Volume Profile.
190+
/// </summary>
191+
/// <typeparam name="TSetting">Default Volume Profile Settings type</typeparam>
192+
/// <typeparam name="TRenderPipeline">Render Pipeline type</typeparam>
193+
[Obsolete("Use DefaultVolumeProfileSettingsPropertyDrawer<T>.DefaultVolumeProfileSettingsContextMenu2<TSetting, TRenderPipeline> instead #from(6000.0)")]
194+
public abstract class DefaultVolumeProfileSettingsContextMenu<TSetting, TRenderPipeline> : IRenderPipelineGraphicsSettingsContextMenu<TSetting>
195+
where TSetting : class, IDefaultVolumeProfileSettings
196+
where TRenderPipeline : RenderPipeline
197+
{
198+
/// <summary>
199+
/// Path where new Default Volume Profile will be created.
200+
/// </summary>
201+
[Obsolete("Not used anymore. #from(6000.0)")]
202+
protected abstract string defaultVolumeProfilePath { get; }
185203

204+
[Obsolete("Not used anymore. #from(6000.0)")]
205+
void IRenderPipelineGraphicsSettingsContextMenu<TSetting>.PopulateContextMenu(TSetting setting, PropertyDrawer property, ref GenericMenu menu){ }
206+
}
207+
}
186208

187209
/// <summary>
188210
/// Builtin Drawer for Maskfield Debug Items.

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,6 @@ void OnDisable()
232232
s_FilterWindow = null;
233233
}
234234

235-
void OnLostFocus() => Close();
236-
237235
internal static bool ValidateAddComponentMenuItem()
238236
{
239237
return true;

Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.cs

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -945,8 +945,11 @@ internal static bool PrepareBaking()
945945

946946
static bool InitializeBake()
947947
{
948-
if (ProbeVolumeLightingTab.instance?.PrepareAPVBake() == false) return false;
949-
if (!ProbeReferenceVolume.instance.isInitialized || !ProbeReferenceVolume.instance.enabledBySRP) return false;
948+
if (ProbeVolumeLightingTab.instance?.PrepareAPVBake(ProbeReferenceVolume.instance) == false)
949+
return false;
950+
951+
if (!ProbeReferenceVolume.instance.isInitialized || !ProbeReferenceVolume.instance.enabledBySRP)
952+
return false;
950953

951954
using var scope = new BakingSetupProfiling(BakingSetupProfiling.Stages.PrepareWorldSubdivision);
952955

@@ -961,13 +964,16 @@ static bool InitializeBake()
961964
}
962965
}
963966

964-
if (ProbeReferenceVolume.instance.perSceneDataList.Count == 0) return false;
967+
if (ProbeReferenceVolume.instance.perSceneDataList.Count == 0)
968+
return false;
965969

966970
var sceneDataList = GetPerSceneDataList();
967-
if (sceneDataList.Count == 0) return false;
971+
if (sceneDataList.Count == 0)
972+
return false;
968973

969974
var pvList = GetProbeVolumeList();
970-
if (pvList.Count == 0) return false; // We have no probe volumes.
975+
if (pvList.Count == 0)
976+
return false; // We have no probe volumes.
971977

972978
CachePVHashes(pvList);
973979

@@ -1491,11 +1497,14 @@ static void ApplyPostBakeOperations()
14911497
if (m_BakingSet.hasDilation)
14921498
{
14931499
// This subsequent block needs to happen AFTER we call WriteBakingCells.
1494-
// Otherwise in cases where we change the spacing between probes, we end up loading cells with a certain layout in ForceSHBand
1500+
// Otherwise, in cases where we change the spacing between probes, we end up loading cells with a certain layout in ForceSHBand
14951501
// And then we unload cells using the wrong layout in PerformDilation (after WriteBakingCells updates the baking set object) which leads to a broken internal state.
14961502

14971503
// Don't use Disk streaming to avoid having to wait for it when doing dilation.
14981504
probeRefVolume.ForceNoDiskStreaming(true);
1505+
// Increase the memory budget to make sure we can fit the current cell and all its neighbors when doing dilation.
1506+
var prevMemoryBudget = probeRefVolume.memoryBudget;
1507+
probeRefVolume.ForceMemoryBudget(ProbeVolumeTextureMemoryBudget.MemoryBudgetHigh);
14991508
// Force maximum sh bands to perform baking, we need to store what sh bands was selected from the settings as we need to restore it after.
15001509
var prevSHBands = probeRefVolume.shBands;
15011510
probeRefVolume.ForceSHBand(ProbeVolumeSHBands.SphericalHarmonicsL2);
@@ -1506,8 +1515,9 @@ static void ApplyPostBakeOperations()
15061515
using (new BakingCompleteProfiling(BakingCompleteProfiling.Stages.PerformDilation))
15071516
PerformDilation();
15081517

1509-
// Need to restore the original state
1518+
// Restore the original state.
15101519
probeRefVolume.ForceNoDiskStreaming(false);
1520+
probeRefVolume.ForceMemoryBudget(prevMemoryBudget);
15111521
probeRefVolume.ForceSHBand(prevSHBands);
15121522
}
15131523
else

0 commit comments

Comments
 (0)