-
Notifications
You must be signed in to change notification settings - Fork 840
Fix blend modes and separate preserve specular #1848
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
This reverts commit df48573.
Fix materials in URP test cases. Fix some shader issues.
# Conflicts: # com.unity.render-pipelines.universal/Shaders/Unlit.shader
Assigning @ellioman instead of me as reviewer as I have too many PRs under review atm. |
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.
Seeing keyword changes but no material upgrader is worrying, a material upgrader will be nessesay here, to also add and set values for the new blend properties for alpha.
A material upgrader is a must.
@@ -145,6 +149,7 @@ public virtual void FindProperties(MaterialProperty[] properties) | |||
{ | |||
surfaceTypeProp = FindProperty("_Surface", properties); | |||
blendModeProp = FindProperty("_Blend", properties); | |||
preserveSpecProp = FindProperty("_PreserveSpecular", properties, false); // TODO: should be mandatory? |
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.
Create a discussion about this so we're not leaving a TODO for something that can be decided before this PR lands. :)
@@ -151,7 +157,7 @@ Shader "Universal Render Pipeline/Baked Lit" | |||
alpha = OutputAlpha(alpha, _Surface); | |||
|
|||
return half4(color, alpha); | |||
} | |||
}*/ |
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.
Delete.
@@ -393,7 +402,7 @@ Shader "Universal Render Pipeline/Baked Lit" | |||
alpha = OutputAlpha(alpha, _Surface); | |||
|
|||
return half4(color, alpha); | |||
} | |||
}*/ |
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.
Delete
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.
NOT APPROVED:
"URP/Unlit" Shader does not compile on my machine after upgrading materials. For more info see the attached test doc
Version: 2021.1.0a1.495
Revision: trunk eff81b68729d
Built: Wed, 07 Oct 2020 11:32:35 GMT
Test Doc:
https://docs.google.com/document/d/1tBreRBnfM6R4cNIWqZS-ixZbO_u_FKHo29nFuNO-Dlw/edit?usp=sharing
Since tomorrow will be my last day at Unity, I re-added @Unity-Technologies/gfx-qa-foundation |
# Conflicts: # com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalTarget.cs # com.unity.render-pipelines.universal/Shaders/BakedLit.shader
Talked to Erik. PR is not ready yet. Please add "gfx-qa-foundation" tag as reviewer again when this is ready for testing again. |
# Conflicts: # com.unity.render-pipelines.universal/Editor/ShaderGUI/BaseShaderGUI.cs # com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalTarget.cs # com.unity.render-pipelines.universal/Editor/ShaderGraph/UniversalFields.cs
# Conflicts: # com.unity.render-pipelines.universal/Editor/ShaderGUI/BaseShaderGUI.cs # com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalLitSubTarget.cs # com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalTarget.cs # com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalUnlitSubTarget.cs # com.unity.render-pipelines.universal/Editor/ShaderGraph/Templates.meta
Stale. Ended up redoing the change. Link to PR in desc. Closing. |
See: #5762
Checklist for PR maker
need-backport-*
label. After you backport the PR, the label changes tobackported-*
.CHANGELOG.md
file.Purpose of this PR
Fix bug case 1260085 (use straight premultiply blend mode)
Separate preserve specular feature from premultiplied blend. Preserve specular is default.
Define URP blends more explicitly (match HDRP) by setting alpha channel blend too and allow pure blend modes.
Added a blend test case.
Added alpha effect to multiply by lerping to white.
Refactored BakedLit and Unlit implementation shader into their own .hlsl files.
Moved universal shader graph template to universal side.
Testing status
Manual Tests: What did you do?
Added a new test case for blending:
https://github.com/Unity-Technologies/Graphics/blob/8f876cb7beaf56f3ff603e52eb89879e04be39d2/TestProjects/UniversalGraphicsTest/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/066_Blending.png
Automated Tests: What did you setup? (Add a screenshot or the reference image of the test please)
Yamato: (Select your branch):
https://yamato.prd.cds.internal.unity3d.com/jobs/902-Graphics
Any test projects to go with this to help reviewers?
Comments to reviewers