Azure / azure-remote-rendering

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

[Remote rendering problem] Linear Color Space causes remotely rendered image to flip vertically #77

Closed WikkidEdd closed 2 years ago

WikkidEdd commented 2 years ago

We noticed that one of our latest builds was rendering remotely rendered content upside. Rolling back through our changes we narrowed it down to when we changed the project setting Color Space to Linear.

It seems like a strange thing to cause the rendering to flip and I can see that the documentation actually says to have the color space set to Linear anyway.

I'm going to start digging into it, but thought I'd check to see if something you've come across before?

Unity 2020.3.19 ARR 1.0.54 URP 10.6

ChristopherManthei commented 2 years ago

Hi @WikkidEdd ,

Are you using OpenXR or WMR XR plugin? Note that the WMR plugin for HoloLens2 has never supported linear color space in Unity so enabling it creates washed out colors on the device. URP tried to work around this by rendering into an offscreen render target and doing the color space conversion manually. This causes the image to be upside-down and causes a major performance hit that makes it unusable. If you are using the OpenXR plugin, both gamma and linear space should work without any performance problems. I'll look into updating the documentation accordingly.

Cheers, Christopher

WikkidEdd commented 2 years ago

Ah great, that's saved me some time. Yes, we're still on WMR XR Plugin and are using URP, we've been waiting on some fixing to OpenXR which have just been released this week so we should be switching over soon.

We only switched to Linear because Quest passthrough requires it, but annoyingly that option gets set for all platforms. I think we should be able to just switch it on as part of a build pipeline before we upgrade to OpenXR.

To be fair the documentation that mentions switching to Linear is part of a bigger tutorial which includes using OpenXR. https://docs.microsoft.com/en-us/azure/remote-rendering/tutorials/unity/view-remote-models/view-remote-models

Thanks for your help