-
Notifications
You must be signed in to change notification settings - Fork 855
[HDRP]Improvements and fixes on Volumes Components Inspectors #3072
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
[HDRP]Improvements and fixes on Volumes Components Inspectors #3072
Conversation
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.
My main concern is that the current test freeze the code a little to much. I would have prefered to only test the feature than actually test all component and froze the additional fields eddition without editing your test.
Then check the API visibility and if public is good, fix the missing argument in the documentation.
com.unity.render-pipelines.core/Editor/Volume/VolumeComponentEditor.cs
Outdated
Show resolved
Hide resolved
com.unity.render-pipelines.core/Editor/Volume/VolumeComponentEditor.cs
Outdated
Show resolved
Hide resolved
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 am not sure you do this the good way here.
What you want to test is that the mechanism work with the [Attribute]. But then if there is a decision to add new Additional Property in a component it should not broke your test. I mean you test more than the feature here. You also test that each component should not change regarding the feature usage. Also in case we swap two lines, the order will change and the test will fail.
A better way would be to only test the feature. For that you create a new VolumeComponent only for test purpose and check its list is right. You don't need to test each component as it is redundant. But you want to check special cases. So something like:
- some fields are [Additional] (normal case) (optional: but there is also non additional fields in between)
- no fields are [Additional] (edge case)
- all fields are [Additional] (edge case)
Additionaly if you want test several case with same method, what you have done works. But you can also provide multiple data entry for the same test without using inheritance. See HDAdditionalLightDataTest.cs for an example.
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.
@JulienIgnace-Unity Shouldn't you use this attribute too for your PR on the displays of them? Can be perhaps usefull if we have a equivalent to default inspector for volumes.
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 were discussing this, an we will look at the merge.
com.unity.render-pipelines.core/Runtime/Volume/VolumeComponent.cs
Outdated
Show resolved
Hide resolved
com.unity.render-pipelines.core/Runtime/Volume/VolumeComponent.cs
Outdated
Show resolved
Hide resolved
c1b1724
to
4887528
Compare
public static string toggleAllText { get; } = L10n.Tr("Toggle All"); | ||
} | ||
|
||
Vector2? m_OverrideToggleSize; |
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 am not familiar with that notation. what does the ? mean after the type
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.
This is making a nullable value type (since c# 8 you can do it on reference types).
Basically it allow us to set null to the variable(default value)
I am using it here to allow me to check if it has been initialized.
For instance imagine a bool
that is binded to UI. bool will only have true(yes) or false(no) as possibilities, but you want to make sure that the user selects if the option is wanted or not. So, you could not default to false
, So instead of having another bool to check if the the user has selected yes or no for this, you make a bool?
now our bool?
has three states null, true, false. This will allow us to check easily if the user has selected a value for it.
So, to obtain the value of a nullable reference or value type you could do it by .HasValue
(but it think performance wise will be the same as doing ==null
), and to obtain the value stored in our case a Vector2
simply use .Value.
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.
thanks for the tip!
com.unity.render-pipelines.core/Tests/Editor/Volumes/VolumeComponentTests.cs
Show resolved
Hide resolved
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.
One comment about the name of the Additional Attribute otherwise lgtm.
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.
Better on the test side. 📗 lgtm :)
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.
Nice first PR :) definitely good improvements there!
Reviewed with @MaddalenaUnity , green light from she |
6ac9e08
to
4233d09
Compare
4233d09
to
b79ac5a
Compare
b79ac5a
to
04cca69
Compare
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.
Before PR
After PR
Concerns:
- The 2px change increases the vertical gaps between checkboxes, making already long volume overrides already longer. Discussed with UX that this is an expected side effect
- The horizontal gaps between checkboxes also increased due to alignment with NONE field. Maybe we shouldnt align with NONE? See image below cc @MaddalenaUnity
Whats tested:
Since its just a visual change I only did basic testing of described features and Undo check.
Conclusion
These are minor concerns and fine to merge it as is, but would be good to consider them if we can.
7f23e7a
to
04cca69
Compare
Updating with your comments: |
* Fix issue with register spilling in light list shaders #3016 * Fix a flickering issue related to moving shadow receivers (case 1302392) and a refactoring to avoid computing the same value for every effect. #3039 * Merge Hd/bugfix #3047 * [HDRP]Improvements and fixes on Volumes Components Inspectors #3072 * Fix XR depth copy and MSAA #3075 * [HDRP][Compositor] Fix issues with compositor's undo #3100 * Hdrp/docs/fix 1305538 (#3112) * Added information about using recursive rendering and other effects * Fixed formatting * [HDRP] Merge Hd/bugfix #3120 * Formatting Co-authored-by: FrancescoC-unity <43168857+FrancescoC-unity@users.noreply.github.com> Co-authored-by: anisunity <42026998+anisunity@users.noreply.github.com> Co-authored-by: alex-vazquez <76204843+alex-vazquez@users.noreply.github.com> Co-authored-by: Fabien Houlmann <44069206+fabien-unity@users.noreply.github.com> Co-authored-by: Pavlos Mavridis <pavlos.mavridis@unity3d.com> Co-authored-by: Lewis Jordan <lewis.jordan@hotmail.co.uk>
Purpose of this PR
This PR is fixing these bugs
Changes
Testing status
Comments to reviewers
Documentation changes will be sync with @JulienIgnace-Unity