-
Notifications
You must be signed in to change notification settings - Fork 851
Fix issue 1354395 where the right eye was shifted in stereo mode #5789
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
994895e
to
45a9946
Compare
I'm missing changelog.md modification |
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.
In general, for a bug fix PR, there's no need to fix all failed automated tests that happen in master branch. For a PR to pass QA, one only needs to prove that the same test failure also occurs in master branch. This also isolates the PR bug fix changes from automated test changes so QA will know one isn't biasing the tests in favor of the PR.
Thus, all automated test changes should be reverted from this PR.
com.unity.postprocessing/PostProcessing/Runtime/PostProcessLayer.cs
Outdated
Show resolved
Hide resolved
few things to note with the latest code push: physical camera fix also didn't really care this guy used our if statement to hook his code but has nothing to do with TAA more info https://docs.google.com/document/d/1u0esuZNxBT_2D-X99M5wLY42zAt-QarMr1LocZaKVJI/edit?usp=sharing |
I'll let @mikesfbay and @daves-unity review this PR as this code is unfamiliar to me and I don't know the ramifications of this change. |
@JasonCostanza Can you help with testing to see if this fogbugz case is fixed for multipass, and there's no regressions with other postfx effects during stereo instancing? |
Attempting to test this using the original repro project, i've opened it in 21.2 and I'm missing namespaces:
Can you advise on how to fix these errors so I can test using your PR branch of SRP (13.0)? |
4d44e76
to
18dbd2e
Compare
Updating: I do get this error in master however as well, so, though I cannot review this PR it is not blocked BY this PR either. |
Update again: |
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.
2022.1.0a12.1604
Revision: trunk 816252c3efbb
Built: Wed, 06 Oct 2021 17:58:29 GMT
commit 18dbd2e87c90b4106a990fbe222805a6bf6c717e (HEAD, origin/xr/graphics/fix-camera-shift-taa)
WMR:
Reviewed the PR using a WMR HMD in play mode and following the steps in the original bug steps. No change in right eye was observed toggling the post processing layer as described in the bug.
Mock HMD:
Did the same test on Mock just to be double-sure things looked good as described in the bug
@@ -33,6 +33,12 @@ public Camera camera | |||
stereoRenderingMode = StereoRenderingMode.SinglePass; | |||
numberOfEyes = 1; | |||
|
|||
if (XRSettings.stereoRenderingMode == XRSettings.StereoRenderingMode.SinglePassMultiview) | |||
{ | |||
stereoRenderingMode = StereoRenderingMode.SinglePassMultiview; |
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.
As discussed in your previous multiview PR, we don't support multiview feature for PPv2 and it currently doesn't work due to engine not providing input texture correctly (see[ discussion link](URL #5917 (comment))).
Thus, please remove all instances of multiview from this PR.
@@ -973,7 +1001,7 @@ public void Render(PostProcessRenderContext context) | |||
context.GetScreenSpaceTemporaryRT(cmd, lastTarget, 0, context.sourceFormat); | |||
if (context.stereoActive && context.numberOfEyes > 1) | |||
{ | |||
if (context.stereoRenderingMode == PostProcessRenderContext.StereoRenderingMode.SinglePassInstanced) | |||
if (context.stereoRenderingMode == PostProcessRenderContext.StereoRenderingMode.SinglePassInstanced || context.stereoRenderingMode == PostProcessRenderContext.StereoRenderingMode.SinglePassMultiview) |
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.
Please revert this line, see discussion ( #5917 (comment))
@@ -1334,7 +1362,7 @@ void RenderFinalPass(PostProcessRenderContext context, int releaseTargetAfterUse | |||
dithering.Render(context); | |||
|
|||
ApplyFlip(context, uberSheet.properties); | |||
if (context.stereoActive && context.stereoRenderingMode == PostProcessRenderContext.StereoRenderingMode.SinglePassInstanced) | |||
if (context.stereoActive && (context.stereoRenderingMode == PostProcessRenderContext.StereoRenderingMode.SinglePassInstanced || context.stereoRenderingMode == PostProcessRenderContext.StereoRenderingMode.SinglePassMultiview)) |
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.
Same here, please revert this line, see discussion ( #5917 (comment))
the stereo rendering mode single pass multiview was simply not handled as a case. It is meant to be quite similar to the single pass instance that renders to the texture array so this change just adds the single pass multivew check wherever we were checking for SPI and this seems to fix the problem of the missing eye.
18dbd2e
to
99e7cfc
Compare
Please read the Contributing guide before making a PR.
Checklist for PR maker
need-backport-*
label. After you backport the PR, the label changes tobackported-*
.CHANGELOG.md
file.Purpose of this PR
This commit Unity-Technologies/PostProcessing@08b1319 forced a reset on the projection matrix in PreCull and PostRender to avoid issues when switching on/off the TAA.
This is fine except that it doesn't reset the projection matrix to the device's projection matrix which seems to trickle down somewhere and result in some systems getting the wrong projection matrix.
This fix consist in forcing the device's projection matrix onto the camera to make sure that everyone is using the correct matrix if we happen to be in stereo.
PostRender doesn't need to copy from device because the Render step of the TAA PostProcessLayer performs that action.
PostRender doesn't need to deal with unjittered because that's probably only used in TAA.
Testing status
2020.3.11f1, 2019.4.30f1
https://unity-ci.cds.internal.unity3d.com/job/9147944
https://unity-ci.cds.internal.unity3d.com/job/9147930
Comments to reviewers
Notes for the reviewers you have assigned.