Skip to content

Fix error when using gizmos with camera stack in editor #5913

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

Merged
merged 5 commits into from
Oct 12, 2021

Conversation

tomzig16
Copy link
Contributor

@tomzig16 tomzig16 commented Oct 5, 2021

Purpose of this PR

This PR fixes: https://fogbugz.unity3d.com/f/cases/1347472/
Previously there was an assert that was used as camera stack was not implemented, but now it works with it. When PR was made to change the if statement, assertion was forgotten hence it causes the regression. After removing it everything works correctly.


Testing status

Tested locally + automated ABV tests


Comments to reviewers

Although bug report tells that it is not a regression, we found that the issue appeared indirectly after the changes made in #4034
I will check for a need of backports as this issue was introduced through a different change.

@tomzig16 tomzig16 requested a review from phi-lira October 5, 2021 13:04
@tomzig16 tomzig16 requested review from a team as code owners October 5, 2021 13:04
@github-actions
Copy link

github-actions bot commented Oct 5, 2021

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.
Link to Yamato: https://unity-ci.cds.internal.unity3d.com/project/902/
Search for your PR branch using the search bar at the top, then add the following segment(s) to the end of the URL (you may need multiple tabs depending on how many packages you change)

URP
/jobDefinition/.yamato%252Fall-urp.yml%2523PR_URP_trunk
With changes to URP packages, you should also run
/jobDefinition/.yamato%252Fall-lightmapper.yml%2523PR_LightMapper_trunk

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.

@github-actions
Copy link

github-actions bot commented Oct 5, 2021

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

@tomzig16 tomzig16 marked this pull request as draft October 6, 2021 08:27
@tomzig16
Copy link
Contributor Author

tomzig16 commented Oct 6, 2021

Not sure, but it seems like this PR breaks PostPro tests, looking into it.
Nevermind, its unrelated to the failures - newer master fixes that. Moreover, previously ran test had succeeded the whole urp post pro suite.

@tomzig16 tomzig16 marked this pull request as ready for review October 6, 2021 12:05
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@phi-lira phi-lira changed the base branch from master to universal/staging October 12, 2021 09:50
@phi-lira phi-lira merged commit 7ee108d into universal/staging Oct 12, 2021
@phi-lira phi-lira deleted the urp/editor/fix-gizmos-with-camera-stack branch October 12, 2021 09:50
phi-lira pushed a commit that referenced this pull request Oct 12, 2021
* Fix game window gizmos when camera stack is used

* Remove Assert check for the last camera in stack

* Add lastCameraInStack check
@phi-lira phi-lira mentioned this pull request Oct 12, 2021
@phi-lira phi-lira restored the urp/editor/fix-gizmos-with-camera-stack branch October 18, 2021 15:13
@phi-lira phi-lira deleted the urp/editor/fix-gizmos-with-camera-stack branch October 18, 2021 15:20
phi-lira added a commit that referenced this pull request Oct 18, 2021
commit e68a78e
Merge: 6e8d51c d1a6ea2
Author: tomzig16 <tzigmantavicius@gmail.com>
Date:   Wed Oct 6 11:35:23 2021 +0300

    Merge branch 'master' into urp/editor/fix-gizmos-with-camera-stack

commit 6e8d51c
Author: tomzig16 <tzigmantavicius@gmail.com>
Date:   Tue Oct 5 19:13:06 2021 +0300

    Add lastCameraInStack check

commit 055c1a0
Author: tomzig16 <tzigmantavicius@gmail.com>
Date:   Tue Oct 5 15:58:56 2021 +0300

    Remove Assert check for the last camera in stack

commit 1d0c961
Merge: 36372be 3fbbcd8
Author: tomzig16 <tzigmantavicius@gmail.com>
Date:   Tue Oct 5 15:47:30 2021 +0300

    Merge branch 'master' into urp/editor/fix-gizmos-with-camera-stack

commit 36372be
Author: tomzig16 <tzigmantavicius@gmail.com>
Date:   Thu Sep 9 18:42:48 2021 +0300

    Fix game window gizmos when camera stack is used
@phi-lira phi-lira mentioned this pull request Oct 18, 2021
odbb added a commit that referenced this pull request Oct 19, 2021
* master:
  Enable iris normal for Eye shader (#5880)
  Update to HDRP Asset analytics (#6060)
  [HDPR] Update reference screenshots for Linux Vulkan
  Update 206_Motion_Vectors.png (#6046)
  Updated code owner for URP (#6052)
  [URP] Re-enable ios pbr tests #5983
  Fix error when using gizmos with camera stack in editor #5913
  emitting UI geometry for offscreen cameras too (case 1344969 fix) #5894
  Remove deprecated UNITY_USE_NATIVE_HDR keyword from shader code. #5569
  [XR][URP] Fix issue with vignette location in XR #5471 #5471
ellioman added a commit that referenced this pull request Jan 10, 2022
* Fix for specular color plus a first draft of a test scene for it

* Minor color updates

* Test updated

* Adding Directional Light

* Adding the new test scene to build settings

* Reference Images

* Redoing the specular bugfix after various changes happened on Master

* Adding a Deferred Test Scene

* Fixing Specular on Deferred and adding a test scene for it as well

* Same fix but in ShaderGraph shaders

* Filtering out the 011 deferred scene for Android Vulkan (Issue: 1340634) and updating three reference images

* D3D11 updated reference image.

* Set a valid stencil format when creating depthStencil render-target.

* D3D12 reference image

* D3D11 reference image

* DX11 Deferred Reference image

* Removing a scene from the testcase filters as the issue has been resolved

* Changelog

* [XR][URP] Fix issue with vignette location in XR (#5471)

* [XR][URP] Fix issue with vignette location in XR

Vignette center needs to respect the real view center since in XR, with asymmetric FOV, the center of the render taget is not always the center of the view. We deduce the real center via the projection matrix data and use that to offset the vignette's center.

* Updated changelog

* Extracted comon XRView code into ComputeEyeCenterUV & Allow more than 2 XR views

* Fix vignette movement direction for XR when whe change the vignette "center" parameter

* Returning to 2 views only for XR vignette.

This will keep the shader as simple as possible, if we need to support more views in the future, we can restore this code

* Use "Vector4.zero" instead of "new Vector4(0.0f, 0.0f, 0.0f, 0.0f)"

* Only set v3 if we are using single pass

That variable is only needed if single-pass instancing/multiview is active, so we can simplify the code to only do the asymetric FOV correction when we are in multi-pass mode.

* More improvements

- Renamed _Vignette_Params3 to _Vignette_ParamsXR
- Moved all single-pass XR values in _Vignette_ParamsXR
- Extracted code to correct eye center to XRPass class

* Adding a comment to describe what ApplyXRViewCenterOffset does

* Quick fix a comment that is not right anymore after moving the code

* Remove deprecated UNITY_USE_NATIVE_HDR keyword from shader code. (#5569)

* Fix error when using gizmos with camera stack in editor (#5913)

* Fix game window gizmos when camera stack is used

* Remove Assert check for the last camera in stack

* Add lastCameraInStack check

* Updating WindowsEditor DX11 reference image

* Updating Android Vulkan & iOS Metal reference images. Upping the threshold a tiny bit.

* Trying a new reference image for WinPlayer DX11 & DX12

* Disabling XR capability for the new test as it breaks due to the Development Build label.

* Updating reference images for VFX due to the changes done with my fix.

* Changelog

* Updating materials

* Updating reference images for VFX OSX Editor on Metal

Co-authored-by: Andrem <andrem@unity3d.com>
Co-authored-by: Kay Chang <kaychang@unity3d.com>
Co-authored-by: Marc-Andre Loyer <82059196+maloyer-unity@users.noreply.github.com>
Co-authored-by: Pema Malling <pema99@users.noreply.github.com>
Co-authored-by: Tomas Zigmantavičius <30701728+tomzig16@users.noreply.github.com>
Co-authored-by: Felipe Lira <felipedrl@gmail.com>
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.

3 participants