-
Notifications
You must be signed in to change notification settings - Fork 855
[2021.2] Particle Shaders: Adding Depth & Depth Normals passes #3141
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
[2021.2] Particle Shaders: Adding Depth & Depth Normals passes #3141
Conversation
com.unity.render-pipelines.universal/Shaders/Particles/ParticlesDepthNormalsPass.hlsl
Outdated
Show resolved
Hide resolved
com.unity.render-pipelines.universal/Shaders/Particles/ParticlesDepthNormalsPass.hlsl
Outdated
Show resolved
Hide resolved
com.unity.render-pipelines.universal/Shaders/Particles/ParticlesDepthOnlyPass.hlsl
Outdated
Show resolved
Hide resolved
com.unity.render-pipelines.universal/Shaders/Particles/ParticlesSimpleLitInput.hlsl
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! Suggested a couple of optimizations to remove some ALU+interpolators in some cases. Plus i suspect _BumpScale could be added properly in a future PR.
@richardkettlewell Good points! I've added those checks to avoid unnecessary interpolators. |
Nice, looks good! |
com.unity.render-pipelines.universal/Shaders/Particles/ParticlesUnlit.shader
Outdated
Show resolved
Hide resolved
# Conflicts: # com.unity.render-pipelines.universal/CHANGELOG.md
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.
Tested Particle rendering into Depth texture and Depth Normals; tested on OSX, iOS and Android - no issues found.
# Conflicts: # com.unity.render-pipelines.universal/CHANGELOG.md
Purpose of this PR
Particles currently do not contribute to Depth or DepthNormal textures. This causes an issue with SSAO when the
After Opaque
option is enabled as it makes them look transparent.This PR adds Depth and DepthNormals passes to particle shaders. I had to add a
#define _BumpScale 1.0
to the input hlsl files for simplelit and unlit in order to be able to callSampleNormalTS(...)
using the same fragment shader for all particles.A test scene will be added to the URP Graphics Test project in a followup PR.
QA
What has been tested
What needs testing
Yamato
https://yamato.cds.internal.unity3d.com/jobs/902-Graphics/tree/universal%252Ffeature%252Fparticles-depth-and-normals