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

@@ -0,0 +1,36 @@
// Crest Water System
// Copyright © 2024 Wave Harmonic. All rights reserved.
#pragma exclude_renderers glcore gles3
#pragma kernel CrestAdd
#pragma multi_compile_local d_Float1 d_Float2 d_Float3 d_Float4
#if d_Float1
#define m_Type float
#elif d_Float2
#define m_Type float2
#elif d_Float3
#define m_Type float3
#elif d_Float4
#define m_Type float4
#endif
#include "HLSLSupport.cginc"
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Macros.hlsl"
Texture2DArray<m_Type> _Crest_Source;
RWTexture2DArray<m_Type> _Crest_Target;
m_UtilityNameSpace
void Add(uint3 id)
{
_Crest_Target[id] += _Crest_Source[id];
}
m_UtilityNameSpaceEnd
m_UtilityKernelDefault(Add)

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: d18c1734c0d4d4e7b9a09a5da1ad1b2c
ComputeShaderImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,60 @@
// Crest Water System
// Copyright © 2024 Wave Harmonic. All rights reserved.
#pragma exclude_renderers glcore gles3
#pragma kernel BlurHorizontal
#pragma kernel BlurVertical
#pragma multi_compile_local d_Float1 d_Float2 d_Float3 d_Float4
#if d_Float1
#define m_Type float
#elif d_Float2
#define m_Type float2
#elif d_Float3
#define m_Type float3
#elif d_Float4
#define m_Type float4
#endif
Texture2DArray<m_Type> _Crest_Source;
RWTexture2DArray<m_Type> _Crest_Target;
uint _Crest_Resolution;
static const float w0 = 0.4026;
static const float w1 = 0.2442;
static const float w2 = 0.0545;
uint PositiveOffset(uint value, uint offset)
{
return min(value + offset, _Crest_Resolution - 1);
}
uint NegativeOffset(uint value, uint offset)
{
return value < offset ? 0 : value - offset;
}
[numthreads(8, 8, 1)]
void BlurHorizontal(const uint3 id : SV_DispatchThreadID)
{
_Crest_Target[id] =
_Crest_Source[id] * w0 +
_Crest_Source[uint3(PositiveOffset(id.x, 1), id.y, id.z)] * w1 +
_Crest_Source[uint3(NegativeOffset(id.x, 1), id.y, id.z)] * w1 +
_Crest_Source[uint3(PositiveOffset(id.x, 2), id.y, id.z)] * w2 +
_Crest_Source[uint3(NegativeOffset(id.x, 2), id.y, id.z)] * w2;
}
[numthreads(8, 8, 1)]
void BlurVertical(const uint3 id : SV_DispatchThreadID)
{
_Crest_Target[id] =
_Crest_Source[id] * w0 +
_Crest_Source[uint3(id.x, PositiveOffset(id.y, 1), id.z)] * w1 +
_Crest_Source[uint3(id.x, NegativeOffset(id.y, 1), id.z)] * w1 +
_Crest_Source[uint3(id.x, PositiveOffset(id.y, 2), id.z)] * w2 +
_Crest_Source[uint3(id.x, NegativeOffset(id.y, 2), id.z)] * w2;
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 5a49c73b133c743caa1d82459943eabf
ComputeShaderImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -3,19 +3,33 @@
// Clear specific components using a mask.
#pragma exclude_renderers glcore gles3
#pragma kernel CrestClearTarget
#pragma kernel CrestClearTargetBoundaryX d_BoundaryX
#pragma kernel CrestClearTargetBoundaryY d_BoundaryY
#pragma multi_compile_local d_Float1 d_Float2 d_Float3 d_Float4
#if d_Float1
#define m_Type float
#elif d_Float2
#define m_Type float2
#elif d_Float3
#define m_Type float3
#elif d_Float4
#define m_Type float4
#endif
#include "HLSLSupport.cginc"
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Macros.hlsl"
RWTexture2DArray<float4> _Crest_Target;
RWTexture2DArray<m_Type> _Crest_Target;
CBUFFER_START(CrestPerMaterial)
float4 _Crest_ClearMask;
float4 _Crest_ClearColor;
m_Type _Crest_ClearMask;
m_Type _Crest_ClearColor;
uint _Crest_Resolution;
uint _Crest_TargetSlice;
CBUFFER_END