Skip to content

Conversation

alex-vazquez
Copy link
Contributor

Purpose of this PR

This PR is fixing these bugs

Changes

  • Fixed spacing between property fields due to a harcoded Rect
  • ALL/NONE changed to Toggles and maintain the state
  • When ALL/NONE are selected we check if we should affect to the additional properties
  • Adding localization to undo stack
  • Adding unit tests
  • Bunch of test checking changes done on additional properties of volumes components
  • Testing the Volume component editors to check the set and get of the overrides states.
  • Update CHANGELOG.md

Testing status

  • Spacing of properties on Volume Components editors
  • ALL/NONE are update only the correct overrides (when advanced mode is off they do not affect to advanced properties)
  • ALL/NONE mantain the state if all the overrides are checked or if any of them are checked.

Comments to reviewers

Documentation changes will be sync with @JulienIgnace-Unity

Copy link
Contributor

@RSlysz RSlysz left a 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.

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

@alex-vazquez alex-vazquez force-pushed the HDRP/fix/1297795-VolumeComponent-RowsSpacing branch from c1b1724 to 4887528 Compare January 14, 2021 10:26
public static string toggleAllText { get; } = L10n.Tr("Toggle All");
}

Vector2? m_OverrideToggleSize;
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

thanks for the tip!

Copy link
Contributor

@JulienIgnace-Unity JulienIgnace-Unity left a 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.

Copy link
Contributor

@RSlysz RSlysz left a 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 :)

Copy link
Contributor

@jenniferd-unity jenniferd-unity left a 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!

@alex-vazquez alex-vazquez marked this pull request as ready for review January 19, 2021 09:42
@alex-vazquez
Copy link
Contributor Author

Reviewed with @MaddalenaUnity , green light from she

@alex-vazquez alex-vazquez requested review from a team as code owners January 21, 2021 08:41
@alex-vazquez alex-vazquez force-pushed the HDRP/fix/1297795-VolumeComponent-RowsSpacing branch from 6ac9e08 to 4233d09 Compare January 21, 2021 08:51
@alex-vazquez alex-vazquez removed the request for review from a team January 21, 2021 08:57
@alex-vazquez alex-vazquez removed request for a team January 21, 2021 08:57
@alex-vazquez alex-vazquez force-pushed the HDRP/fix/1297795-VolumeComponent-RowsSpacing branch from 4233d09 to b79ac5a Compare January 21, 2021 16:08
@alex-vazquez alex-vazquez force-pushed the HDRP/fix/1297795-VolumeComponent-RowsSpacing branch from b79ac5a to 04cca69 Compare January 21, 2021 16:12
Copy link
Contributor

@iM0ve iM0ve left a comment

Choose a reason for hiding this comment

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

Before PR

a

After PR

b

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

Screenshot 2021-01-25 at 17 01 29

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.

@alex-vazquez alex-vazquez force-pushed the HDRP/fix/1297795-VolumeComponent-RowsSpacing branch from 7f23e7a to 04cca69 Compare January 26, 2021 11:10
@alex-vazquez
Copy link
Contributor Author

@iM0ve @MaddalenaUnity

Updating with your comments:

volumesallalignright

@sebastienlagarde sebastienlagarde merged commit eba6d6a into master Jan 26, 2021
@sebastienlagarde sebastienlagarde deleted the HDRP/fix/1297795-VolumeComponent-RowsSpacing branch January 26, 2021 17:08
@sebastienlagarde sebastienlagarde restored the HDRP/fix/1297795-VolumeComponent-RowsSpacing branch January 26, 2021 17:08
@sebastienlagarde sebastienlagarde deleted the HDRP/fix/1297795-VolumeComponent-RowsSpacing branch January 26, 2021 17:09
sebastienlagarde added a commit that referenced this pull request Mar 2, 2021
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants