升级水插件

This commit is contained in:
2026-01-08 22:30:55 +08:00
parent febff82d24
commit ca68084264
415 changed files with 18138 additions and 7134 deletions

View File

@@ -1,19 +1,15 @@
// Crest Water System
// Crest Water System
// Copyright © 2024 Wave Harmonic. All rights reserved.
// Provides utility passes for rendering like clearing the stencil buffer.
Shader "Hidden/Crest/Utility/Blit"
Shader "Hidden/Crest/Legacy/Blit"
{
HLSLINCLUDE
#pragma vertex Vertex
#pragma fragment Fragment
#include "UnityCG.cginc"
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/Core.hlsl"
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Legacy/InputsDriven.hlsl"
#include "Packages/com.waveharmonic.crest/Runtime/Shaders/Library/Utility/Depth.hlsl"
struct Attributes
@@ -44,28 +40,10 @@ Shader "Hidden/Crest/Utility/Blit"
SubShader
{
Cull Off ZWrite On ZTest Always
Pass
{
// Copies the color texture.
Name "Copy Color"
ZWrite Off
ZTest Always
Cull Off
HLSLPROGRAM
TEXTURE2D_X(_CameraColorTexture);
float4 Fragment(Varyings input) : SV_Target
{
// We need this when sampling a screenspace texture.
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
return LOAD_TEXTURE2D_X(_CameraColorTexture, input.positionCS.xy);
}
ENDHLSL
}
Blend Off
Cull Off
ZTest Always
ZWrite Off
Pass
{
@@ -73,8 +51,6 @@ Shader "Hidden/Crest/Utility/Blit"
Name "Copy Depth / Clear Stencil"
ZWrite On
ZTest Always
Cull Off
Stencil
{
@@ -94,52 +70,9 @@ Shader "Hidden/Crest/Utility/Blit"
ENDHLSL
}
Pass
{
// Clears the depth buffer without clearing the stencil.
Name "Clear Depth"
ZWrite On
ZTest Always
Cull Off
HLSLPROGRAM
float Fragment(Varyings input) : SV_Depth
{
return 0.0;
}
ENDHLSL
}
Pass
{
// Clears the stencil buffer without clearing depth
Name "Clear Stencil"
ZWrite Off
ZTest Always
Cull Off
Blend Zero One
Stencil
{
Ref 0
Comp Always
Pass Replace
}
HLSLPROGRAM
float Fragment(Varyings input) : SV_Target
{
return 0.0;
}
ENDHLSL
}
Pass
{
Name "Copy"
Blend Off
HLSLPROGRAM
TEXTURE2D(_Utility_MainTexture);
@@ -150,5 +83,23 @@ Shader "Hidden/Crest/Utility/Blit"
}
ENDHLSL
}
Pass
{
Name "Merge Depth"
// All is required to merge depth.
ZTest Less
ZWrite On
HLSLPROGRAM
TEXTURE2D_X(_Utility_MainTexture);
float Fragment(Varyings input) : SV_Depth
{
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
return LOAD_DEPTH_TEXTURE_X(_Utility_MainTexture, input.positionCS.xy);
}
ENDHLSL
}
}
}