升级6.4.升级水,升级天气

This commit is contained in:
2026-04-05 00:26:54 +08:00
parent 63bc9b5536
commit 5f7cbfb713
635 changed files with 34718 additions and 22567 deletions

View File

@@ -1,7 +1,7 @@
// Crest Water System
// Copyright © 2024 Wave Harmonic. All rights reserved.
// FIXME: Broken for BIRP on MacOS. Either platform specific problem or bug in Unity.
#if UNITY_EDITOR
using UnityEngine;
using UnityEngine.Rendering;
@@ -19,8 +19,18 @@ namespace WaveHarmonic.Crest
void ExecuteWaterLevelDepthTexture(Camera camera, CommandBuffer buffer)
{
Helpers.CreateRenderTargetTextureReference(ref _WaterLevelDepthTexture, ref _WaterLevelDepthTarget);
_WaterLevelDepthTexture.name = k_WaterLevelDepthTextureName;
// Currently, only used for painting which means only when mouse is over the view.
if (!_Water._CurrentSceneCameraHasMouseHover)
{
return;
}
if (_WaterLevelDepthTexture == null)
{
_WaterLevelDepthTexture = new(0, 0, 0);
}
WaterLevelDepthTexture.name = k_WaterLevelDepthTextureName;
if (_WaterLevelDepthMaterial == null)
{
@@ -41,11 +51,19 @@ namespace WaveHarmonic.Crest
// Depth texture.
// Always release to handle screen size changes.
_WaterLevelDepthTexture.Release();
WaterLevelDepthTexture.Release();
descriptor.graphicsFormat = UnityEngine.Experimental.Rendering.GraphicsFormat.R32_SFloat;
descriptor.depthBufferBits = 0;
Helpers.SafeCreateRenderTexture(ref _WaterLevelDepthTexture, descriptor);
_WaterLevelDepthTexture.Create();
WaterLevelDepthTexture.descriptor = descriptor;
WaterLevelDepthTexture.Create();
_WaterLevelDepthTarget = new
(
WaterLevelDepthTexture,
mipLevel: 0,
CubemapFace.Unknown,
depthSlice: -1 // Bind all XR slices.
);
// Convert.
Helpers.Blit(buffer, _WaterLevelDepthTarget, Rendering.BIRP.UtilityMaterial, (int)Rendering.BIRP.UtilityPass.Copy);
@@ -82,3 +100,5 @@ namespace WaveHarmonic.Crest
}
}
}
#endif