Skip to content

Commit 274b2c0

Browse files
authored
Merge pull request #8136 from Unity-Technologies/internal/master
Internal/master
2 parents 2ecb711 + f36c70b commit 274b2c0

File tree

670 files changed

+54714
-10787
lines changed

Some content is hidden

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

670 files changed

+54714
-10787
lines changed

Packages/com.unity.render-pipelines.core/.buginfo

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
rule1:
2-
area: SRP Architecture & API
2+
area: SRP Foundation
33

44
rule2:
55
when:
Loading

Packages/com.unity.render-pipelines.core/Documentation~/Rendering-Debugger.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ If your project uses a custom Scriptable Render Pipeline (SRP), you can add cont
66

77
If your project uses the Universal Render Pipeline (URP) or the High-Definition Render Pipeline (HDRP), refer to the following pages:
88

9-
- [Add controls to the Rendering Debugger in URP](https://docs.unity3d.com/Packages/[email protected]/manual/features/rendering-debugger-add-controls.html)
9+
- [Add controls to the Rendering Debugger in URP](https://docs.unity3d.com/Manual/urp/features/rendering-debugger-add-controls.html)
1010
- [Add controls to the Rendering Debugger in HDRP](https://docs.unity3d.com/Packages/[email protected]/manual/Rendering-Debugger-Add-Controls.html)
1111

1212
## How to access the Rendering Debugger

Packages/com.unity.render-pipelines.core/Documentation~/TableOfContents.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* [What's new](whats-new.md)
33
* [12](whats-new-12.md)
44
* [13](whats-new-13.md)
5+
* [17](whats-new-17.md)
56
* [Creating a custom render pipeline](srp-custom.md)
67
* [Create a custom Scriptable Render Pipeline](srp-custom-getting-started.md)
78
* [Create a Render Pipeline Asset and Render Pipeline Instance in a custom render pipeline](srp-creating-render-pipeline-asset-and-render-pipeline-instance.md)

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The request is processed sequentially in your script, so there's no callback inv
88

99
`RenderPipeline.StandardRequest` renders the following:
1010

11-
* A full stack of cameras in the [Universal Render Pipeline](https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@latest/index.html) (URP).
11+
* A full stack of cameras in the [Universal Render Pipeline](https://docs.unity3d.com/Manual/urp/urp-introduction.html) (URP).
1212
* A single camera in the [High Definition Render Pipeline](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest/index.html) (HDRP).
1313

1414
The following code sample gets the output of the scriptable render pipeline when you select a GUI button. Attach the script to a camera and select **Enter Play Mode**.
@@ -91,4 +91,4 @@ public class StandardRenderRequest : MonoBehaviour
9191

9292
## Other useful information
9393

94-
* On [Universal Render Pipeline (URP)](https://docs.unity3d.com/Packages/[email protected]/manual/User-Render-Requests.html).
94+
* On [Universal Render Pipeline (URP)](https://docs.unity3d.com/Manual/urp/User-Render-Requests.html).

Packages/com.unity.render-pipelines.core/Documentation~/in-loop-render-requests.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Render from cameras nested inside the render loop of other cameras.
44

55
Attach the provided script to a GameObject with a Camera component to nest multiple cameras, that are rendering with [RenderPipeline.SubmitRenderRequest](https://docs.unity3d.com/6000.0/Documentation/ScriptReference/Rendering.RenderPipeline.SubmitRenderRequest.html), inside the render loop of other cameras.
66

7-
**Note**: If your project uses the [Universal Render Pipeline](https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@latest/index.html) (URP), the recommended best practice is to use [UniversalRenderPipeline.SingleCameraRequest](https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@17.0/api/UnityEngine.Rendering.Universal.UniversalRenderPipeline.SingleCameraRequest.html) instead of [StandardRequest](https://docs.unity3d.com/6000.0/Documentation/ScriptReference/Rendering.RenderPipeline.StandardRequest.html), to make sure you only render the camera provided to the `RenderRequest` API instead of the full stack of cameras.
7+
**Note**: If your project uses the [Universal Render Pipeline](https://docs.unity3d.com/Manual/urp/urp-introduction.html) (URP), the recommended best practice is to use [UniversalRenderPipeline.SingleCameraRequest](https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@17.2/api/UnityEngine.Rendering.Universal.UniversalRenderPipeline.SingleCameraRequest.html) instead of [StandardRequest](https://docs.unity3d.com/6000.0/Documentation/ScriptReference/Rendering.RenderPipeline.StandardRequest.html), to make sure you only render the camera provided to the `RenderRequest` API instead of the full stack of cameras.
88

99
## Attach the script to nest
1010

Packages/com.unity.render-pipelines.core/Documentation~/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ SRP Core contains reusable code, including boilerplate code for working with pla
66

77
If you are creating a custom SRP from scratch or customizing a prebuilt SRP, using SRP Core will save you time.
88

9-
For more information on SRP, including a guide to getting started with a custom SRP, see the [SRP documentation](https://docs.unity3d.com/Manual/ScriptableRenderPipeline.html). For more information on Unity's prebuilt SRPs, see the [Universal Render Pipeline (URP) documentation](https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@latest), or the [High Definition Render Pipeline (HDRP) documentation](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest).
9+
For more information on SRP, including a guide to getting started with a custom SRP, see the [SRP documentation](https://docs.unity3d.com/Manual/ScriptableRenderPipeline.html). For more information on Unity's prebuilt SRPs, see the [Universal Render Pipeline (URP) documentation](https://docs.unity3d.com/Manual/urp/urp-introduction.html), or the [High Definition Render Pipeline (HDRP) documentation](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest).

Packages/com.unity.render-pipelines.core/Documentation~/whats-new-17.md

+18-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
1-
# What's new in SRP Core version 17 / Unity 6
1+
# What's new in SRP Core 17.1 / Unity 6.1
2+
The following are the new features and improvements added to the SRP Core package 17.1, embedded Unity 6.1.
23

3-
This page contains an overview of new features, improvements, and issues resolved in version 17 of the Scriptable Render Pipeline (SRP) Core package, embedded in Unity 6.
4+
## Added
5+
### Disable pass merging in the render graph system
6+
Added a render graph debug setting that allows you to temporarily disable pass merging to isolate issues or investigate performance changes.
7+
8+
### New variable rate shading (VRS) API
9+
You can use the new variable rate shading (VRS) API to control the shading rate of Scriptable Renderer Features, and balance between GPU performance and image quality. This API is supported on DirectX 12, Vulkan, and compatible consoles.
10+
11+
VRS is also known as fragment shading rate, and is a technique which allows you to decouple the rasterization and pixel shading rate. VRS can vary the shading rate across the screen space by using a shading rate image, which encodes the shading rates for different regions of the screen at different rates. When setting a lower shading rate, the pixel shader will execute at a lower frequency, which can drastically improve GPU performance.
12+
13+
![A scene with a shading rate image (SRI) in the corner. The blue and red areas represent the different shading rates of the UI and the game visuals.](Images/srp-vrs-example.jpg)
14+
15+
For more information about VRS, refer to the [Optimize Renderer Features with Variable Rate Shading in Unity 6.1](https://discussions.unity.com/t/optimize-renderer-features-with-variable-rate-shading-in-unity-6-1/1605893/1) Unity Discussions page.
16+
17+
## What's new in SRP Core version 17.0 / Unity 6.0
18+
19+
The following is an overview of new features, improvements, and issues resolved in version 17 of the Scriptable Render Pipeline (SRP) Core package, embedded in Unity 6.
420

521
## Improvements
622

Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
rule1:
2-
area: SRP Architecture & API
2+
area: SRP Foundation
33

44
rule2:
55
when:
@@ -10,15 +10,20 @@ rule2:
1010
rule3:
1111
when:
1212
path:
13-
- ^.*Camera.*$
1413
- ^.*ContextualMenuDispatcher.*$
1514
- ^.*CoreRenderPipelinePreferences.*$
1615
- ^.*InspectorCurveEditor.*$
1716
- ^.*RemoveAdditionalDataUtils.*$
18-
area: SRP Workflow
19-
17+
area: SRP Settings
18+
2019
rule4:
2120
when:
2221
path:
2322
- ^.*Upgrader.*$
24-
area: Graphics Tools
23+
area: Graphics Tools
24+
25+
rule5:
26+
when:
27+
path:
28+
- ^.*CameraEditorUtils.*$
29+
area: Camera
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
area: SRP Workflow
1+
area: Camera
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
area: Graphics Tools
1+
area: Graphics Debugging Tools

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

+7-1
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,15 @@ public override void SetValue(object value, DebugUI.IValueField field)
237237
/// <summary>
238238
/// Unsigned Integer Debug State.
239239
/// </summary>
240-
[Serializable, DebugState(typeof(DebugUI.UIntField), typeof(DebugUI.MaskField))]
240+
[Serializable, DebugState(typeof(DebugUI.UIntField))]
241241
public sealed class DebugStateUInt : DebugState<uint> { }
242242

243+
/// <summary>
244+
/// Rendering layer mask state.
245+
/// </summary>
246+
[Serializable, DebugState(typeof(DebugUI.RenderingLayerField))]
247+
public sealed class DebugStateRenderingLayer : DebugState<RenderingLayerMask> { }
248+
243249
/// <summary>
244250
/// Float Debug State.
245251
/// </summary>

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

+5-11
Original file line numberDiff line numberDiff line change
@@ -424,12 +424,11 @@ protected override Enum DoGUI(Rect rect, GUIContent label, DebugUI.BitField fiel
424424
}
425425
}
426426

427-
428427
/// <summary>
429428
/// Builtin Drawer for Maskfield Debug Items.
430429
/// </summary>
431-
[DebugUIDrawer(typeof(DebugUI.MaskField))]
432-
public sealed class DebugUIDrawerMaskField : DebugUIFieldDrawer<uint, DebugUI.MaskField, DebugStateUInt>
430+
[DebugUIDrawer(typeof(DebugUI.RenderingLayerField))]
431+
public sealed class DebugUIDrawerRenderingLayerField : DebugUIFieldDrawer<RenderingLayerMask, DebugUI.RenderingLayerField, DebugStateRenderingLayer>
433432
{
434433
/// <summary>
435434
/// Does the field of the given type
@@ -439,15 +438,10 @@ public sealed class DebugUIDrawerMaskField : DebugUIFieldDrawer<uint, DebugUI.Ma
439438
/// <param name="field">The field</param>
440439
/// <param name="state">The state</param>
441440
/// <returns>The current value from the UI</returns>
442-
protected override uint DoGUI(Rect rect, GUIContent label, DebugUI.MaskField field, DebugStateUInt state)
441+
protected override RenderingLayerMask DoGUI(Rect rect, GUIContent label, DebugUI.RenderingLayerField field, DebugStateRenderingLayer state)
443442
{
444443
uint value = field.GetValue();
445-
446-
var enumNames = new string[field.enumNames.Length];
447-
for (int i = 0; i < enumNames.Length; i++)
448-
enumNames[i] = field.enumNames[i].text;
449-
var mask = EditorGUI.MaskField(rect, label, (int)value, enumNames);
450-
444+
var mask = EditorGUI.MaskField(rect, label, (int)value, field.renderingLayersNames);
451445
return (uint)mask;
452446
}
453447
}
@@ -859,7 +853,7 @@ public override bool OnGUI(DebugUI.Widget widget, DebugState state)
859853

860854
bool isAlternate = r % 2 == 0;
861855

862-
EditorGUI.LabelField(rowRect, GUIContent.none, EditorGUIUtility.TrTextContent(row.displayName),isAlternate ? DebugWindow.Styles.centeredLeft : DebugWindow.Styles.centeredLeftAlternate);
856+
EditorGUI.LabelField(rowRect, GUIContent.none, EditorGUIUtility.TrTextContent(row.displayName), isAlternate ? DebugWindow.Styles.centeredLeft : DebugWindow.Styles.centeredLeftAlternate);
863857
rowRect.xMin -= 2;
864858
rowRect.xMax += 2;
865859

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void OnEnable()
6060
{
6161
var prefab = list.serializedProperty.GetArrayElementAtIndex(list.index).FindPropertyRelative("prefab").objectReferenceValue as GameObject;
6262
if (prefab)
63-
EditorGUIUtility.PingObject(prefab.gameObject);
63+
EditorGUIUtility.PingObject(prefab);
6464
}
6565
};
6666
}

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

+27-14
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void OnEnable()
4343
hideFlags = HideFlags.HideAndDontSave;
4444
}
4545
}
46-
46+
4747
[CoreRPHelpURL("Rendering-Debugger")]
4848
sealed class DebugWindow : EditorWindowWithHelpButton, IHasCustomMenu
4949
{
@@ -271,17 +271,17 @@ DebugState GetOrCreateDebugStateForValueField(DebugUI.Widget widget)
271271
if (widget is not DebugUI.IValueField valueField)
272272
return null;
273273

274-
string guid = widget.queryPath;
275-
if (!m_WidgetStates.TryGetValue(guid, out var state) || state == null)
274+
string queryPath = widget.queryPath;
275+
if (!m_WidgetStates.TryGetValue(queryPath, out var state) || state == null)
276276
{
277277
var widgetType = widget.GetType();
278278
if (s_WidgetStateMap.TryGetValue(widgetType, out Type stateType))
279279
{
280280
Assert.IsNotNull(stateType);
281281
state = (DebugState)CreateInstance(stateType);
282-
state.queryPath = guid;
282+
state.queryPath = queryPath;
283283
state.SetValue(valueField.GetValue(), valueField);
284-
m_WidgetStates[guid] = state;
284+
m_WidgetStates[queryPath] = state;
285285
}
286286
}
287287

@@ -312,15 +312,20 @@ void UpdateWidgetStates(DebugUI.IContainer container)
312312

313313
public void ApplyStates(bool forceApplyAll = false)
314314
{
315+
// If we are in playmode, and the runtime UI is shown, avoid that the editor UI
316+
// applies the data of the internal debug states, as they are not kept in sync
317+
if (Application.isPlaying && DebugManager.instance.displayRuntimeUI)
318+
return;
319+
315320
if (!forceApplyAll && DebugState.m_CurrentDirtyState != null)
316321
{
317322
ApplyState(DebugState.m_CurrentDirtyState.queryPath, DebugState.m_CurrentDirtyState);
318-
DebugState.m_CurrentDirtyState = null;
319-
return;
320323
}
321-
322-
foreach (var state in m_WidgetStates)
323-
ApplyState(state.Key, state.Value);
324+
else
325+
{
326+
foreach (var state in m_WidgetStates)
327+
ApplyState(state.Key, state.Value);
328+
}
324329

325330
DebugState.m_CurrentDirtyState = null;
326331
}
@@ -382,6 +387,8 @@ void Update()
382387
UpdateWidgetStates();
383388
ApplyStates();
384389
m_IsDirty = false;
390+
391+
Repaint();
385392
}
386393
}
387394

@@ -488,22 +495,22 @@ void OnGUI()
488495
using (new EditorGUILayout.VerticalScope())
489496
{
490497
var selectedPanel = panels[m_Settings.selectedPanel];
491-
498+
492499
using (new EditorGUILayout.HorizontalScope())
493500
{
494501
var style = new GUIStyle(CoreEditorStyles.sectionHeaderStyle) { fontStyle = FontStyle.Bold };
495502
EditorGUILayout.LabelField(new GUIContent(selectedPanel.displayName), style);
496-
503+
497504
// Context menu
498505
var rect = GUILayoutUtility.GetLastRect();
499506
var contextMenuRect = new Rect(rect.xMax, rect.y + 4f, 16f, 16f);
500-
507+
501508
CoreEditorUtils.ShowHelpButton(contextMenuRect, selectedPanel.documentationUrl, new GUIContent($"{selectedPanel.displayName} panel."));
502509
}
503510

504511
const float leftMargin = 4f;
505512
GUILayout.Space(leftMargin);
506-
513+
507514
using (var scrollScope = new EditorGUILayout.ScrollViewScope(m_ContentScroll))
508515
{
509516
TraverseContainerGUI(selectedPanel);
@@ -554,6 +561,12 @@ void OnWidgetGUI(DebugUI.Widget widget)
554561
if (widget.isInactiveInEditor || widget.isHidden)
555562
return;
556563

564+
if (widget.queryPath == null)
565+
{
566+
Debug.LogError($"Widget {widget.GetType()} query path is null");
567+
return;
568+
}
569+
557570
GUILayout.Space(4);
558571

559572
if (!s_WidgetDrawerMap.TryGetValue(widget.GetType(), out DebugUIDrawer drawer))

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

+30
Original file line numberDiff line numberDiff line change
@@ -181,4 +181,34 @@ public DefaultVolumeProfileEditor(Editor baseEditor, VolumeProfile profile)
181181
m_TargetSerializedObject = baseEditor.serializedObject;
182182
}
183183
}
184+
185+
186+
187+
/// <summary>
188+
/// Builtin Drawer for Maskfield Debug Items.
189+
/// </summary>
190+
[DebugUIDrawer(typeof(DebugUI.MaskField))]
191+
[Obsolete("DebugUI.MaskField has been deprecated and is not longer supported, please use BitField instead. #from(6000.2)", false)]
192+
public sealed class DebugUIDrawerMaskField : DebugUIFieldDrawer<uint, DebugUI.MaskField, DebugStateUInt>
193+
{
194+
/// <summary>
195+
/// Does the field of the given type
196+
/// </summary>
197+
/// <param name="rect">The rect to draw the field</param>
198+
/// <param name="label">The label for the field</param>
199+
/// <param name="field">The field</param>
200+
/// <param name="state">The state</param>
201+
/// <returns>The current value from the UI</returns>
202+
protected override uint DoGUI(Rect rect, GUIContent label, DebugUI.MaskField field, DebugStateUInt state)
203+
{
204+
uint value = field.GetValue();
205+
206+
var enumNames = new string[field.enumNames.Length];
207+
for (int i = 0; i < enumNames.Length; i++)
208+
enumNames[i] = field.enumNames[i].text;
209+
var mask = EditorGUI.MaskField(rect, label, (int)value, enumNames);
210+
211+
return (uint)mask;
212+
}
213+
}
184214
}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
area: SRP Workflow
1+
area: Graphics Tools

Packages/com.unity.render-pipelines.core/Editor/Gizmo/HierarchicalSphere.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public void DrawHull(bool filled)
128128
if (filled)
129129
{
130130
material.SetPass(0);
131-
Matrix4x4 drawMatrix = Matrix4x4.TRS((Vector3)Handles.matrix.GetColumn(3), Quaternion.identity, Vector3.one * radius * 2f);
131+
Matrix4x4 drawMatrix = Matrix4x4.TRS((Vector3)Handles.matrix.GetColumn(3), Quaternion.identity, 2f * radius * Vector3.one);
132132
Graphics.DrawMeshNow(k_MeshSphere, drawMatrix);
133133
}
134134

Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
area: SRP Workflow
1+
area: SRP Settings
2+
3+
graphic-tools:
4+
when:
5+
path:
6+
- ^.*RenderGraphViewer.*$
7+
area: Graphics Debugging Tools
Loading

0 commit comments

Comments
 (0)