#if UNITY_EDITOR
using UnityEditor;
using UnityEditor.ProjectWindowCallback;
using UnityEditor.Rendering.Universal;
#endif
using System;
namespace UnityEngine.Rendering.Universal
{
///
/// Deprecated, kept for backward compatibility with existing ForwardRendererData asset files.
/// Use UniversalRendererData instead.
///
[System.Obsolete("ForwardRendererData has been deprecated (UnityUpgradable) -> UniversalRendererData", true)]
[Serializable, ReloadGroup, ExcludeFromPreset]
public class ForwardRendererData : ScriptableRendererData
{
private const string k_ErrorMessage = "ForwardRendererData has been deprecated. Use UniversalRendererData instead";
///
/// Class containing shader resources used in URP.
///
[Serializable, ReloadGroup]
public sealed class ShaderResources
{
///
/// Blit shader.
///
[Reload("Shaders/Utils/Blit.shader")]
public Shader blitPS;
///
/// Copy depth shader.
///
[Reload("Shaders/Utils/CopyDepth.shader")]
public Shader copyDepthPS;
///
/// Screen space shadows shader.
///
[Obsolete("Obsolete, this feature will be supported by new 'ScreenSpaceShadows' renderer feature", true)]
public Shader screenSpaceShadowPS;
///
/// Sampling shader.
///
[Reload("Shaders/Utils/Sampling.shader")]
public Shader samplingPS;
///
/// Stencil deferred shader.
///
[Reload("Shaders/Utils/StencilDeferred.shader")]
public Shader stencilDeferredPS;
///
/// Fallback error shader.
///
[Reload("Shaders/Utils/FallbackError.shader")]
public Shader fallbackErrorPS;
///
/// Fallback loading shader.
///
[Reload("Shaders/Utils/FallbackLoading.shader")]
public Shader fallbackLoadingPS;
///
/// Material error shader.
///
[Obsolete("Use fallbackErrorPS instead", true)]
[Reload("Shaders/Utils/MaterialError.shader")]
public Shader materialErrorPS;
// Core blitter shaders, adapted from HDRP
// TODO: move to core and share with HDRP
[Reload("Shaders/Utils/CoreBlit.shader"), SerializeField]
internal Shader coreBlitPS;
[Reload("Shaders/Utils/CoreBlitColorAndDepth.shader"), SerializeField]
internal Shader coreBlitColorAndDepthPS;
///
/// Camera motion vectors shader.
///
[Reload("Shaders/CameraMotionVectors.shader")]
public Shader cameraMotionVector;
///
/// Object motion vectors shader.
///
[Reload("Shaders/ObjectMotionVectors.shader")]
public Shader objectMotionVector;
}
///
/// Shader resources used in URP.
///
public ShaderResources shaders;
///
/// Resources needed for post processing.
///
public PostProcessData postProcessData;
#if ENABLE_VR && ENABLE_XR_MODULE
///
/// Shader resources needed in URP for XR.
///
//[Reload("Runtime/Data/XRSystemData.asset")]
public XRSystemData xrSystemData;
#endif
[SerializeField] LayerMask m_OpaqueLayerMask;
[SerializeField] LayerMask m_TransparentLayerMask;
[SerializeField] StencilStateData m_DefaultStencilState; // This default state is compatible with deferred renderer.
[SerializeField] bool m_ShadowTransparentReceive;
[SerializeField] RenderingMode m_RenderingMode;
[SerializeField] DepthPrimingMode m_DepthPrimingMode; // Default disabled because there are some outstanding issues with Text Mesh rendering.
[SerializeField] bool m_AccurateGbufferNormals;
[SerializeField] bool m_ClusteredRendering;
[SerializeField] TileSize m_TileSize;
///
protected override ScriptableRenderer Create()
{
Debug.LogWarning($"Forward Renderer Data has been deprecated, {name} will be upgraded to a {nameof(UniversalRendererData)}.");
return null;
}
///
/// Use this to configure how to filter opaque objects.
///
public LayerMask opaqueLayerMask
{
get { throw new NotSupportedException(k_ErrorMessage); }
set { throw new NotSupportedException(k_ErrorMessage); }
}
///
/// Use this to configure how to filter transparent objects.
///
public LayerMask transparentLayerMask
{
get { throw new NotSupportedException(k_ErrorMessage); }
set { throw new NotSupportedException(k_ErrorMessage); }
}
///
/// The default stencil state settings.
///
public StencilStateData defaultStencilState
{
get { throw new NotSupportedException(k_ErrorMessage); }
set { throw new NotSupportedException(k_ErrorMessage); }
}
///
/// True if transparent objects receive shadows.
///
public bool shadowTransparentReceive
{
get { throw new NotSupportedException(k_ErrorMessage); }
set { throw new NotSupportedException(k_ErrorMessage); }
}
///
/// Rendering mode.
///
public RenderingMode renderingMode
{
get { throw new NotSupportedException(k_ErrorMessage); }
set { throw new NotSupportedException(k_ErrorMessage); }
}
///
/// Use Octahedron normal vector encoding for gbuffer normals.
/// The overhead is negligible from desktop GPUs, while it should be avoided for mobile GPUs.
///
public bool accurateGbufferNormals
{
get { throw new NotSupportedException(k_ErrorMessage); }
set { throw new NotSupportedException(k_ErrorMessage); }
}
}
}