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] Adding _SURFACE_TYPE_TRANSPARENT keyword to URP and URP ShaderGraph shaders #4025
Conversation
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.
LGTM. Missing changelog.
com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalTarget.cs
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.
the issue is fixed. verified on Windows (DX11, DX12, Vulkan, OpenGLCore)
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.
if (material.HasProperty(propertyID)) | ||
{ | ||
float surfaceType = material.GetFloat(propertyID); | ||
if (surfaceType >= 1.0f) |
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.
Should this be an enum instead of 1? If it's enable/disable i.e. 1/0 case, then I'd probably test against 0.
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, the issue is fixed. Ran on OnePlus Nord, Galaxy Note10, Huawei P20 and p40 Lite, iPhone SE.
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.
LGTM
# Conflicts: # com.unity.render-pipelines.universal/CHANGELOG.md
Purpose of this PR
Currently we have a bug in SSAO where it being applied to transparent objects.
In order to fix that I've added a new keyword (
_SURFACE_TYPE_TRANSPARENT
) to URP shaders. This is identical to the Keyword HDRP uses. A Material Upgrader was also added to properly set the keyword on materials.Example of the bug
Original scene
Same Scene with a opaque plane above it
Same Scene with a transparent plane (alpha = 1.0) above it
Testing
What has been tested
What needs testing
Automated testing
Yamato
-> when I take the PR out of draft mode