Deprecated.cs 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. // This file should be used as a container for things on its
  2. // way to being deprecated and removed in future releases
  3. using System;
  4. using System.ComponentModel;
  5. namespace UnityEngine.Rendering.Universal
  6. {
  7. public abstract partial class ScriptableRenderPass
  8. {
  9. // This callback method will be removed. Please use OnCameraCleanup() instead.
  10. [EditorBrowsable(EditorBrowsableState.Never)]
  11. public virtual void FrameCleanup(CommandBuffer cmd) => OnCameraCleanup(cmd);
  12. }
  13. /// <summary>
  14. /// Default renderer for Universal RP.
  15. /// This renderer is supported on all Universal RP supported platforms.
  16. /// It uses a classic forward rendering strategy with per-object light culling.
  17. /// </summary>
  18. [Obsolete("ForwardRenderer has been deprecated (UnityUpgradable) -> UniversalRenderer", true)]
  19. public sealed class ForwardRenderer : ScriptableRenderer
  20. {
  21. private static readonly string k_ErrorMessage = "ForwardRenderer has been deprecated. Use UniversalRenderer instead";
  22. public ForwardRenderer(ForwardRendererData data) : base(data)
  23. {
  24. throw new NotSupportedException(k_ErrorMessage);
  25. }
  26. public override void Setup(ScriptableRenderContext context, ref RenderingData renderingData)
  27. {
  28. throw new NotSupportedException(k_ErrorMessage);
  29. }
  30. public override void SetupLights(ScriptableRenderContext context, ref RenderingData renderingData)
  31. {
  32. throw new NotSupportedException(k_ErrorMessage);
  33. }
  34. public override void SetupCullingParameters(ref ScriptableCullingParameters cullingParameters, ref CameraData cameraData)
  35. {
  36. throw new NotSupportedException(k_ErrorMessage);
  37. }
  38. public override void FinishRendering(CommandBuffer cmd)
  39. {
  40. throw new NotSupportedException(k_ErrorMessage);
  41. }
  42. internal override void SwapColorBuffer(CommandBuffer cmd)
  43. {
  44. throw new NotSupportedException(k_ErrorMessage);
  45. }
  46. internal override RenderTargetIdentifier GetCameraColorFrontBuffer(CommandBuffer cmd)
  47. {
  48. throw new NotImplementedException();
  49. }
  50. }
  51. namespace Internal
  52. {
  53. public partial class AdditionalLightsShadowCasterPass
  54. {
  55. [Obsolete("AdditionalLightsShadowCasterPass.m_AdditionalShadowsBufferId was deprecated. Shadow slice matrix is now passed to the GPU using an entry in buffer m_AdditionalLightsWorldToShadow_SSBO", false)]
  56. public static int m_AdditionalShadowsBufferId;
  57. [Obsolete("AdditionalLightsShadowCasterPass.m_AdditionalShadowsIndicesId was deprecated. Shadow slice index is now passed to the GPU using last member of an entry in buffer m_AdditionalShadowParams_SSBO", false)]
  58. public static int m_AdditionalShadowsIndicesId;
  59. }
  60. }
  61. [Obsolete("This is obsolete, please use shadowCascadeCount instead.", false)]
  62. public enum ShadowCascadesOption
  63. {
  64. NoCascades,
  65. TwoCascades,
  66. FourCascades,
  67. }
  68. public partial class UniversalRenderPipelineAsset
  69. {
  70. #pragma warning disable 618 // Obsolete warning
  71. [Obsolete("This is obsolete, please use shadowCascadeCount instead.", false)]
  72. [SerializeField] ShadowCascadesOption m_ShadowCascades = ShadowCascadesOption.NoCascades;
  73. [Obsolete("This is obsolete, please use shadowCascadeCount instead.", false)]
  74. public ShadowCascadesOption shadowCascadeOption
  75. {
  76. get
  77. {
  78. switch (shadowCascadeCount)
  79. {
  80. case 1: return ShadowCascadesOption.NoCascades;
  81. case 2: return ShadowCascadesOption.TwoCascades;
  82. case 4: return ShadowCascadesOption.FourCascades;
  83. default: throw new InvalidOperationException("Cascade count is not compatible with obsolete API, please use shadowCascadeCount instead.");
  84. }
  85. ;
  86. }
  87. set
  88. {
  89. switch (value)
  90. {
  91. case ShadowCascadesOption.NoCascades:
  92. shadowCascadeCount = 1;
  93. break;
  94. case ShadowCascadesOption.TwoCascades:
  95. shadowCascadeCount = 2;
  96. break;
  97. case ShadowCascadesOption.FourCascades:
  98. shadowCascadeCount = 4;
  99. break;
  100. default:
  101. throw new InvalidOperationException("Cascade count is not compatible with obsolete API, please use shadowCascadeCount instead.");
  102. }
  103. }
  104. }
  105. #pragma warning restore 618 // Obsolete warning
  106. }
  107. public abstract partial class ScriptableRenderer
  108. {
  109. // Deprecated in 10.x
  110. [Obsolete("cameraDepth has been renamed to cameraDepthTarget. (UnityUpgradable) -> cameraDepthTarget")]
  111. [EditorBrowsable(EditorBrowsableState.Never)]
  112. public RenderTargetIdentifier cameraDepth
  113. {
  114. get => m_CameraDepthTarget;
  115. }
  116. }
  117. }