-
Notifications
You must be signed in to change notification settings - Fork 855
[VFX] Fix soft particles #4733
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] Fix soft particles #4733
Conversation
# Conflicts: # com.unity.visualeffectgraph/CHANGELOG.md
# Conflicts: # com.unity.visualeffectgraph/CHANGELOG.md
…-graphics/pull/211/commits/8169e083d9b68114bd7a248ebba1dfba38fca3f5 But using URP specific helper "LinearDepthToEyeDepth"
Correctly applying the flip-y when appropriate while sampling
It's simpler than reimplement the space transform and equivalent
com.unity.render-pipelines.universal/Runtime/VFXGraph/Shaders/VFXCommon.hlsl
Outdated
Show resolved
Hide resolved
…VFXCommon.hlsl Fix comment Co-authored-by: Elvar Örn Unnþórsson <ellioman@ellioman.com>
com.unity.render-pipelines.universal/Runtime/VFXGraph/Shaders/VFXCommon.hlsl
Outdated
Show resolved
Hide resolved
Remove VFXLinearEyeDepth & VFXLinearEyeDepthOrthographic from the SRP specific implementation Synchronize implementation for VFXLinearEyeDepth in VFXCommonCompute.hlsl (not used anyway) TODO : Move LinearDepthToEyeDepth in core for 21.2
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.
Looks good to me!
Thank you for shiny tests and detailed description, @PaulDemeulenaere! Tested:
Everything you fixed works like a charm, but observed several issues:
Repro can be found here Is this something that could be fixed in this PR? |
@VitaSkruibyte For the second issue, it's possible that it is fixed in the VFX HDRP Decals PR (at the same time as the sliding artifact was fixed). Edit : It's not fixed in the other PR. |
I have an idea about this issue, forward decal use a simple sampling which require to consider the renderscale while sampling the depth. I will take a look, if it's a simple fix, we could append it to this PR ⏳ |
Update for @VitaSkruibyte
|
I isolated the fix about forward decal here : 5a4cb98 (not included _scale_screen_space_size.mp4In the end, should I integrate this change in this PR @julienf-unity ? |
Heya @PaulDemeulenaere! Thank you for the update! Here's the bug for URP team regarding soft particles |
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.
All PR related issues were fixed, newly found bugs are not PR related and gonna be fixed in following PR, hence approving.
VFX_HDRP on Win_DX11_editmode_mono_Linear is expected to fail 🔴 |
TODO : backport on 21.1, 10.x.x & 7.x.x |
* Update changelog # Conflicts: # com.unity.visualeffectgraph/CHANGELOG.md * Different depth computation for orthographic camera # Conflicts: # com.unity.visualeffectgraph/CHANGELOG.md * Restore change from https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/211/commits/8169e083d9b68114bd7a248ebba1dfba38fca3f5 But using URP specific helper "LinearDepthToEyeDepth" * FIx issue 1330697 Correctly applying the flip-y when appropriate while sampling * Fix scaling using dedicated URP helper It's simpler than reimplement the space transform and equivalent * Update com.unity.render-pipelines.universal/Runtime/VFXGraph/Shaders/VFXCommon.hlsl Fix comment Co-authored-by: Elvar Örn Unnþórsson <ellioman@ellioman.com> * Fix issue #4733 (comment) Remove VFXLinearEyeDepth & VFXLinearEyeDepthOrthographic from the SRP specific implementation Synchronize implementation for VFXLinearEyeDepth in VFXCommonCompute.hlsl (not used anyway) TODO : Move LinearDepthToEyeDepth in core for 21.2 Co-authored-by: Ludovic Theobald <ludovic.theobald@unity3d.com> Co-authored-by: Elvar Örn Unnþórsson <ellioman@ellioman.com> # Conflicts: # com.unity.render-pipelines.universal/CHANGELOG.md # com.unity.render-pipelines.universal/Runtime/VFXGraph/Shaders/VFXCommon.hlsl # com.unity.visualeffectgraph/CHANGELOG.md
commit 73b6768 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Fri Aug 27 09:55:58 2021 +0200 Fix changelog.md commit 129edd3 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Fri Aug 27 09:50:59 2021 +0200 Fix after merge Apply VFXSampleDepth for URP on the correct file commit a29197d Author: Paul Demeulenaere <pauld@unity3d.com> Date: Mon Jul 5 14:05:45 2021 +0200 [VFX] Fix soft particles (#4733) * Update changelog # Conflicts: # com.unity.visualeffectgraph/CHANGELOG.md * Different depth computation for orthographic camera # Conflicts: # com.unity.visualeffectgraph/CHANGELOG.md * Restore change from https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/211/commits/8169e083d9b68114bd7a248ebba1dfba38fca3f5 But using URP specific helper "LinearDepthToEyeDepth" * FIx issue 1330697 Correctly applying the flip-y when appropriate while sampling * Fix scaling using dedicated URP helper It's simpler than reimplement the space transform and equivalent * Update com.unity.render-pipelines.universal/Runtime/VFXGraph/Shaders/VFXCommon.hlsl Fix comment Co-authored-by: Elvar Örn Unnþórsson <ellioman@ellioman.com> * Fix issue #4733 (comment) Remove VFXLinearEyeDepth & VFXLinearEyeDepthOrthographic from the SRP specific implementation Synchronize implementation for VFXLinearEyeDepth in VFXCommonCompute.hlsl (not used anyway) TODO : Move LinearDepthToEyeDepth in core for 21.2 Co-authored-by: Ludovic Theobald <ludovic.theobald@unity3d.com> Co-authored-by: Elvar Örn Unnþórsson <ellioman@ellioman.com> # Conflicts: # com.unity.render-pipelines.universal/CHANGELOG.md # com.unity.render-pipelines.universal/Runtime/VFXGraph/Shaders/VFXCommon.hlsl # com.unity.visualeffectgraph/CHANGELOG.md (cherry picked from commit b38a9eb72b46d39f1f1cb052a85fffb1f7142380) # Conflicts: # com.unity.render-pipelines.universal/CHANGELOG.md # com.unity.visualeffectgraph/CHANGELOG.md
* Squashed commit of the following: commit 73b6768 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Fri Aug 27 09:55:58 2021 +0200 Fix changelog.md commit 129edd3 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Fri Aug 27 09:50:59 2021 +0200 Fix after merge Apply VFXSampleDepth for URP on the correct file commit a29197d Author: Paul Demeulenaere <pauld@unity3d.com> Date: Mon Jul 5 14:05:45 2021 +0200 [VFX] Fix soft particles (#4733) * Update changelog # Conflicts: # com.unity.visualeffectgraph/CHANGELOG.md * Different depth computation for orthographic camera # Conflicts: # com.unity.visualeffectgraph/CHANGELOG.md * Restore change from https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/211/commits/8169e083d9b68114bd7a248ebba1dfba38fca3f5 But using URP specific helper "LinearDepthToEyeDepth" * FIx issue 1330697 Correctly applying the flip-y when appropriate while sampling * Fix scaling using dedicated URP helper It's simpler than reimplement the space transform and equivalent * Update com.unity.render-pipelines.universal/Runtime/VFXGraph/Shaders/VFXCommon.hlsl Fix comment Co-authored-by: Elvar Örn Unnþórsson <ellioman@ellioman.com> * Fix issue #4733 (comment) Remove VFXLinearEyeDepth & VFXLinearEyeDepthOrthographic from the SRP specific implementation Synchronize implementation for VFXLinearEyeDepth in VFXCommonCompute.hlsl (not used anyway) TODO : Move LinearDepthToEyeDepth in core for 21.2 Co-authored-by: Ludovic Theobald <ludovic.theobald@unity3d.com> Co-authored-by: Elvar Örn Unnþórsson <ellioman@ellioman.com> # Conflicts: # com.unity.render-pipelines.universal/CHANGELOG.md # com.unity.render-pipelines.universal/Runtime/VFXGraph/Shaders/VFXCommon.hlsl # com.unity.visualeffectgraph/CHANGELOG.md (cherry picked from commit b38a9eb72b46d39f1f1cb052a85fffb1f7142380) # Conflicts: # com.unity.render-pipelines.universal/CHANGELOG.md # com.unity.visualeffectgraph/CHANGELOG.md * Fix changelog.md Co-authored-by: Felipe Lira <felipedrl@gmail.com>
* [VFX] Fix soft particles (#4733) * Update changelog # Conflicts: # com.unity.visualeffectgraph/CHANGELOG.md * Different depth computation for orthographic camera # Conflicts: # com.unity.visualeffectgraph/CHANGELOG.md * Restore change from https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/211/commits/8169e083d9b68114bd7a248ebba1dfba38fca3f5 But using URP specific helper "LinearDepthToEyeDepth" * FIx issue 1330697 Correctly applying the flip-y when appropriate while sampling * Fix scaling using dedicated URP helper It's simpler than reimplement the space transform and equivalent * Update com.unity.render-pipelines.universal/Runtime/VFXGraph/Shaders/VFXCommon.hlsl Fix comment Co-authored-by: Elvar Örn Unnþórsson <ellioman@ellioman.com> * Fix issue #4733 (comment) Remove VFXLinearEyeDepth & VFXLinearEyeDepthOrthographic from the SRP specific implementation Synchronize implementation for VFXLinearEyeDepth in VFXCommonCompute.hlsl (not used anyway) TODO : Move LinearDepthToEyeDepth in core for 21.2 Co-authored-by: Ludovic Theobald <ludovic.theobald@unity3d.com> Co-authored-by: Elvar Örn Unnþórsson <ellioman@ellioman.com> # Conflicts: # com.unity.render-pipelines.universal/CHANGELOG.md # com.unity.render-pipelines.universal/Runtime/VFXGraph/Shaders/VFXCommon.hlsl # com.unity.visualeffectgraph/CHANGELOG.md * Fix after merge Apply VFXSampleDepth for URP on the correct file * Fix changelog.md
Purpose of this PR
TLDR, it fixes two fogbugz :
More details :
GetNormalizedScreenSpaceUV
. The issue occurs when there isn't an HDR or Opaque texture as intermediate texture (reverse_z
Load
toSample
Testing status
1) Orthographic Depth

Before
After : Fix Orthographic Depth Sampling

Also an equivalent test from Ludovic :

2) Missing Y-Flip

Before
After

3) Fallback when there isn't a depth texture

Before DX11 (no issue actually)
Before OGL (on the left Shuriken, on the right VFX)

After

4) Screen scale

Before
After

Comments to reviewers
This change will require a manual backport in 10.x.x & 7.x.x
See also this PR : https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/211