Azure / azure-remote-rendering

SDK and samples for Azure Remote Rendering
MIT License
106 stars 38 forks source link

[Remote rendering problem] Main camera matrix is not reset after disconnecting from a session in Local or Passthrough pose modes #90

Closed robbbbbb closed 1 year ago

robbbbbb commented 1 year ago

Describe the problem

When disconnecting from a desktop remote rendering session that is using PoseMode.Local or PoseMode.Passthrough, the Unity main camera view matrix will remain frozen despite updates to the camera transform itself.

Provide additional information

This can be repro'd in the showcase app by the following steps:

This is caused by code in the ARR package in Microsoft.Azure.RemoteRendering.Unity.RemoteManagerUnity. In the UpdateLocal() function the code is setting Camera.worldToCameraMatrix every frame, which is correct, however if you ever set this explicitly you need to then call Camera.ResetWorldToCameraMatrix() as per the docs. Since this never gets called, as soon as the UpdateLocal() function stops being called, the camera matrix just freezes, giving the results described.

We've fixed this in our local version of the package by adding the call to ResetWorldToCameraMatrix() to RemoteManagerUnity.OnConnectionStatusChanged() which seems to be the place where other main camera properties are being returned to correct defaults.

jumeder commented 1 year ago

Hi @robbbbbb, thanks for your report and your fix suggestion. I can confirm we're able to reproduce this issue. I'll update you as soon as we have updated the client sdk!

jumeder commented 1 year ago

Hi again @robbbbbb! I'm happy to report we fixed the issue in the current release 1.1.32.