升级6.4.升级水,升级天气
This commit is contained in:
@@ -1,18 +1,102 @@
|
||||
// Crest Water System
|
||||
// Copyright © 2024 Wave Harmonic. All rights reserved.
|
||||
|
||||
#if ENABLE_VR && d_UnityModuleVR
|
||||
#if ENABLE_VR
|
||||
#if UNITY_6000_5_OR_NEWER
|
||||
#if d_UnityModuleXR
|
||||
#define _XR_ENABLED
|
||||
#endif
|
||||
#else
|
||||
#if d_UnityModuleVR
|
||||
#define _XR_ENABLED
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Experimental.Rendering;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.XR;
|
||||
|
||||
namespace WaveHarmonic.Crest
|
||||
{
|
||||
static partial class Rendering
|
||||
{
|
||||
// Taken from Unity 6.5:
|
||||
// Packages/com.unity.render-pipelines.core/Runtime/Utilities/CoreUtils.cs
|
||||
|
||||
/// <summary>
|
||||
/// Return the GraphicsFormat of DepthStencil RenderTarget preferred for the current platform.
|
||||
/// </summary>
|
||||
/// <returns>The GraphicsFormat of DepthStencil RenderTarget preferred for the current platform.</returns>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static GraphicsFormat GetDefaultDepthStencilFormat()
|
||||
{
|
||||
#if UNITY_SWITCH || UNITY_SWITCH2 || UNITY_EMBEDDED_LINUX || UNITY_QNX || UNITY_ANDROID
|
||||
return GraphicsFormat.D24_UNorm_S8_UInt;
|
||||
#else
|
||||
return GraphicsFormat.D32_SFloat_S8_UInt;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Taken from Unity 6.5:
|
||||
// Packages/com.unity.render-pipelines.core/Runtime/Utilities/CoreUtils.cs
|
||||
|
||||
/// <summary>
|
||||
/// Return the GraphicsFormat of Depth-only RenderTarget preferred for the current platform.
|
||||
/// </summary>
|
||||
/// <returns>The GraphicsFormat of Depth-only RenderTarget preferred for the current platform.</returns>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static GraphicsFormat GetDefaultDepthOnlyFormat()
|
||||
{
|
||||
#if UNITY_SWITCH || UNITY_SWITCH2 || UNITY_EMBEDDED_LINUX || UNITY_QNX || UNITY_ANDROID
|
||||
return GraphicsFormatUtility.GetDepthStencilFormat(24, 0); // returns GraphicsFormat.D24_UNorm when hardware supports it
|
||||
#else
|
||||
return GraphicsFormat.D32_SFloat;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Taken from Unity 6.5:
|
||||
// Packages/com.unity.render-pipelines.core/Runtime/Utilities/CoreUtils.cs
|
||||
|
||||
/// <summary>
|
||||
/// Return the number of DepthStencil RenderTarget depth bits preferred for the current platform.
|
||||
/// </summary>
|
||||
/// <returns>The number of DepthStencil RenderTarget depth bits preferred for the current platform.</returns>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static DepthBits GetDefaultDepthBufferBits()
|
||||
{
|
||||
#if UNITY_SWITCH || UNITY_SWITCH2 || UNITY_EMBEDDED_LINUX || UNITY_QNX || UNITY_ANDROID
|
||||
return DepthBits.Depth24;
|
||||
#else
|
||||
return DepthBits.Depth32;
|
||||
#endif
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static GraphicsFormat GetDefaultColorFormat(bool hdr)
|
||||
{
|
||||
return SystemInfo.GetGraphicsFormat(hdr ? DefaultFormat.HDR : DefaultFormat.LDR);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static GraphicsFormat GetDefaultDepthFormat(bool stencil)
|
||||
{
|
||||
return stencil ? GetDefaultDepthStencilFormat() : GetDefaultDepthOnlyFormat();
|
||||
}
|
||||
|
||||
// URP_COMPATIBILITY_MODE = URP + UE < 6.4
|
||||
public static bool IsRenderGraph => RenderPipelineHelper.IsUniversal
|
||||
#if URP_COMPATIBILITY_MODE
|
||||
#if !UNITY_6000_0_OR_NEWER
|
||||
&& false
|
||||
#else
|
||||
&& !GraphicsSettings.GetRenderPipelineSettings<UnityEngine.Rendering.Universal.RenderGraphSettings>().enableRenderCompatibilityMode
|
||||
#endif
|
||||
#endif
|
||||
;
|
||||
|
||||
public static partial class BIRP
|
||||
{
|
||||
static partial class ShaderIDs
|
||||
|
||||
Reference in New Issue
Block a user