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

[VFX] Crash with subgraph #5104

Merged
merged 51 commits into from
Aug 3, 2021
Merged

Conversation

PaulDemeulenaere
Copy link
Contributor

@PaulDemeulenaere PaulDemeulenaere commented Jul 8, 2021


Purpose of this PR

Fix regression https://fogbugz.unity3d.com/f/cases/1345426/

What happens :

Solutions :

  • Force always double import : It's really heavy, and since the importAsset from PostProcessAsset it forces us to use a delayCall which have some side effect...
  • Backup & Restore the graph after compilation : It's a workaround but which have less side effect

⚠️ You should rework the whole import design of the VFX (and subgraph) to fit with incoming changes and expected behavior in assetDB.


Testing status

Adding two editor test

  1. ConvertToSubgraphOperator which does what has been reported as step to reproduce : New VFX, add a couple of add operators, plug them in set lifetime, select both add operators and convert them to a subgraph and 💥
    LPX7uVTJTe (1)

  2. ConvertToSubGraphOperator_And_ModifySubgraph : This test follows up the previous one, trying to add an output in subgraph and changing the state of the subgraph like a VCS could do.
    https://user-images.githubusercontent.com/22494706/125446308-aa4579dd-a0f6-4caa-acd9-fc676b64fb2f.mp4

N.B.: The newly introduced editor test is the reason for the addition of "path" in this ConvertToSubgraphOperator

Performances

Compared with master at 42cfbe4 (it includes the sanitize)

Testing on small graph : 000_MultiOutput
Before

Backup_And_Restore("000_MultiOutput") (3.650s)
---
VFXGraphLoad.ImportAsset 755.40 Millisecond
VFXGraphLoad.LoadAsset 76.10 Microsecond
VFXGraphLoad.GetResource 70.70 Microsecond
VFXGraph.Backup Microsecond Median:4223.20 Min:3348.80 Max:4239.10 Avg:3988.48 Std:371.12 SampleCount: 4 Sum: 15953.90
VFXGraph.Restore Microsecond Median:9582.40 Min:7754.30 Max:9834.50 Avg:8813.95 Std:906.48 SampleCount: 4 Sum: 35255.80
VFXGraph.Reimport Millisecond Median:658.49 Min:563.79 Max:714.38 Avg:645.17 Std:53.83 SampleCount: 4 Sum: 2580.69

After

Backup_And_Restore("000_MultiOutput") (4.102s)
---
VFXGraphLoad.ImportAsset 766.93 Millisecond
VFXGraphLoad.LoadAsset 493.90 Microsecond
VFXGraphLoad.GetResource 53.50 Microsecond
VFXGraph.Backup Microsecond Median:3491.70 Min:3402.70 Max:7706.40 Avg:4509.10 Std:1846.24 SampleCount: 4 Sum: 18036.40
VFXGraph.Restore Microsecond Median:9045.60 Min:8456.00 Max:14640.60 Avg:10295.30 Std:2520.15 SampleCount: 4 Sum: 41181.20
VFXGraph.Reimport Millisecond Median:758.10 Min:740.50 Max:804.00 Avg:761.65 Std:25.32 SampleCount: 4 Sum: 3046.58

Testing on big graph 014_PositionBlock
Before

Backup_And_Restore("014_PositionBlock") (19.734s)
---
VFXGraphLoad.ImportAsset 3804.54 Millisecond
VFXGraphLoad.LoadAsset 592.00 Microsecond
VFXGraphLoad.GetResource 68.40 Microsecond
VFXGraph.Backup Millisecond Median:37.31 Min:27.49 Max:43.17 Avg:34.24 Std:6.37 SampleCount: 4 Sum: 136.95
VFXGraph.Restore Millisecond Median:92.98 Min:63.10 Max:96.94 Avg:80.21 Std:14.91 SampleCount: 4 Sum: 320.83
VFXGraph.Reimport Millisecond Median:3892.95 Min:3745.30 Max:3893.12 Avg:3819.33 Std:73.70 SampleCount: 4 Sum: 15277.33

After

Backup_And_Restore("014_PositionBlock") (20.828s)
---
VFXGraphLoad.ImportAsset 3883.34 Millisecond
VFXGraphLoad.LoadAsset 542.20 Microsecond
VFXGraphLoad.GetResource 49.90 Microsecond
VFXGraph.Backup Millisecond Median:37.91 Min:28.02 Max:47.52 Avg:36.27 Std:7.39 SampleCount: 4 Sum: 145.08
VFXGraph.Restore Millisecond Median:75.55 Min:63.66 Max:99.26 Avg:78.50 Std:12.93 SampleCount: 4 Sum: 313.99
VFXGraph.Reimport Millisecond Median:4086.40 Min:4006.67 Max:4111.75 Avg:4066.16 Std:38.95 SampleCount: 4 Sum: 16264.63

This is actually the VFXGraph.Reimport which is impacted in this test : +20% for the small +7% for the big.

About the compression
Using compression.None, the Fastest mode isn't revelant for an immediate backup/restore :

Big Asset - 014_PositionBlock
None : 3827.02 Millisecond
Fastest : 3830.60 Millisecond
--------------------------------
Small Asset - 000_MultiOutput
None : 670.36 Millisecond
Fastest : 687.09 Millisecond

Comments to reviewers

I'm not fully satisfied of this solution but this workaround is the best answer we have before a more global refactor of subgraph and import processes.

The reason of this change : 29c18b7
Before
_before_manual_update

After
_after_manual_update
When there isn't any compilation :
_after_manual_update_without_compile

We could potentially use a direct call during SanitizeForImport like I tried here : 2421bc5 but in that case, we are assuming the creation of a subgraph from a VFXGraph will always trigger the reimport of the source graph.

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
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
This reverts commit 99ab5fb.
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).
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 ⏳
Prevent exception while launching test
- Use m_GraphSanitized instead of an HashSet
- ClearRuntimeData when not sanitized (prevent any unexpected call to OnSetupMaterial)
There was an unexpercted custom implementation of MakeTemporaryGraph
Use common code : VFXTestCommon.MakeTemporaryGraph()
- Use a more explanotory message for the changelog
- Handle exception safely to avoid the import cancellation
- Fix issue : #4971 (comment)
- Fix issue : #4971 (comment)
…crash-with-subgraph

# Conflicts:
#	com.unity.visualeffectgraph/CHANGELOG.md
@PaulDemeulenaere PaulDemeulenaere changed the base branch from vfx/fix/1344645-sanitize-failure to master July 8, 2021 18:48
@Unity-Technologies Unity-Technologies deleted a comment from github-actions bot Jul 8, 2021
@github-actions
Copy link

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)

VFX
/.yamato%252Fall-vfx.yml%2523PR_VFX_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.

# Conflicts:
#	com.unity.visualeffectgraph/CHANGELOG.md
#	com.unity.visualeffectgraph/Editor/Models/VFXGraph.cs
fredericv-unity3d added a commit that referenced this pull request Jul 13, 2021
* 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>
@PaulDemeulenaere PaulDemeulenaere changed the title [VFX] Crash with subgraph (WIP) [VFX] Crash with subgraph Jul 13, 2021
It has side effect which are caught by any editor test
And verify expected output slot in VFXControllerTest
@PaulDemeulenaere PaulDemeulenaere requested review from julienf-unity and a team and removed request for a team and julienf-unity July 13, 2021 13:17
@julienf-unity
Copy link
Collaborator

@Unity-Technologies/gfx-qa-vfx This PR has to be tested extensively (not just the actual crash fix steps) like the previous one, because it modifies the importer and has therefore potential implications in any vfx import

@VladNeykov VladNeykov requested review from VladNeykov and removed request for a team July 13, 2021 15:08
@PaulDemeulenaere PaulDemeulenaere marked this pull request as ready for review July 13, 2021 16:25
@VladNeykov
Copy link
Contributor

Hi @PaulDemeulenaere , thanks for the fix!
Threw anything I could think of at it, it looks solid. One (potentially unrelated) issue with infinite import of the Planetary Ring sample logged on the test doc with repro package and editor log. If it's outside of the scope of this PR, then I'm happy to green the PR.

graph.CollectDependencies(dependencies);
var backup = VFXMemorySerializer.StoreObjectsToByteArray(dependencies.ToArray(), CompressionLevel.None);

graph.CompileForImport();
Copy link
Collaborator

Choose a reason for hiding this comment

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

But still this means that CompileForImport can still trigger a SetDirty during compilation, which can potentially trigger, another useless import, or worse an infinite compile?

Copy link
Contributor Author

@PaulDemeulenaere PaulDemeulenaere Jul 15, 2021

Choose a reason for hiding this comment

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

The dirty flag (which isn't serialized) about compilation is cleared at the end of compilation. See in CompileForImport :

m_ExpressionGraphDirty = false;
m_ExpressionValuesDirty = false;

The issue is due to preprocess we are doing before the actual compilation.
The backup doesn't restore these dirty flags.
Then, the SetDirty which can occurs (maybe ?) isn't detected/triggered, otherwise, I would have a infinite compilation in the editor test I introduced.

Copy link
Contributor

@VladNeykov VladNeykov left a comment

Choose a reason for hiding this comment

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

No issues found pertaining to the PR (test doc)
Thanks for the fix!

sebastienlagarde added a commit that referenced this pull request Jul 19, 2021
….OnValidate (#5112)

* [HDRP] Fix AxF debug output in certain configurations (#4641)

* Fix AxF debug output in certain configurations.

* Update comment

* Fix SSR accumulation white flash (#4648)

* Fix white flash

* changelog

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

* Display Info Box when MSAA + ray tracing is onr (#4627)

* Show info box when ray tracing is enabled.

* Changelog

* Move below MSAA

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

* Fix distortion when resizing the window in player builds with the Graphics Compositor enabled (#4593)

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

* Add support for the camera bridge in the graphics compositor (#4599)

* Fix Jittered Project Matrix Infinite Far Clip Plane  (#4638)

* Reconstruct jittered projection matrix far plane (for Infinite )

* Changelog

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

* Fixed a memory leak related to not disposing of the RTAS at the end HDRP's lifecycle. (#4688)

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

* Fix custom pass utils Blur + Copy overdraw. (#4623)

* Fix overdraw in custom pass utils blur function

* Updated changelog

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

* Fix draw procedural invalid pass idx 1 on first template load (#4632)

* Fix

* changelog

* Force sync compilation for TAA

Co-authored-by: CifaCia <f.cifariellociardi@gmail.com>
Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Changed light reset to preserve type (#4624)

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

* Revert "Add support for the camera bridge in the graphics compositor (#4599)"

This reverts commit 2325e3f.

* AxF carpaint: Fix a compilation issue on Vulkan until the cpp HLSLcc side is updated. (case 1335737, related to 1314040) (#4691)

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

* Revert "Revert "Add support for the camera bridge in the graphics compositor (#4599)""

This reverts commit 30fffd5.

* revert: Fix distortion when resizing the window in player builds with the Graphi

* Fixed the ray traced sub subsurface scattering debug mode not displaying 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>

* Fix for discrepancies in saturation and intensity between screen space refraction and probe refraction (#4653)

* Delete the second transmittance mul

* Changelog

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

* Fix a Divide-by-Zero Warning for some Anisotropic Models (Fabric, Lit) (#4636)

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

* Changelog

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

* [HDRP] Fix VfX lit particle AOV output color space (#4646)

* Fix VfX lit particle aov output color space

* Update comment

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

* [HDRP][Path Tracing] Fixed transparent unlit (#4605)

* Fixed issue with transparent unlit.

* Updated changelog.

* Reverted accidental change to default mtl.

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

* Fix distortion with MSAA (#4711)

* Fix contact shadow debug views (#4720)

* Fix

* changelog

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

* Update Decal-Projector.md (#4695)

* [HDRP] Fixed nullref when deleting the texture asset assigned in a local 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>

* Fix decal layer enum (#4753)

* Fix typo

* Fixed reflection probes being injected into the ray tracing light cluster even if not baked (case 1329083). (#4640)

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

* Ignore hybrid duplicated reflection probes during light baking (#4663)

* Ignore hybrid duplicated reflection probes during light baking

* test path instead of scene

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

* Fix double sided option moving when toggling it in the material UI (#4725)

* Fix double sided option moving when toggling it in the material UI (case 1328877)

* Updated changelog

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

* Fix formatting

* Fix volumetric fog in planar reflections (#4736)

* Fix planar reflection

* changelog

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

* Fix motion blur compute dispatch size (#4737)

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

* - Updated the recursive rendering documentation (case 1338639). (#4759)

* - Updated the recursive rendering documentation (case 1338639).

* review fixes

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

* Fix issue with OnDemand directional shadow map being corrupted when reflection probe are updated same frame (#4812)

* Don't mark as rendered for reflection probes as we want the cached version to be from main view

* Do the thing just for directional

* Doc update

* changelog

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

* Fix cropping issue with the compositor camera bridge (#4802)

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

* Fix for unused resources in depth of field (#4796)

* Removing the word Radii from exposure settings (#4854)

* Rename in UX

* Update docs

* [HDRP][Path Tracing] Support for shadow mattes (#4745)

* Shadow matte support.

* Updated changelog.

* Only take occluders into account, closer match to raster mode.

* Added test scene.

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

* Revert "[HDRP][Path Tracing] Support for shadow mattes (#4745)"

This reverts commit 85ebbc2.

* Fixed the transparent cutoff not working properly in semi-transparent  and color shadows (case 1340234). (#4756)

* Fixed the transparent cutoff not working properly in semi-transparent and color shadows (case 1340234).

* Update test ref image

Co-authored-by: Remi Chapelain <remi.chapelain@unity3d.com>
Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Use non jittered projection in outline pass (#4836)

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

* [HDRP][Path Tracing] Sky settings now properly taken into account when using recorder (#4856)

* Make sure sky settings are correctly set when recording.

* Updated changelog.

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

* Fix Resolution Issues for Physically Based Depth of Field (#4848)

* Add the necesarry texture coordinate clamping for RTHandle for color pyramid sampling

* Add some resolution independence, fitted for 1920x1080

* Changelog

* Switch back to point sampling from trilinear, with commentary

* Update test reference images

* Small correction to the point sampling, always sample mip 0.

* Re-update the test images, for mip 0 color sampling

* Use a simpler UV scaling/clamping since we are now point sampling.

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

* Fixed bug introduced by sky-for-recorder support. (#4906)

* [Fogbugz 1341576] Memory leaks when the player is paused, and the user changes pipeline… (#4845)

* Memory leaks when the player is paused, and the user changes pipeline settings

* changelog

* [HDRP] Fixed shadergraph double save (#4916)

* Don't need to save twice shadergraph the first time we create a graph

* Updated changelog

* Write 0 instead of micro sized motion vectors + fix extremely fast velocities (#4820)

* Kill micromovements.

* Do same for camera

* Debug view update

* Changelog

* Remove unnecessary comment

* Fix excessive velocity end up marked as no velocity

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

* [HDRP] Fix material upgrader (#4821)

* Fix HDRP material upgrade failing when there is a texture inside the builtin resources assigned in the material

* Updated changelog

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

* [HDRP] Fix custom pass volume not executed in scene view (#4860)

* Fix custom pass volume not executed in scene view because of the volume culling mask

* Updated changelog

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

* Fix reflection probe tootltip (#4890)

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

* Updated the Physically Based Sky documentation for baked lights (#4891)

* Updated the Physically Based Sky documentation for baked lights

* Rewrite

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

* Fixed remapping of depth pyramid debug (#4893)

* Fixed remapping of depth pyramid debug

* Removed debug pragma

* Update changelog

* Updated tooltip

* Fix wobble-like (or tearing-like) SSAO issues when temporal reprojection is enabled. (#4895)

* Fix AO perceived wobble

* changelog

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

* Fix Asymmetric Projection Matrices and Fog / Pathtracing (#4926)

* Check for asymmetric projections and choose the generic path if so.

* Fix asymmetric projections for the pathtracer ray generation.

* Changelog

* Simplify the matrix multiplication for computing the generic matrix.

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

* Revert: Fix wobble-like (or tearing-like) SSAO issues when temporal reprojection…

* Fix GBuffer depth debug mode (#5054)

* Fixed Volume Gizmo size when rescaling parent GameObject (#4915)

* Fix Vertex Color Mode documentation (#4976)

* Fix wobble-like (or tearing-like) SSAO issues when temporal reprojection is enabled.  (#4986)

* Fix AO perceived wobble

* changelog

* Update screenshots

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

* Fix formatting in NestedOverrideCameraRendering

* [HDRP] Fix white flash with SSR when resetting camera history (#5089)

* Fix white flash with SSR when resetting camera history

* Move branch login inside GetPreviousExposureTexture

* Fix for fixed exposure

* [Fobguz # 1348357] VFX Particle templates missing stencil flags (#5080)

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

* Changelog

* Moved the range validation logic into HDAdditionalLightData.OnValidate (Case 1345264)

* Update CHANGELOG.md

* Merge master (#5127)

* 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>

Co-authored-by: Pavlos Mavridis <pavlos.mavridis@unity3d.com>
Co-authored-by: FrancescoC-unity <43168857+FrancescoC-unity@users.noreply.github.com>
Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
Co-authored-by: John Parsaie <johnpa@unity3d.com>
Co-authored-by: anisunity <42026998+anisunity@users.noreply.github.com>
Co-authored-by: Antoine Lelievre <antoinel@unity3d.com>
Co-authored-by: CifaCia <f.cifariellociardi@gmail.com>
Co-authored-by: Adrien de Tocqueville <adrien.tocqueville@unity3d.com>
Co-authored-by: slunity <37302815+slunity@users.noreply.github.com>
Co-authored-by: Remi Chapelain <remi.chapelain@unity3d.com>
Co-authored-by: Emmanuel Turquin <emmanuel@turquin.org>
Co-authored-by: Adrian1066 <44636759+Adrian1066@users.noreply.github.com>
Co-authored-by: Kleber Garcia <kleber.garcia@unity3d.com>
Co-authored-by: Julien Ignace <julien@unity3d.com>
Co-authored-by: Kenny Tan <82013253+kennytann@users.noreply.github.com>
Co-authored-by: Paul Demeulenaere <pauld@unity3d.com>
@PaulDemeulenaere
Copy link
Contributor Author

PaulDemeulenaere commented Jul 28, 2021

There are probably two new fogbugz related to the same issue :

@julienf-unity julienf-unity merged commit 6d9cd99 into master Aug 3, 2021
@julienf-unity julienf-unity deleted the vfx/fix/1345426-crash-with-subgraph branch August 3, 2021 08:23
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.

3 participants