升级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

@@ -20,6 +20,9 @@ namespace WaveHarmonic.Crest
readonly System.Action<CommandBuffer> _CopyColorTexture;
readonly System.Action<CommandBuffer> _SetRenderTargetToBackBuffers;
bool _AllocatedColor;
GraphicsFormat _GraphicsFormat;
public UnderwaterEffectPass(UnderwaterRenderer renderer)
{
_Renderer = renderer;
@@ -40,7 +43,9 @@ namespace WaveHarmonic.Crest
public void Allocate(GraphicsFormat format)
{
if (_Renderer.RenderBeforeTransparency && !_Renderer._NeedsColorTexture)
_GraphicsFormat = format;
if (_Renderer.RenderBeforeTransparency && !_Renderer.NeedsColorTexture)
{
return;
}
@@ -57,11 +62,13 @@ namespace WaveHarmonic.Crest
wrapMode: TextureWrapMode.Clamp,
name: "_Crest_UnderwaterCameraColorTexture"
);
_AllocatedColor = true;
}
public void ReAllocate(RenderTextureDescriptor descriptor)
{
if (_Renderer.RenderBeforeTransparency && !_Renderer._NeedsColorTexture)
if (_Renderer.RenderBeforeTransparency && !_Renderer.NeedsColorTexture)
{
return;
}
@@ -83,8 +90,13 @@ namespace WaveHarmonic.Crest
_ColorTarget = color;
_DepthTarget = depth;
if (!_Renderer.RenderBeforeTransparency || _Renderer._NeedsColorTexture)
if (!_Renderer.RenderBeforeTransparency || _Renderer.NeedsColorTexture)
{
if (!_AllocatedColor)
{
Allocate(_GraphicsFormat);
}
buffer.SetGlobalTexture(UnderwaterRenderer.ShaderIDs.s_CameraColorTexture, _ColorTexture);
}