Skip to content

Conversation

sebastienlagarde
Copy link
Contributor

@sebastienlagarde sebastienlagarde commented Jan 18, 2021

…abled

Purpose of this PR

This PR fix a wrong behavior when shadow matte is use with Ambient Occlusion and MSAA is enabled.
In this case the code was not outputting any data for the shadow matte material in the normal buffer and thus out put was wrong.

Root cause of the issue is the ColorMask [_ColorMaskNormal] directive in unlit.shader which seems to not work when set from a cmd.SetGlobalInt() call. The value never change.
However after code inspection it appear that all this masking for color buffer is useless as the shader pass code already output only what is used, and with unlit shader normal buffer are always the last one (as unlit don't have decal and depth msaa and motion vector are render first), so all work fine by simply removing the code (Which could be due to a recent clean of order of all this for decal layer).

Also even if it is a very unsusual use case, this PR also fix the same issue if the shadow matte have motion vector.


Testing status

Tested the Shadow matte ambient occlusion test with and without MSAA.
Added a MSAA test for shadow matte with ambient occlusion. It is enough coverage.

Get same result with or without MSAA on existing test

image


Comments to reviewers

Notes for the reviewers you have assigned.

@github-actions
Copy link

It appears that you made a non-draft PR!
Please convert your PR to draft (button on the right side of the page)
and cancel any jobs that started on Yamato.
See the PR template for more information.
Thank you!

@sebastienlagarde sebastienlagarde merged commit be8f685 into hd/bugfix Jan 18, 2021
@sebastienlagarde sebastienlagarde deleted the HDRP/fix-shadow-matte-normal-msaa branch January 18, 2021 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants