Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions com.unity.render-pipelines.universal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Added Depth Texture setting for Overlay Camera.
- Added Depth Priming support for Vulkan with MSAA.
- Added Shadows and Additional Lights off variants stripping.
- Exposed public API for DebugDisplaySettings.

### Changed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public override void Setup(ScriptableRenderContext context, ref RenderingData re
if (DebugHandler != null)
{
#if UNITY_EDITOR
UnityEditorInternal.SpriteMaskUtility.EnableDebugMode(DebugHandler.DebugDisplaySettings.MaterialSettings.DebugMaterialModeData == DebugMaterialMode.SpriteMask);
UnityEditorInternal.SpriteMaskUtility.EnableDebugMode(DebugHandler.DebugDisplaySettings.materialSettings.materialDebugMode == DebugMaterialMode.SpriteMask);
#endif
if (DebugHandler.AreAnySettingsActive)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public SettingsPanel()
AddWidget(WidgetFactory.CreateMissingDebugShadersWarning());

var debugDisplaySettings = UniversalRenderPipelineDebugDisplaySettings.Instance;
var materialSettingsData = debugDisplaySettings.MaterialSettings;
var materialSettingsData = debugDisplaySettings.materialSettings;
AddWidget(new DebugUI.Foldout
{
displayName = "Material Filters",
Expand All @@ -54,7 +54,7 @@ public SettingsPanel()
}
});

var lightingSettingsData = debugDisplaySettings.LightingSettings;
var lightingSettingsData = debugDisplaySettings.lightingSettings;
AddWidget(new DebugUI.Foldout
{
displayName = "Lighting Debug Modes",
Expand All @@ -75,7 +75,7 @@ public SettingsPanel()
}
});

var renderingSettingsData = debugDisplaySettings.RenderingSettings;
var renderingSettingsData = debugDisplaySettings.renderingSettings;
AddWidget(new DebugUI.Foldout
{
displayName = "Rendering Debug",
Expand Down Expand Up @@ -103,11 +103,13 @@ public SettingsPanel()
}

#region IDebugDisplaySettingsData
UniversalRenderPipelineDebugDisplaySettings debugDisplaySettings => UniversalRenderPipelineDebugDisplaySettings.Instance;
public bool AreAnySettingsActive => debugDisplaySettings.AreAnySettingsActive;
public bool IsPostProcessingAllowed => debugDisplaySettings.IsPostProcessingAllowed;
public bool IsLightingActive => debugDisplaySettings.IsLightingActive;
public bool TryGetScreenClearColor(ref Color color) => debugDisplaySettings.TryGetScreenClearColor(ref color);

// All common settings are owned by another panel, so they are treated as inactive here.

public bool AreAnySettingsActive => false;
public bool IsPostProcessingAllowed => true;
public bool IsLightingActive => true;
Comment on lines +109 to +111
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels a bit inconsistent that these properties are Upper Camel Case. But I guess this was already done before.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah the reason here was that I didn't want to go through deprecation process just to change the first letter to be lowercase, as this is implementing an interface that was already public (even though this & other implementing classes have been internal up until now). If you'd prefer consistency here, I can do it. What do you think?

Copy link
Contributor

@ellioman ellioman Oct 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally think it's worth it as API consistency decreases the WTF! moment users will have.
If it's not too much trouble I would love to get that change but it can also be done in a followup PR.

public bool TryGetScreenClearColor(ref Color _) => false;

public IDebugDisplaySettingsPanelDisposable CreatePanel()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,20 @@

namespace UnityEngine.Rendering.Universal
{
class DebugDisplaySettingsLighting : IDebugDisplaySettingsData
/// <summary>
/// Lighting-related Rendering Debugger settings.
/// </summary>
public class DebugDisplaySettingsLighting : IDebugDisplaySettingsData
{
internal DebugLightingMode DebugLightingMode { get; private set; }
internal DebugLightingFeatureFlags DebugLightingFeatureFlagsMask { get; private set; }
/// <summary>
/// Current debug lighting mode.
/// </summary>
public DebugLightingMode lightingDebugMode { get; set; }

/// <summary>
/// Current debug lighting feature flags mask that allows selective disabling individual lighting components.
/// </summary>
public DebugLightingFeatureFlags lightingFeatureFlags { get; set; }

static class Strings
{
Expand All @@ -20,17 +30,17 @@ internal static class WidgetFactory
{
nameAndTooltip = Strings.LightingDebugMode,
autoEnum = typeof(DebugLightingMode),
getter = () => (int)data.DebugLightingMode,
getter = () => (int)data.lightingDebugMode,
setter = (value) => { },
getIndex = () => (int)data.DebugLightingMode,
setIndex = (value) => data.DebugLightingMode = (DebugLightingMode)value
getIndex = () => (int)data.lightingDebugMode,
setIndex = (value) => data.lightingDebugMode = (DebugLightingMode)value
};

internal static DebugUI.Widget CreateLightingFeatures(DebugDisplaySettingsLighting data) => new DebugUI.BitField
{
nameAndTooltip = Strings.LightingFeatures,
getter = () => data.DebugLightingFeatureFlagsMask,
setter = (value) => data.DebugLightingFeatureFlagsMask = (DebugLightingFeatureFlags)value,
getter = () => data.lightingFeatureFlags,
setter = (value) => data.lightingFeatureFlags = (DebugLightingFeatureFlags)value,
enumType = typeof(DebugLightingFeatureFlags),
};
}
Expand Down Expand Up @@ -58,9 +68,9 @@ public SettingsPanel(DebugDisplaySettingsLighting data)
}

#region IDebugDisplaySettingsData
public bool AreAnySettingsActive => (DebugLightingMode != DebugLightingMode.None) || (DebugLightingFeatureFlagsMask != DebugLightingFeatureFlags.None);
public bool AreAnySettingsActive => (lightingDebugMode != DebugLightingMode.None) || (lightingFeatureFlags != DebugLightingFeatureFlags.None);

public bool IsPostProcessingAllowed => (DebugLightingMode != DebugLightingMode.Reflections && DebugLightingMode != DebugLightingMode.ReflectionsWithSmoothness);
public bool IsPostProcessingAllowed => (lightingDebugMode != DebugLightingMode.Reflections && lightingDebugMode != DebugLightingMode.ReflectionsWithSmoothness);

public bool IsLightingActive => true;

Expand All @@ -69,7 +79,7 @@ public bool TryGetScreenClearColor(ref Color color)
return false;
}

public IDebugDisplaySettingsPanelDisposable CreatePanel()
IDebugDisplaySettingsPanelDisposable IDebugDisplaySettingsData.CreatePanel()
{
return new SettingsPanel(this);
}
Expand Down
Loading