XRLayout.cs 696 B

1234567891011121314151617181920212223242526
  1. // Helper API to create custom XR layout
  2. #if ENABLE_VR && ENABLE_XR_MODULE
  3. namespace UnityEngine.Rendering.Universal
  4. {
  5. internal struct XRLayout
  6. {
  7. internal Camera camera;
  8. internal XRSystem xrSystem;
  9. internal XRPass CreatePass(XRPassCreateInfo passCreateInfo)
  10. {
  11. XRPass pass = XRPass.Create(passCreateInfo);
  12. xrSystem.AddPassToFrame(pass);
  13. return pass;
  14. }
  15. internal void AddViewToPass(XRViewCreateInfo viewCreateInfo, XRPass pass)
  16. {
  17. pass.AddView(viewCreateInfo.projMatrix, viewCreateInfo.viewMatrix, viewCreateInfo.viewport, viewCreateInfo.textureArraySlice);
  18. }
  19. }
  20. }
  21. #endif