-
Notifications
You must be signed in to change notification settings - Fork 855
[2021.2] SSAO: NormalMaps, support for Unlit & Particles plus various improvements #3174
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
Conversation
Removed now unecessary gbuffer option in SSAO renderer feature.
… into universal/ssao-deferred-support
…ked occlusion). Optimisation in SSAO code to calculate view vector in (camera centered) world space. Various bug fixes to pass most test scenes in UniversalGraphicsTest.
…d of the function (mathematically same result).
… instances are used when deferred renderer is enabled). Adjusted internal logic that control allocation of RT in CopyDepthPass to match DepthOnlyPass and DepthNormalsOnlyPass. Added some comments in StencilDeferred.shader.
- in editor mode, the deferred renderer now ignores UniversalRenderPipeline->MixedLighting flag and use mixed lighting shader variants. This matches forward renderer behaviour. - refactored how main directional light is handled vs additional directional lights
…repeatedly bound for rendering and avoid clearing it more than once (some code set depthSlice to -1, some other to 0). Instead, RenderTargetHandle now always set depthSlice to -1 to be consistent with all XR compatible code.
Made normal normalization in fragment shader platform specific (coherent with existing code).
…ot have additional lights enabled. Fixed accurateGbufferNormal shader variants to be stripped on Vulkan devices, as Android Vulkan may need to fallback to accurateGbufferNormals in some situations. Fixed incorrect calculation of render-target size.
Renamed _DEFERRED_ADDITIONAL_LIGHT_SHADOWS into _DEFERRED_LIGHT_SHADOWS as _ADDITIONAL part if irrelevant for deferred renderer.
…fer pass shaders. Do not disable mixed lighting keyword in deferred to match behaviour of ForwardLights.
…cause there is no gbuffer pass for SM2.0 fallback shaders).
…h in ShaderVariablesFunctions.hlsl instead.
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.
Android performance is similar or better with this PR. https://docs.google.com/spreadsheets/d/1BwQxOJXhzk4X6GeSvPqUlbuzKSFYtH_N_oIpxKsvtbg/edit#gid=1452499847&range=A1:D1
iOS will be tested by mobile team.
no regressions found in win/macOS
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 from the terrain side of things. Just a few code cleanup requests
-Brad (I'm a new Graphics engineer hire on the Terrain team)
com.unity.render-pipelines.universal/Shaders/Terrain/TerrainDetailLit.shader
Outdated
Show resolved
Hide resolved
com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitDepthNormalsPass.hlsl
Outdated
Show resolved
Hide resolved
com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitDepthNormalsPass.hlsl
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.
Looks good, no issues found. Ran graphics test projects from UniversalGraphicsTest_Foundation, UniversalGraphicsTest_Terrain, UniversalGraphicsTest_Lighting (Scenes from 200 to 205). Also, ran URP Examples to check that there are no new issues. No visual or functionality issues.
Also there's a slight improvement on iOS performance, tests done by @ernestasKupciunas : https://docs.google.com/spreadsheets/d/149ac28KGkTC3G-AtvwrPVs8v57B_eo0he8FcYT05HmA/edit#gid=0
Devices used: OnePlus Nord, Galaxy Note10 USA, Huawei P20, Huawei P40 lite, iPhone SE.
# Conflicts: # com.unity.render-pipelines.universal/CHANGELOG.md
# Conflicts: # TestProjects/UniversalGraphicsTest_Foundation/Assets/Test/TestFilters/TestCaseFilters.asset
…e latest merge from master.
# Conflicts: # com.unity.render-pipelines.universal/CHANGELOG.md # com.unity.render-pipelines.universal/Shaders/BakedLit.shader
**URP Only Changes** - Add `DepthNormal` on builtin Unlit output - Add Ambient Occlusion on Unlit in URP This is relative to this [change](#3174) landed in _2021.2.0a16_ at 95b83c506a187934af0898d9e5498a08ba231649
Purpose of this PR
This PR introduces various improvements and features to SSAO.
Open issues
Quality of downscaled SSAO improved
Performance
R8
instead ofARGB32
Bugfixes
Main changes
Other changes
Improved test scenes and setup for SSAO
Previous scenes have been removed and new ones have been added.
Removed test scenes
New test scene setup (Tests Projection & Orthographic cameras)
The new scenes now test
QA
What has been tested
What needs testing
Performance Docs
Yamato
https://yamato.cds.internal.unity3d.com/jobs/902-Graphics/tree/universal%252Fssao-normalmaps-and-improvements