-
Notifications
You must be signed in to change notification settings - Fork 855
Public API for URP DebugDisplaySettings #5682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Made the settings API public - Renamed properties to be more uniform with each other and use camelCase - Added new Material Albedo validation preset: AlbedoDebugValidationPreset.Custom
Hi! This comment will help you figure out which jobs to run before merging your PR. The suggestions are dynamic based on what files you have changed. HDRP URP Shader Graph VFX SRP Core Depending on the scope of your PR, you may need to run more jobs than what has been suggested. Please speak to your lead or a Graphics SDET (#devs-graphics-automation) if you are unsure. |
com.unity.render-pipelines.universal/Runtime/Debug/DebugDisplaySettings.cs
Outdated
Show resolved
Hide resolved
…vidually. - Changed DebugDisplaySettingsCommon interface implementation because of this. The common settings now report everything as "not active" because the widgets are not owned by it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to be working well, didn't discover any issues withthe rendering debugger.
# Conflicts: # com.unity.render-pipelines.universal/CHANGELOG.md # com.unity.render-pipelines.universal/Runtime/Debug/DebugDisplaySettingsCommon.cs # com.unity.render-pipelines.universal/Runtime/Debug/DebugDisplaySettingsRendering.cs # com.unity.render-pipelines.universal/Runtime/Debug/UniversalRenderPipelineDebugDisplaySettings.cs # com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs
public bool AreAnySettingsActive => false; | ||
public bool IsPostProcessingAllowed => true; | ||
public bool IsLightingActive => true; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
com.unity.render-pipelines.universal/Runtime/Debug/DebugDisplaySettingsMaterial.cs
Outdated
Show resolved
Hide resolved
com.unity.render-pipelines.universal/Runtime/Debug/DebugDisplaySettingsMaterial.cs
Show resolved
Hide resolved
com.unity.render-pipelines.universal/Runtime/Debug/DebugDisplaySettingsRendering.cs
Show resolved
Hide resolved
- Exposed public setters to albedoHueTolerance and albedoSaturationTolerance that were still private. - Fixed compile error in player build due to renamed symbol.
# Conflicts: # com.unity.render-pipelines.universal/CHANGELOG.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
commit c0c961d Merge: f6e204f b8c4896 Author: Arttu Peltonen <arttu.peltonen@unity3d.com> Date: Wed Oct 13 10:54:12 2021 +0300 Merge branch 'master' into srp/urp-debugdisplay-api # Conflicts: # com.unity.render-pipelines.universal/CHANGELOG.md commit f6e204f Author: Arttu Peltonen <arttu.peltonen@unity3d.com> Date: Tue Oct 5 12:06:17 2021 +0300 Change public fields into public properties. - Exposed public setters to albedoHueTolerance and albedoSaturationTolerance that were still private. - Fixed compile error in player build due to renamed symbol. commit 793e63f Merge: 945724e f0c1049 Author: Arttu Peltonen <arttu.peltonen@unity3d.com> Date: Mon Oct 4 16:09:35 2021 +0300 Merge branch 'master' into srp/urp-debugdisplay-api # Conflicts: # com.unity.render-pipelines.universal/CHANGELOG.md # com.unity.render-pipelines.universal/Runtime/Debug/DebugDisplaySettingsCommon.cs # com.unity.render-pipelines.universal/Runtime/Debug/DebugDisplaySettingsRendering.cs # com.unity.render-pipelines.universal/Runtime/Debug/UniversalRenderPipelineDebugDisplaySettings.cs # com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs commit 945724e Author: Arttu Peltonen <arttu.peltonen@unity3d.com> Date: Thu Sep 16 14:26:26 2021 +0300 Iterate m_Settings array instead of calling each settings object individually. - Changed DebugDisplaySettingsCommon interface implementation because of this. The common settings now report everything as "not active" because the widgets are not owned by it. commit 17a8ef5 Author: Arttu Peltonen <arttu.peltonen@unity3d.com> Date: Thu Sep 16 10:46:41 2021 +0300 Fix casing to camelCase for settings properties commit df48fa1 Author: Arttu Peltonen <arttu.peltonen@unity3d.com> Date: Thu Sep 16 10:06:08 2021 +0300 Changelog commit 2971ab6 Author: Arttu Peltonen <arttu.peltonen@unity3d.com> Date: Thu Sep 16 09:15:36 2021 +0300 Public API for URP DebugDisplaySettings - Made the settings API public - Renamed properties to be more uniform with each other and use camelCase - Added new Material Albedo validation preset: AlbedoDebugValidationPreset.Custom
commit c0c961d Merge: f6e204f b8c4896 Author: Arttu Peltonen <arttu.peltonen@unity3d.com> Date: Wed Oct 13 10:54:12 2021 +0300 Merge branch 'master' into srp/urp-debugdisplay-api # Conflicts: # com.unity.render-pipelines.universal/CHANGELOG.md commit f6e204f Author: Arttu Peltonen <arttu.peltonen@unity3d.com> Date: Tue Oct 5 12:06:17 2021 +0300 Change public fields into public properties. - Exposed public setters to albedoHueTolerance and albedoSaturationTolerance that were still private. - Fixed compile error in player build due to renamed symbol. commit 793e63f Merge: 945724e f0c1049 Author: Arttu Peltonen <arttu.peltonen@unity3d.com> Date: Mon Oct 4 16:09:35 2021 +0300 Merge branch 'master' into srp/urp-debugdisplay-api # Conflicts: # com.unity.render-pipelines.universal/CHANGELOG.md # com.unity.render-pipelines.universal/Runtime/Debug/DebugDisplaySettingsCommon.cs # com.unity.render-pipelines.universal/Runtime/Debug/DebugDisplaySettingsRendering.cs # com.unity.render-pipelines.universal/Runtime/Debug/UniversalRenderPipelineDebugDisplaySettings.cs # com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs commit 945724e Author: Arttu Peltonen <arttu.peltonen@unity3d.com> Date: Thu Sep 16 14:26:26 2021 +0300 Iterate m_Settings array instead of calling each settings object individually. - Changed DebugDisplaySettingsCommon interface implementation because of this. The common settings now report everything as "not active" because the widgets are not owned by it. commit 17a8ef5 Author: Arttu Peltonen <arttu.peltonen@unity3d.com> Date: Thu Sep 16 10:46:41 2021 +0300 Fix casing to camelCase for settings properties commit df48fa1 Author: Arttu Peltonen <arttu.peltonen@unity3d.com> Date: Thu Sep 16 10:06:08 2021 +0300 Changelog commit 2971ab6 Author: Arttu Peltonen <arttu.peltonen@unity3d.com> Date: Thu Sep 16 09:15:36 2021 +0300 Public API for URP DebugDisplaySettings - Made the settings API public - Renamed properties to be more uniform with each other and use camelCase - Added new Material Albedo validation preset: AlbedoDebugValidationPreset.Custom
Merged onto staging branch. Staging branch landed onto master on #6085 |
Purpose of this PR
This main point of this PR is to expose public DebugDisplaySettings API. This is useful for both internal and external users, who want to create custom UI for certain debug modes. This was the exact use case for Lookdev Studio team. This PR will bring URP to parity with HDRP, where an equivalent API is already public.
Public DebugDisplay API
Users can now control DebugDisplay from script. Example usage:
The PR renames the now public properties to be consistent and use
camelCase
as described in coding standards.Added AlbedoDebugValidationPreset.Custom
As an incidental change, a new preset has been added to Material Albedo validation presets:
AlbedoDebugValidationPreset.Custom
. This makes sense from API point of view, and also useful from user perspective: In the images above, the custom color has been set to yellowis-orange, which matches the albedo of helmet and power tool, and gives error colors for other albedos:Testing status
Tested locally by creating a simple script (custom-debugui-v2.zip) that uses the public API. This simulates the usecase that users of the API would have.
This should demonstrate that the API works as intended - feel free to download the attached script and try it out.
In terms of other testing, please do a quick test for rendering debugger to see that nothing has been broken by the renaming.