-
Notifications
You must be signed in to change notification settings - Fork 855
[XPIPELINE-97] Polish HDRP Global Settings #4012
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
…rPIpelineGlobalSettings.instance
var hdrp = HDRenderPipeline.defaultAsset; | ||
var material = hdrp != null ? hdrp.GetDefaultMirrorMaterial() : null; | ||
|
||
var material = HDRenderPipeline.currentAsset?.GetDefaultMirrorMaterial(); |
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.
So we switch from default (gfx one) to current (potentially quality). Is this ok ?
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.
Both are fine, since GetDefaultMirrorMaterial will get the HDRP Global Settings one ;)
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 could actually rewrite that to grab the HDRP Global Settings one!
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.
fixed in upcoming commit
hasMixedValues: serialized.maximumLODLevel.hasMultipleDifferentValues); | ||
|
||
area.AmmendInfo(FrameSettingsField.MaterialQualityLevel, | ||
overridedDefaultValue: defaultFrameSettings?.materialQuality.Into() ?? MaterialQualityMode.Medium, |
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.
Why it should be Medium above all other possibility? I mean if defaultFrameSettings is null, it means we are displaying the version in the global settings. So why it should be linked to Medium quality mode? This seams strange. At least it need comments to explain why we chose this default here.
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.
we needed to chose a value, i didnt know which one to use so i chose medium
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 think this need to be checked, perhaps ask TA and UX for this point.
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.
But it can be fixed in a later PR perhaps
const string renderingSettingsHeaderContent = "Rendering"; | ||
const string lightSettingsHeaderContent = "Lighting"; |
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.
Should this be localized?
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.
yes! will fix
bool enabled = field.IsOverrideableWithDependencies(serializedFrameSettings, defaultFrameSettings); | ||
withOverride &= enabled & GUI.enabled; | ||
bool shouldBeDisabled = withOverride || !enabled || !GUI.enabled; | ||
bool shouldBeDisabled = (withOverride || !enabled || !GUI.enabled); |
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.
uneeded parenthesis
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.
fixed
volumeProfileDefault = serializedObject.FindProperty("m_VolumeProfileDefault"); | ||
volumeProfileLookDev = serializedObject.FindProperty("m_VolumeProfileLookDev"); | ||
lookDevVolumeProfile = serializedObject.FindProperty("m_LookDevVolumeProfile"); |
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.
ha sorry but now we have another name inconsistency here:
LookDevVolumeProfile
VolumeProfileDefault
Should this be defaultVolumeProfile?
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 could yes. will update
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.
Wait if i change it, i need to obsolete and automatically rename no?
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.
Is there any release with this version landed?
yes -> yes you need to
no -> just change it quickly before any release land
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.
those changes landed in srp2core so i did a migration pass in updated file
m_OverrideState: 0 | ||
m_Value: 10 |
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.
here too: value changed. Please check
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.
will remove this file from the PR - i am not supposed to change it
m_Value: 1 | ||
m_Resolution: | ||
m_OverrideState: 0 | ||
m_OverrideState: 1 |
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.
here too: value changed. Please check
m_Value: 0 | ||
m_HighQualityFiltering: | ||
m_OverrideState: 0 | ||
m_OverrideState: 1 |
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.
here too: value changed. Please check
cameraMotionBlur: | ||
m_OverrideState: 0 | ||
m_Value: 1 | ||
specialCameraClampMode: | ||
m_OverrideState: 0 | ||
m_Value: 0 | ||
cameraVelocityClamp: | ||
m_OverrideState: 0 | ||
m_Value: 0.05 | ||
cameraTranslationVelocityClamp: | ||
m_OverrideState: 0 | ||
m_Value: 0.05 |
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.
also for all added entry (here and bellow), check if it is still the default from code
com.unity.render-pipelines.high-definition/Editor/Wizard/HDWizard.Configuration.cs
Outdated
Show resolved
Hide resolved
Better :) |
internal static readonly GUIContent lensAttenuationModeContentLabel = EditorGUIUtility.TrTextContent("Lens Attenuation Mode", "Set the attenuation mode of the lens that is used to compute exposure. With imperfect lens some energy is lost when converting from EV100 to the exposure multiplier."); | ||
|
||
internal static readonly GUIContent diffusionProfileSettingsLabel = EditorGUIUtility.TrTextContent("Diffusion Profile Assets"); | ||
internal static readonly string warningHdrpNotActive = "No HD Render Pipeline currently active. Verify your Graphics Settings and active Quality Level."; |
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.
Note for reviewers: Currently error and warning messages in C# are left unlocalized.
See https://confluence.unity3d.com/display/LOC/Editor+Localization+Coding+Guidelines
{ | ||
} | ||
|
||
void Draw_Warnings(ref SerializedHDRenderPipelineGlobalSettings serialized, Editor owner) |
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 think code convention does not allow '_' inside names
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.
The rest of the file is like that and other windows UI code, so it should be good no?
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.
Well, according to code convention, we should not use _ except for prefixing https://ono.unity3d.com/unity-extra/unity-meta/raw/@/ReferenceSource/CSharp/Assets/CSharpReference.cs
So I assum it was already wrong at the time :/
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.
Seams good. Check with UX/TA for default on medium quality for material. This need to be clarified (can be in later PR)
# Conflicts: # com.unity.render-pipelines.high-definition/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.
// If ray tracing is not enabled we do not want to have ray tracing resources referenced | ||
m_GlobalSettings.ClearRayTracingResources(); | ||
int qualityLevelCount = QualitySettings.names.Length; | ||
for (int i = 0; i < qualityLevelCount && !requiresRayTracingResources; ++i) |
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.
Maybe just use break in the if instead of second condition of !requiresRayTracingResources
I think it's a bit easier to read that way.
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.
Testing: Done
Whats tested:
- Regression testing
- Creating a new HDRP project and running the DXR wizard
- Using Frame settings on multiple cameras
- Frame settings can override Default settings. ex. If you turn on Opaque on camera but turn it off in Default - opaque objects will be rendered.
- Switching quality settings Low->Med->High on Template. Works as intended.
- Debug Scene camera and Other cameras correctly display active Frame Settings
- If something is Off in the HDRP asset, but On in Frame settings. The feature will not be present in the scene, as expected.
- Real-world usage: Upgrading Amalienborg, changing Frame Settings
- Building a player
- Changing Frame settings via Inspector and via Project Settings tab
- Editing light layer names
- Every fix as requested in PR
- Wizard - profile creation: default PR 3873 - previously fixed by Julien Ignace
- Building DXR HDRP template on High preset
- Null ref when URP and HDRP are installed 1313426
- HDRP Global Settings Asset is no longer created when URP or Default is the current renderer
- HDRP Default settings not saving, case 1323947
- Frame Settings refactor
- Frame Settings is renamed
- You can always edit a setting no matter the active HDRP Asset
- you edit Custom Frame Settings, you can always override values no matter the parent or HDRP Asset. it is disabled only when you cannot change them because it has no impact.
Issues blocking the PR:
- [Fixed] Frame settings can not be saved
j0qFUlOGMR.mp4
- [Fixed] Error on reflection probe change
BKk2Dsm7yb.mp4
Issues I found that I will file fogbugz for, not blocking the PR:
- The path no longer exists described in the warning
- Global settings ignore the name specified in HDRP wizard
LCgkLo0eFZ.mp4
# Conflicts: # com.unity.render-pipelines.high-definition/CHANGELOG.md # com.unity.render-pipelines.high-definition/Editor/Wizard/HDWizard.Configuration.cs # com.unity.render-pipelines.high-definition/Editor/Wizard/HDWizard.Window.cs
…iew closed but HD Settings tab is opened
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.
Updated the review above. Should be good to merge now.
Filed 2 fogbugz for cosmetic issues:
https://fogbugz.unity3d.com/f/cases/1327978/
https://fogbugz.unity3d.com/f/cases/1327981/
Purpose of this PR
This PR aims to finish and polish the implementation of HDRP Global Settings for 2021.2.
Here is a list of changes:
Code-only changes:
Fixed broken fixes:
Fixes:
(Example showing error message when switching from URP to HDRP and no HDRP Global Settings asset was assigned in the Graphics Settings)
Frame Settings refactor (see here):
Example of how Frame Settings behave now (Camera / HDRP Global Settings):

Example of changes:

Testing status
Tested on Windows Editor for local test project and Template HD.
Tried also a build of Template HD.
Known issues: https://fogbugz.unity3d.com/f/cases/1323947/
Important to test that broken fixes are actually fixed + Frame Settings behave as expected
Comments to reviewers
This is the last PR for HDRP Global Settings planned before cut-off.