-
Notifications
You must be signed in to change notification settings - Fork 855
Fix terrain grass shader alpha write. #5637
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
Probably additional platform specific updates needed.
Hi! This comment will help you figure out which jobs to run before merging your PR. The suggestions are dynamic based on what files you have changed. URP Depending on the scope of your PR, you may need to run more jobs than what has been suggested. Please speak to your lead or a Graphics SDET (#devs-graphics-automation) if you are unsure. |
… colors and textures.
ENDHLSL | ||
} | ||
|
||
/*Pass |
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 these commented out sections just be removed?
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.
Yes. I will remove those.
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.
I guess there's a chance we will change behavior for someone once they upgrade, but I feel that's better than leaving it broken.
Checklist for PR maker
need-backport-*
label. After you backport the PR, the label changes tobackported-*
.CHANGELOG.md
file.Purpose of this PR
Fix terrain grass shader.
Issue:
035_Shader_TerrainShaders test was unstable and often failed with white grass. Turns out the white was actually transparent black.
The issue was something like this:
Grass shaders had masked alpha writes, this PR removes those.
The issue then is that alpha on the edges of grass blades can make holes (alpha < 1) to a Render Texture target.
So instead alpha mask, the shaders write 1 to alpha always, since the shader isn't doing blending anyway, just discard.
For the 2nd case I added additional test that renders the terrain into a render texture and then that to a quad with another red quad behind that. So if the render texture has any "holes" (i.e. grass overwrote terrain alpha) those will show as red pixels.
Also removed the Shader Lab
AlphaTest
command from the shaders as it is not used on SRPs.Testing status
Ran test locally. Added a new test for Terrain grass in Render Texture.
This will need some additional manual QA for terrain grass.
Comments to reviewers
Notes for the reviewers you have assigned.