Skip to content

Commit 287a2eb

Browse files
Merge pull request #8174 from Unity-Technologies/internal/6000.0/staging
Internal/6000.0/staging
2 parents 7023b74 + f1c397b commit 287a2eb

35 files changed

Lines changed: 430 additions & 138 deletions

File tree

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/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
{
@@ -159,7 +160,28 @@ public DefaultVolumeProfileEditor(Editor baseEditor, VolumeProfile profile)
159160
}
160161
}
161162

163+
public abstract partial class DefaultVolumeProfileSettingsPropertyDrawer
164+
{
165+
/// <summary>
166+
/// Context menu implementation for Default Volume Profile.
167+
/// </summary>
168+
/// <typeparam name="TSetting">Default Volume Profile Settings type</typeparam>
169+
/// <typeparam name="TRenderPipeline">Render Pipeline type</typeparam>
170+
[Obsolete("Use DefaultVolumeProfileSettingsPropertyDrawer<T>.DefaultVolumeProfileSettingsContextMenu2<TSetting, TRenderPipeline> instead #from(6000.0)")]
171+
public abstract class DefaultVolumeProfileSettingsContextMenu<TSetting, TRenderPipeline> : IRenderPipelineGraphicsSettingsContextMenu<TSetting>
172+
where TSetting : class, IDefaultVolumeProfileSettings
173+
where TRenderPipeline : RenderPipeline
174+
{
175+
/// <summary>
176+
/// Path where new Default Volume Profile will be created.
177+
/// </summary>
178+
[Obsolete("Not used anymore. #from(6000.0)")]
179+
protected abstract string defaultVolumeProfilePath { get; }
162180

181+
[Obsolete("Not used anymore. #from(6000.0)")]
182+
void IRenderPipelineGraphicsSettingsContextMenu<TSetting>.PopulateContextMenu(TSetting setting, PropertyDrawer property, ref GenericMenu menu){ }
183+
}
184+
}
163185

164186
/// <summary>
165187
/// Builtin Drawer for Maskfield Debug Items.

Packages/com.unity.render-pipelines.core/Editor/Settings/PropertyDrawers/DefaultVolumeProfileSettingsPropertyDrawer.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace UnityEditor.Rendering
88
/// <summary>
99
/// Base implementation for drawing Default Volume Profile UI in Graphics Settings.
1010
/// </summary>
11-
public abstract class DefaultVolumeProfileSettingsPropertyDrawer : PropertyDrawer
11+
public abstract partial class DefaultVolumeProfileSettingsPropertyDrawer : PropertyDrawer
1212
{
1313
// UUM-77758: Due to how PropertyDrawers are created and cached, there is no way to retrieve them reliably
1414
// later. We know that only one DefaultVolumeProfile exists at any given time, so we can access it through
@@ -118,7 +118,7 @@ protected void DestroyDefaultVolumeProfileEditor()
118118
/// </summary>
119119
/// <typeparam name="TSetting">Default Volume Profile Settings type</typeparam>
120120
/// <typeparam name="TRenderPipeline">Render Pipeline type</typeparam>
121-
public abstract class DefaultVolumeProfileSettingsContextMenu<TSetting, TRenderPipeline> : IRenderPipelineGraphicsSettingsContextMenu<TSetting>
121+
public abstract class DefaultVolumeProfileSettingsContextMenu2<TSetting, TRenderPipeline> : IRenderPipelineGraphicsSettingsContextMenu2<TSetting>
122122
where TSetting : class, IDefaultVolumeProfileSettings
123123
where TRenderPipeline : RenderPipeline
124124
{
@@ -127,7 +127,7 @@ public abstract class DefaultVolumeProfileSettingsContextMenu<TSetting, TRenderP
127127
/// </summary>
128128
protected abstract string defaultVolumeProfilePath { get; }
129129

130-
void IRenderPipelineGraphicsSettingsContextMenu<TSetting>.PopulateContextMenu(TSetting setting, PropertyDrawer _, ref GenericMenu menu)
130+
void IRenderPipelineGraphicsSettingsContextMenu2<TSetting>.PopulateContextMenu(TSetting setting, SerializedProperty _, ref GenericMenu menu)
131131
{
132132
bool canCreateNewAsset = RenderPipelineManager.currentPipeline is TRenderPipeline;
133133
VolumeProfileUtils.AddVolumeProfileContextMenuItems(ref menu,

Packages/com.unity.render-pipelines.core/Runtime/Volume/VolumeManager.cs

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,23 @@ public sealed partial class VolumeManager
116116
.OrderBy(i => i.Item1)
117117
.ToList();
118118
}
119+
120+
Type[] m_BaseComponentTypeArray;
119121

120122
/// <summary>
121123
/// The current list of all available types that derive from <see cref="VolumeComponent"/>.
122124
/// </summary>
123-
public Type[] baseComponentTypeArray { get; internal set; } // internal only for tests
125+
public Type[] baseComponentTypeArray
126+
{
127+
get
128+
{
129+
if (isInitialized)
130+
return m_BaseComponentTypeArray;
131+
132+
throw new InvalidOperationException($"{nameof(VolumeManager)}.{nameof(instance)}.{nameof(baseComponentTypeArray)} cannot be called before the {nameof(VolumeManager)} is initialized. (See {nameof(VolumeManager)}.{nameof(instance)}.{nameof(isInitialized)} and {nameof(RenderPipelineManager)} for creation callback).");
133+
}
134+
internal set => m_BaseComponentTypeArray = value; // internal only for tests
135+
}
124136

125137
/// <summary>
126138
/// Global default profile that provides default values for volume components. VolumeManager applies
@@ -221,13 +233,19 @@ public void Initialize(VolumeProfile globalDefaultVolumeProfile = null, VolumePr
221233
Debug.Assert(m_CreatedVolumeStacks.Count == 0);
222234

223235
LoadBaseTypes(GraphicsSettings.currentRenderPipelineAssetType);
236+
InitializeInternal(globalDefaultVolumeProfile, qualityDefaultVolumeProfile);
237+
}
238+
239+
//This is called by test where the basetypes are tuned for the purpose of the test.
240+
internal void InitializeInternal(VolumeProfile globalDefaultVolumeProfile = null, VolumeProfile qualityDefaultVolumeProfile = null)
241+
{
224242
InitializeVolumeComponents();
225243

226244
globalDefaultProfile = globalDefaultVolumeProfile;
227245
qualityDefaultProfile = qualityDefaultVolumeProfile;
228246
EvaluateVolumeDefaultState();
229247

230-
m_DefaultStack = CreateStack();
248+
m_DefaultStack = CreateStackInternal();
231249
stack = m_DefaultStack;
232250

233251
isInitialized = true;
@@ -326,9 +344,17 @@ public void OnVolumeComponentChanged(VolumeComponent component)
326344
/// <seealso cref="VolumeStack"/>
327345
/// <seealso cref="Update(VolumeStack,Transform,LayerMask)"/>
328346
public VolumeStack CreateStack()
347+
{
348+
if (!isInitialized)
349+
throw new InvalidOperationException($"{nameof(VolumeManager)}.{nameof(instance)}.{nameof(CreateStack)}() cannot be called before the {nameof(VolumeManager)} is initialized. (See {nameof(VolumeManager)}.{nameof(instance)}.{nameof(isInitialized)} and {nameof(RenderPipelineManager)} for creation callback).");
350+
351+
return CreateStackInternal();
352+
}
353+
354+
VolumeStack CreateStackInternal()
329355
{
330356
var stack = new VolumeStack();
331-
stack.Reload(baseComponentTypeArray);
357+
stack.Reload(m_BaseComponentTypeArray);
332358
m_CreatedVolumeStacks.Add(stack);
333359
return stack;
334360
}
@@ -400,15 +426,18 @@ internal void LoadBaseTypes(Type pipelineAssetType)
400426
list.Add(t);
401427
}
402428

403-
baseComponentTypeArray = list.ToArray();
429+
m_BaseComponentTypeArray = list.ToArray();
404430
}
405431
}
406432

407433
internal void InitializeVolumeComponents()
408434
{
435+
if (m_BaseComponentTypeArray == null || m_BaseComponentTypeArray.Length == 0)
436+
return;
437+
409438
// Call custom static Init method if present
410439
var flags = BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;
411-
foreach (var type in baseComponentTypeArray)
440+
foreach (var type in m_BaseComponentTypeArray)
412441
{
413442
var initMethod = type.GetMethod("Init", flags);
414443
if (initMethod != null)
@@ -419,9 +448,9 @@ internal void InitializeVolumeComponents()
419448
}
420449

421450
// Evaluate static default values for VolumeComponents, which is the baseline to reset the values to at the start of Update.
422-
internal void EvaluateVolumeDefaultState()
451+
void EvaluateVolumeDefaultState()
423452
{
424-
if (baseComponentTypeArray == null || baseComponentTypeArray.Length == 0)
453+
if (m_BaseComponentTypeArray == null || m_BaseComponentTypeArray.Length == 0)
425454
return;
426455

427456
using var profilerScope = k_ProfilerMarkerEvaluateVolumeDefaultState.Auto();
@@ -432,7 +461,7 @@ internal void EvaluateVolumeDefaultState()
432461

433462
// First, default-construct all VolumeComponents
434463
List<VolumeComponent> componentsDefaultStateList = new();
435-
foreach (var type in baseComponentTypeArray)
464+
foreach (var type in m_BaseComponentTypeArray)
436465
{
437466
componentsDefaultStateList.Add((VolumeComponent) ScriptableObject.CreateInstance(type));
438467
}

Packages/com.unity.render-pipelines.high-definition/Documentation~/Override-Contact-Shadows.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ Enable the following properties:
3030

3131
You can enable Contact Shadows on a per Light basis for Directional, Point, and Spot Lights. Tick the **Enable** checkbox under the **Contact Shadows** drop-down in the **Shadows** section of each Light to indicate that HDRP should calculate Contact Shadows for that Light.
3232

33+
If you use both contact shadows and [realtime shadows](realtime-shadows.md), there might be a visible seam between the two types of shadow. To avoid this issue, set shadow maps to use a high resolution. For more information, refer to [Control shadow resolution and quality](Shadows-in-HDRP.md).
34+
3335
**Note**: A Light casts Contact Shadows for every Mesh Renderer that uses a Material that writes to the depth buffer. This is regardless of whether you enable or disable the **Cast Shadows** property on the Mesh Renderer. This means that you can disable **Cast Shadows** on small GameObjects/props and still have them cast Contact Shadows. This is good if you do not want HDRP to render these GameObjects in shadow maps. If you do not want this behavior, use Shader Graph to author a Material that does not write to the depth buffer.
3436

3537
[!include[](snippets/volume-override-api.md)]

Packages/com.unity.render-pipelines.high-definition/Documentation~/Ray-Traced-Shadows.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Ray-traced Directional Light shadows without colored shadows
7373
| **Sample Count** | Controls the number of rays that HDRP uses per pixel, per frame. Higher values produce more accurate shadows. Increasing this value increases execution time linearly. |
7474
| **Color Shadow** | Allows transparent and transmissive GameObjects to cast colored shadows. A Material can only cast colored shadows when its [**Refraction Model**](Surface-Type.md#transparency-inputs) is set to **Thin**, **Box** or **Sphere**. |
7575
| **Denoise** | Enables the spatio-temporal filter that HDRP uses to remove noise from the ray-traced shadows; making them smoother. |
76-
| - **Denoiser Radius** | Controls the radius of the spatio-temporal filter. |
76+
| - **Denoiser Radius** | Increases or decreases the blurriness between ray traced shadows, by controlling the radius of the spatio-temporal filter. |
7777

7878
<a name="PointLight"></a>
7979

0 commit comments

Comments
 (0)