ForwardRendererData.cs 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. #if UNITY_EDITOR
  2. using UnityEditor;
  3. using UnityEditor.ProjectWindowCallback;
  4. using UnityEditor.Rendering.Universal;
  5. #endif
  6. using System;
  7. namespace UnityEngine.Rendering.Universal
  8. {
  9. /// <summary>
  10. /// Deprecated, kept for backward compatibility with existing ForwardRendererData asset files.
  11. /// Use UniversalRendererData instead.
  12. /// </summary>
  13. [System.Obsolete("ForwardRendererData has been deprecated (UnityUpgradable) -> UniversalRendererData", true)]
  14. [Serializable, ReloadGroup, ExcludeFromPreset]
  15. public class ForwardRendererData : ScriptableRendererData
  16. {
  17. private const string k_ErrorMessage = "ForwardRendererData has been deprecated. Use UniversalRendererData instead";
  18. [Serializable, ReloadGroup]
  19. public sealed class ShaderResources
  20. {
  21. [Reload("Shaders/Utils/Blit.shader")]
  22. public Shader blitPS;
  23. [Reload("Shaders/Utils/CopyDepth.shader")]
  24. public Shader copyDepthPS;
  25. [Obsolete("Obsolete, this feature will be supported by new 'ScreenSpaceShadows' renderer feature")]
  26. public Shader screenSpaceShadowPS;
  27. [Reload("Shaders/Utils/Sampling.shader")]
  28. public Shader samplingPS;
  29. [Reload("Shaders/Utils/StencilDeferred.shader")]
  30. public Shader stencilDeferredPS;
  31. [Reload("Shaders/Utils/FallbackError.shader")]
  32. public Shader fallbackErrorPS;
  33. [Reload("Shaders/Utils/MaterialError.shader")]
  34. public Shader materialErrorPS;
  35. // Core blitter shaders, adapted from HDRP
  36. // TODO: move to core and share with HDRP
  37. [Reload("Shaders/Utils/CoreBlit.shader"), SerializeField]
  38. internal Shader coreBlitPS;
  39. [Reload("Shaders/Utils/CoreBlitColorAndDepth.shader"), SerializeField]
  40. internal Shader coreBlitColorAndDepthPS;
  41. [Reload("Shaders/CameraMotionVectors.shader")]
  42. public Shader cameraMotionVector;
  43. [Reload("Shaders/ObjectMotionVectors.shader")]
  44. public Shader objectMotionVector;
  45. }
  46. public ShaderResources shaders;
  47. public PostProcessData postProcessData;
  48. #if ENABLE_VR && ENABLE_XR_MODULE
  49. [Reload("Runtime/Data/XRSystemData.asset")]
  50. public XRSystemData xrSystemData;
  51. #endif
  52. [SerializeField] LayerMask m_OpaqueLayerMask;
  53. [SerializeField] LayerMask m_TransparentLayerMask;
  54. [SerializeField] StencilStateData m_DefaultStencilState; // This default state is compatible with deferred renderer.
  55. [SerializeField] bool m_ShadowTransparentReceive;
  56. [SerializeField] RenderingMode m_RenderingMode;
  57. [SerializeField] DepthPrimingMode m_DepthPrimingMode; // Default disabled because there are some outstanding issues with Text Mesh rendering.
  58. [SerializeField] bool m_AccurateGbufferNormals;
  59. [SerializeField] bool m_ClusteredRendering;
  60. [SerializeField] TileSize m_TileSize;
  61. protected override ScriptableRenderer Create()
  62. {
  63. Debug.LogWarning($"Forward Renderer Data has been deprecated, {name} will be upgraded to a {nameof(UniversalRendererData)}.");
  64. return null;
  65. }
  66. public LayerMask opaqueLayerMask
  67. {
  68. get { throw new NotSupportedException(k_ErrorMessage); }
  69. set { throw new NotSupportedException(k_ErrorMessage); }
  70. }
  71. public LayerMask transparentLayerMask
  72. {
  73. get { throw new NotSupportedException(k_ErrorMessage); }
  74. set { throw new NotSupportedException(k_ErrorMessage); }
  75. }
  76. public StencilStateData defaultStencilState
  77. {
  78. get { throw new NotSupportedException(k_ErrorMessage); }
  79. set { throw new NotSupportedException(k_ErrorMessage); }
  80. }
  81. public bool shadowTransparentReceive
  82. {
  83. get { throw new NotSupportedException(k_ErrorMessage); }
  84. set { throw new NotSupportedException(k_ErrorMessage); }
  85. }
  86. public RenderingMode renderingMode
  87. {
  88. get { throw new NotSupportedException(k_ErrorMessage); }
  89. set { throw new NotSupportedException(k_ErrorMessage); }
  90. }
  91. public bool accurateGbufferNormals
  92. {
  93. get { throw new NotSupportedException(k_ErrorMessage); }
  94. set { throw new NotSupportedException(k_ErrorMessage); }
  95. }
  96. }
  97. }