Нема описа
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

UniversalRenderPipelineRuntimeXRResources.cs 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #if ENABLE_VR && ENABLE_XR_MODULE
  2. using System;
  3. namespace UnityEngine.Rendering.Universal
  4. {
  5. /// <summary>
  6. /// Class containing shader resources needed in URP for XR.
  7. /// </summary>
  8. /// <seealso cref="Shader"/>
  9. [Serializable]
  10. [SupportedOnRenderPipeline(typeof(UniversalRenderPipelineAsset))]
  11. [Categorization.CategoryInfo(Name = "R: Runtime XR", Order = 1000), HideInInspector]
  12. public class UniversalRenderPipelineRuntimeXRResources : IRenderPipelineResources
  13. {
  14. /// <summary>
  15. /// Version of the XR Resources
  16. /// </summary>
  17. public int version => 0;
  18. bool IRenderPipelineGraphicsSettings.isAvailableInPlayerBuild => true;
  19. [SerializeField]
  20. [ResourcePath("Shaders/XR/XROcclusionMesh.shader")]
  21. private Shader m_xrOcclusionMeshPS;
  22. /// <summary>
  23. /// XR Occlusion mesh shader.
  24. /// </summary>
  25. public Shader xrOcclusionMeshPS
  26. {
  27. get => m_xrOcclusionMeshPS;
  28. set => this.SetValueAndNotify(ref m_xrOcclusionMeshPS, value, nameof(m_xrOcclusionMeshPS));
  29. }
  30. [SerializeField]
  31. [ResourcePath("Shaders/XR/XRMirrorView.shader")]
  32. public Shader m_xrMirrorViewPS;
  33. /// <summary>
  34. /// XR Mirror View shader.
  35. /// </summary>
  36. public Shader xrMirrorViewPS
  37. {
  38. get => m_xrMirrorViewPS;
  39. set => this.SetValueAndNotify(ref m_xrMirrorViewPS, value, nameof(m_xrMirrorViewPS));
  40. }
  41. [SerializeField]
  42. [ResourcePath("Shaders/XR/XRMotionVector.shader")]
  43. public Shader m_xrMotionVector;
  44. /// <summary>
  45. /// XR MotionVector shader.
  46. /// </summary>
  47. public Shader xrMotionVector
  48. {
  49. get => m_xrMotionVector;
  50. set => this.SetValueAndNotify(ref m_xrMotionVector, value, nameof(m_xrMotionVector));
  51. }
  52. internal bool valid
  53. {
  54. get
  55. {
  56. if (xrOcclusionMeshPS == null)
  57. return false;
  58. if (xrMirrorViewPS == null)
  59. return false;
  60. if (m_xrMotionVector == null)
  61. return false;
  62. return true;
  63. }
  64. }
  65. }
  66. }
  67. #endif