Skip to content
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

Moved the Spotlight range validation logic into HDAdditionalLightData.OnValidate #5112

Merged
merged 82 commits into from
Jul 19, 2021

Conversation

fredericv-unity3d
Copy link
Contributor

Purpose of this PR

Fixes case 1345264

Light range values were validated inside the inspector instead of the HDAdditionalLightData.OnValidate() function.
Previous code did not support multi edition appropriately and is only executed when editing with the inspector or gizmo.

I moved as well other fields in similar case:

  • Shape Width and Shape Height (Box)
  • Shape Radius (Cone, Pyramid)

Testing status

Manual tests:

Testing that multi edition works appropriately

  1. Created a new scene
  2. Delete everything in the hierarchy
  3. Add 3 spot lights
  4. Set their radius to 0, 1, 2 respectively
  5. Select them all
  6. Use the Inner Angle slider in the inspector ui
  7. The radius value is not updated for any spotlight

Testing that the validation logic properly execute

  1. Select any spot light

  2. Set to the cone shape

  3. Try to set the range value below 0

  4. The radius value is 0

  5. Select any spot light

  6. Set the box shape

  7. Try to set the width and height values below 0.1

  8. The width and height values are exactly 0.1


Comments to reviewers

pmavridis and others added 30 commits May 26, 2021 19:23
* Fix AxF debug output in certain configurations.

* Update comment
* Fix white flash

* changelog

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
* Show info box when ray tracing is enabled.

* Changelog

* Move below MSAA

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
…phics Compositor enabled (#4593)

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
* Reconstruct jittered projection matrix far plane (for Infinite )

* Changelog

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
…DRP's lifecycle. (#4688)

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
* Fix overdraw in custom pass utils blur function

* Updated changelog

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
* Fix

* changelog

* Force sync compilation for TAA

Co-authored-by: CifaCia <f.cifariellociardi@gmail.com>
Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
…side is updated. (case 1335737, related to 1314040) (#4691)

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
…ing only the RTSSS Data (case 1332904). (#4626)

* Fixed the ray traced sub subsurface scattering debug mode not displaying only the RTSSS Data (case 1332904).

* Add test scene

Co-authored-by: Remi Chapelain <remi.chapelain@unity3d.com>
Co-authored-by: Sebastien Lagarde <sebastien@unity3d.com>
…e refraction and probe refraction (#4653)

* Delete the second transmittance mul

* Changelog

Co-authored-by: Sebastien Lagarde <sebastien@unity3d.com>
#4636)

* Initialize the shading normal to a non-zero value for anisotropy

* Changelog

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
* Fix VfX lit particle aov output color space

* Update comment

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
* Fixed issue with transparent unlit.

* Updated changelog.

* Reverted accidental change to default mtl.

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
* Fix

* changelog

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
…cal volumetric fog volume (#4728)

* Fixed nullref when deleting the 3D mask of a density volume (case 1339330)

* Updated changelog

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
adrien-de-tocqueville and others added 9 commits July 6, 2021 14:41
…ion is enabled. (#4986)

* Fix AO perceived wobble

* changelog

* Update screenshots

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
* Fix white flash with SSR when resetting camera history

* Move branch login inside GetPreviousExposureTexture

* Fix for fixed exposure
* Adding missing macro for stencil flags in particle forward shaders. This will let flags like TAA Reject be useful

* Changelog
@github-actions
Copy link

github-actions bot commented Jul 12, 2021

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.
Link to Yamato: https://yamato.cds.internal.unity3d.com/jobs/902-Graphics
Search for your PR branch using the sidebar on the left, then add the following segment(s) to the end of the URL (you may need multiple tabs depending on how many packages you change)

HDRP
/.yamato%252Fall-hdrp.yml%2523PR_HDRP_2021.2

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.

@sebastienlagarde
Copy link
Contributor

note to self: to redirect to master once hd/bugfix is merge

@sebastienlagarde sebastienlagarde changed the base branch from hd/bugfix to master July 12, 2021 22:56
@sebastienlagarde sebastienlagarde marked this pull request as ready for review July 12, 2021 22:59
* Fix case 1346650 where OnGUI draws were overwritten (#5107)

* Fix case 1346650 where OnGUI draws were overwritten

* update changelog

* change conditional check

* Revert "Color field keeps updating when using eye dropper and Esc key is pressed (#4950)" (#5122)

This reverts commit 587dc15.

* [VFX] Fix Sanitize behavior (#4971)

* Add regression test on basic sanitize

See https://unity.slack.com/archives/G1BTWN88Z/p1623825854027500

* Move SanitizeForImport

See this conversation : https://unity.slack.com/archives/C47JPNNTZ/p1624277477261600?thread_ts=1623913383.239100&cid=C47JPNNTZ
However, some concerns :
- No idea about side effects of this solution
- It will lead to a double compilation of sanitized files (if there is a sanitize needed, we will have a new reimport)
- OnPostprocessAllAssets can't be filtered efficiently on the VisualEffectAsset

* *Minor : Missing InvariantCultureIgnoreCase flag in EndsWith

* *Update changelog.md

* *Fix HDRP warning

Hoping it will prevent this issue :
```
Unhandled log message: '[Exception] UnityException: DestroyImmediate is not allowed to be called from a ScriptableObject constructor (or instance field initializer), call it in OnEnable instead. Called from ScriptableObject 'HDWizard'.
See "Script Serialization" page in the Unity Manual for further details.'. Use UnityEngine.TestTools.LogAssert.Expect
```
See https://yamato-artifactviewer.prd.cds.internal.unity3d.com/9f8a60fd-d1f9-48b5-9513-e4e535cf5d7c%2Flogs%2FTestProjects%2FVisualEffectGraph_HDRP%2Ftest-results/TestReportV1.html

* Revert "*Fix HDRP warning"

This reverts commit 99ab5fb.

* More conservative way of workaround Preprocess issue

Use a static cache of already santized object
This solution remains a pretty dirty trick :-/
*Before*
- Preprocess : Compile (possibly with side effect modifying the graph)
- PostProcess : Sanitize, if there is a modification, it should relaunch the import & recompile

*After*
- Preprocess : Compile only if the sanitize has been done
- PosProcess : Sanitize, if it's the first sanitize, relaunch the reimport

Locally, it fixes unexpecting missing import of point cache asset (see 09_AttributeMaps).

* Remove DestroyImmediate 

This instance singleton can be called from HDWizard constructor making this call illegal.
See https://unity.slack.com/archives/GHD5LADU7/p1625040944440100?thread_ts=1624547150.387900&cid=GHD5LADU7 (cc @RSlysz)
Testing yamato ⏳

* Revert "Remove DestroyImmediate "

This reverts commit 508d713.

* Add HDRPUserSettings

It prevents Wizard Popup to be shown while runnning editor test
See : https://unity.slack.com/archives/GHD5LADU7/p1625056568458400?thread_ts=1624547150.387900&cid=GHD5LADU7

* Revert "Add HDRPUserSettings"

This reverts commit ff51dcf.

* Force m_WizardPopupAtStart to false

Prevent exception while launching test

* Improvement of this workaround after discussion with @julienf

- Use m_GraphSanitized instead of an HashSet
- ClearRuntimeData when not sanitized (prevent any unexpected call to OnSetupMaterial)

* Minor : Editor Test cleanup

There was an unexpercted custom implementation of MakeTemporaryGraph
Use common code : VFXTestCommon.MakeTemporaryGraph()

* Gather all ImportAsset after all Sanitize from the same batch

Fix this issue : #4971 (comment)
See : See : https://unity.slack.com/archives/C47JPNNTZ/p1625218128286700?thread_ts=1623913383.239100&cid=C47JPNNTZ

* Minor changes : Change log & Safe execption handling

- Use a more explanotory message for the changelog
- Handle exception safely to avoid the import cancellation
- Fix issue : #4971 (comment)
- Fix issue : #4971 (comment)

* Fix sanitize issue during the very first loading

GetOrCreateGraph is also assigning the visualEffectResource to the current graph https://github.com/Unity-Technologies/Graphics/blob/d6a59150d20762251cc5fcb8515fee494a142ccc/com.unity.visualeffectgraph/Editor/Models/VFXGraph.cs#L231
It's needed to correctly update child dependencies
This behavior is counterintuitive

* *Minor* Replace `return` by `continue`

I noticed this issue working on this PR : #5104

Co-authored-by: Kenny Tan <82013253+kennytann@users.noreply.github.com>
Co-authored-by: Paul Demeulenaere <pauld@unity3d.com>
@fredericv-unity3d fredericv-unity3d requested review from a team as code owners July 13, 2021 10:05
Copy link
Contributor

@JMargevics JMargevics left a comment

Choose a reason for hiding this comment

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

What's tested seems sufficient. From my side I've checked if Undo still works. No issues ✅

Copy link

@erikabar erikabar left a comment

Choose a reason for hiding this comment

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

Changes are in HDRP package, so approving without testing from URP side

@sebastienlagarde sebastienlagarde removed the request for review from a team July 19, 2021 11:44
@sebastienlagarde sebastienlagarde merged commit 5813591 into master Jul 19, 2021
@sebastienlagarde sebastienlagarde deleted the hd/bugfix_case_1345264_spotlight_radius_ui branch July 19, 2021 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.