Documentation is in the works. In the mean time, the things you need to do are:
Enable it in the OpenXR settings (use SRP Foveation and check the requisite Feature Groups).
Assign a value between 0 and 1 to XRDisplaySubsystem.foveatedRenderingLevel. (0 is off, 1 is full strength)
I’ve attached an example script. You can drop it on a GameObject and assign a binding to its InputAction. The action lets you toggle foveation on and off.
Thanks a lot Charles. I was able to make this work with Unity 6000.1.4f1 when doing a native Quest build. This is great!
However, some or our use cases are PCVR (using Quest Link or Vive Business Streaming). Unfortunately, in both cases, I get “SystemInfo.foveatedRenderingCaps = None” which seems to indicate that both Meta and HTC’s PCVR OpenXR runtimes don’t support Foveation via OpenXR. Correct? If so, any insight in to whether or not they might support it in the near future?
It works on PCVR with the DX12 (not 11) or Vulkan graphics API. You also need a newer GPU, RTX2000+ or AMD RX6000+. I’m not sure about Vive Business Streaming, since their OpenXR runtime must also support it, but I have tested it on the Meta platform. You should see that the rendering caps aren’t “none” if all the requirements are met.
Only Nvidia supports foveated rendering on DX11 and I’m told it would require a custom render pipeline configuration (but that’s not really an area where I have much knowledge). If possible you should report any DX12 issues, especially if you have a project that reproduces the issues. We are actively working on DX12 improvements.
You can also provide feedback and feature requests on the XR roadmap. These go to Unity’s XR product team, so they will see them, though we can’t promise to act upon everything, of course.
thanks, but I don’t think that “fixing DX12 for VR” should be a roadmap item…
BTW: OpenXR package 1.11.0 does not work with DX11 at all, it’s resulting into a crash (reported now two times, as QA does not seem able to setup an XR project by themselves).
Are you only using DX12 for development now? Don’t you test on DX11 anymore?
I’d rather like DX12 to be fixed / brought up to par with DX11 tbh.
For DX11 I made two tickets, second one with a repro project IN-77943 (which is just sample scene with XR enabled, crashes on exiting play mode every time).
I found the reason for crashes: I am running OpenXR toolkit as a performance measuring tool. Never had any issues with it till Unity OpenXR 1.11.0 update. Crash only happens with DX11 and OpenXR toolkit companion running.
As this is the only reliable performance measuring tool for OpenXR that I know of (and probably the most widespread) this is a bit of a bummer.
Hmm, I’m not able to see any difference in the output image or the performance when turning it on in HDRP.
I see that system info says foveatedRenderingCaps is “FoveationImage”
How to confirm that it’s actually doing anything? The GPU time in profiler is the same, even the sub-items are the same. (DX12)