修复技能输入并更新战斗资源
This commit is contained in:
@@ -0,0 +1,172 @@
|
||||
Shader "SGame/Particles/Additive"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
[Enum(Off, 0, On, 1)] _ZWrite("深度写入", Float) = 0
|
||||
[Enum(Off, 0, On, 2)] _ZTest ("深度测试", Float) = 2
|
||||
_TintColor ("颜色", Color) = (0.5,0.5,0.5,0.5)
|
||||
_MainTex ("基础贴图(RGB: 颜色,A: Alpha)", 2D) = "white" {}
|
||||
[MaterialToggle]_CutOff ("透贴开关", Float) = 0
|
||||
_CutOffAlpha ("透贴Alpha阈值", Range(0, 1)) = 0
|
||||
[MaterialToggle]_GlowCustomData ("加亮CustomData", Float) = 0
|
||||
_Glow("加亮", Range(0,10)) = 1
|
||||
|
||||
[Space(15)]
|
||||
[HideInInspector] _HorizontalLine ("地平面分割线", Float) = -5000
|
||||
[HideInInspector] _HorizontalClip ("地平面切割", Float) = 0
|
||||
[Enum(Double, 0, Front, 1, Back, 2)]_CullMode ("面剔除", Float) = 0
|
||||
|
||||
[Space(15)]
|
||||
[MaterialToggle] _DECAL ("自行贴地开关", Float) = 0
|
||||
_DecalOffset("Z轴偏移,普通为0,需要Z缩放为-0.5", Float) = -0.5
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"Queue"="Overlay"
|
||||
"RenderType" = "Transparent"
|
||||
"IgnoreProjector" = "True"
|
||||
"PreviewType" = "Plane"
|
||||
"PerformanceChecks" = "False"
|
||||
"RenderPipeline" = "UniversalPipeline"
|
||||
}
|
||||
|
||||
Blend SrcAlpha One, SrcAlpha One
|
||||
Cull [_CullMode] Lighting Off
|
||||
ZWrite [_ZWrite] ZTest[_ZTest]
|
||||
|
||||
HLSLINCLUDE
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/core.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareDepthTexture.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareOpaqueTexture.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
||||
|
||||
#pragma multi_compile __ _CUTOFF_ON
|
||||
#pragma multi_compile __ _DECAL_ON
|
||||
|
||||
TEXTURE2D(_MainTex); SAMPLER(sampler_MainTex);
|
||||
CBUFFER_START(UnityPerMaterial)
|
||||
float4 _MainTex_ST; half4 _TintColor; half _Glow; half _CutOffAlpha;
|
||||
half _HorizontalClip;
|
||||
half _HorizontalLine;
|
||||
half _GlowCustomData;
|
||||
half _DecalOffset;
|
||||
CBUFFER_END
|
||||
|
||||
struct Attributes
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
half4 color : COLOR;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float4 texcoord2 : TEXCOORD1;
|
||||
float4 texcoord3 : TEXCOORD2;
|
||||
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
struct Varyings
|
||||
{
|
||||
float4 vertex : SV_POSITION;
|
||||
half4 color : COLOR;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
half3 worldPos : TEXCOORD1;
|
||||
float texCustomData : FLOAT;
|
||||
|
||||
#if defined(_DECAL_ON)
|
||||
float4 viewRayOS : TEXCOORD11;
|
||||
float3 camPosOS : TEXCOORD12;
|
||||
float4 screenUV : TEXCOORD13;
|
||||
#endif
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
inline Varyings vert (Attributes v)
|
||||
{
|
||||
Varyings o = (Varyings)0;
|
||||
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
|
||||
VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz);
|
||||
o.vertex = vertexInput.positionCS;
|
||||
o.worldPos.xyz = vertexInput.positionWS;
|
||||
|
||||
o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex);
|
||||
o.texCustomData = v.texcoord3.y;
|
||||
o.color = v.color;
|
||||
|
||||
//DECAL
|
||||
#if defined(_DECAL_ON)
|
||||
float4 positionVS = mul(UNITY_MATRIX_MV, v.vertex);
|
||||
float3 viewRayVS = positionVS.xyz;
|
||||
o.viewRayOS.w = positionVS.z;
|
||||
float4x4 ViewToObjectMatrix = mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V);
|
||||
o.viewRayOS.xyz = mul((float3x3)ViewToObjectMatrix, -viewRayVS).xyz;
|
||||
o.camPosOS = ViewToObjectMatrix._m03_m13_m23;
|
||||
o.screenUV = ComputeScreenPos(o.vertex);
|
||||
#endif
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
inline half4 frag (Varyings i) : SV_Target
|
||||
{
|
||||
UNITY_SETUP_INSTANCE_ID(i);
|
||||
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
|
||||
|
||||
#if defined(_DECAL_ON)
|
||||
i.viewRayOS.xyz *= rcp(i.viewRayOS.w);
|
||||
float2 uv = i.screenUV.xy / i.screenUV.w;
|
||||
float rawDepth = SAMPLE_DEPTH_TEXTURE_LOD(_CameraDepthTexture, sampler_CameraDepthTexture, uv, 0);
|
||||
float depth = LinearEyeDepth(rawDepth, _ZBufferParams);
|
||||
float3 positionOS = i.camPosOS + i.viewRayOS.xyz * depth + float3(0, 0, _DecalOffset);
|
||||
clip(float3(0.5, 0.5, 0.5) - abs(positionOS.xyz));
|
||||
|
||||
i.texcoord = TRANSFORM_TEX( positionOS.xz + float2(0.5, 0.5) , _MainTex);
|
||||
// _GlowCustomData = 0;
|
||||
#endif
|
||||
|
||||
half4 col = i.color * _TintColor * SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.texcoord);
|
||||
half a = col.a;
|
||||
half glowOffset = _GlowCustomData * i.texCustomData * _Glow + (1 - _GlowCustomData) * _Glow;
|
||||
|
||||
#if !defined(_DECAL_ON)
|
||||
col *= glowOffset;
|
||||
#endif
|
||||
|
||||
#if defined(_CUTOFF_ON)
|
||||
clip(col.a - _CutOffAlpha);
|
||||
#endif
|
||||
|
||||
a = step(_HorizontalLine, i.worldPos.y) * a * _HorizontalClip + a * (1 - _HorizontalClip);
|
||||
return half4(col.rgb * col.a, clamp(a, 0, 1));
|
||||
}
|
||||
ENDHLSL
|
||||
|
||||
Pass
|
||||
{
|
||||
|
||||
Tags { "LightMode" = "UniversalForward" }
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
//剔除不受 扭曲影响Pass,默认用脚本Disable掉
|
||||
|
||||
Tags { "LightMode" = "ScreenDistortion" }
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
FallBack Off
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7c2c7e9a1e3695040a8fa39d88575673
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName: allshader.ab
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,173 @@
|
||||
Shader "SGame/Particles/Additive_DepthCap"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
[Enum(Off, 0, On, 1)] _ZWrite("深度写入", Float) = 0
|
||||
[Enum(Off, 0, On, 2)] _ZTest ("深度测试", Float) = 2
|
||||
_TintColor ("颜色", Color) = (0.5,0.5,0.5,0.5)
|
||||
_MainTex ("基础贴图(RGB: 颜色,A: Alpha)", 2D) = "white" {}
|
||||
[MaterialToggle]_CutOff ("透贴开关", Float) = 0
|
||||
_CutOffAlpha ("透贴Alpha阈值", Range(0, 1)) = 0
|
||||
[MaterialToggle]_GlowCustomData ("加亮CustomData", Float) = 0
|
||||
_Glow("加亮", Range(0,10)) = 1
|
||||
_AngleRange ("单边区域角度", Range(0, 360)) = 360
|
||||
|
||||
[Space(15)]
|
||||
[MaterialToggle] _SphereDuelMask ("扇形双边遮罩开关", Float) = 0
|
||||
_AngleDuelRange ("双边区域角度", Range(0, 360)) = 360
|
||||
// _AngleProc ("扇形遮罩百分比", Range(0, 1)) = 0
|
||||
[Space(15)]
|
||||
[MaterialToggle] _UVCutOn ("UV 线性剔除开关", Float) = 0
|
||||
_InnerCutOut ("内圈剔除", Range(0, 1)) = 0
|
||||
|
||||
[Space(15)]
|
||||
[HideInInspector] _HorizontalLine ("地平面分割线", Float) = -5000
|
||||
[HideInInspector] _HorizontalClip ("地平面切割", Float) = 0
|
||||
[Enum(Double, 0, Front, 1, Back, 2)]_CullMode ("面剔除", Float) = 0
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"Queue"="Overlay"
|
||||
"RenderType" = "Transparent"
|
||||
"IgnoreProjector" = "True"
|
||||
"PreviewType" = "Plane"
|
||||
"PerformanceChecks" = "False"
|
||||
"RenderPipeline" = "UniversalPipeline"
|
||||
}
|
||||
|
||||
Blend SrcAlpha One, SrcAlpha One
|
||||
Cull [_CullMode] Lighting Off
|
||||
ZWrite [_ZWrite] ZTest[_ZTest]
|
||||
|
||||
HLSLINCLUDE
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/core.hlsl"
|
||||
|
||||
#pragma multi_compile __ _CUTOFF_ON
|
||||
#pragma multi_compile __ _SPHEREDUELMASK_ON
|
||||
|
||||
TEXTURE2D(_MainTex); SAMPLER(sampler_MainTex);
|
||||
CBUFFER_START(UnityPerMaterial)
|
||||
float4 _MainTex_ST;
|
||||
half4 _TintColor; half _Glow;
|
||||
half _CutOffAlpha;
|
||||
|
||||
half _HorizontalClip;
|
||||
half _HorizontalLine;
|
||||
half _GlowCustomData;
|
||||
|
||||
half _AngleRange;
|
||||
half _AngleDuelRange;
|
||||
half _InnerCutOut;
|
||||
|
||||
half _UVCutOn;
|
||||
CBUFFER_END
|
||||
|
||||
struct Attributes
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
half4 color : COLOR;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float4 texcoord2 : TEXCOORD1;
|
||||
float4 texcoord3 : TEXCOORD2;
|
||||
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
struct Varyings
|
||||
{
|
||||
float4 vertex : SV_POSITION;
|
||||
half4 color : COLOR;
|
||||
float4 texcoord : TEXCOORD0;
|
||||
half3 worldPos : TEXCOORD1;
|
||||
float texCustomData : FLOAT;
|
||||
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
inline Varyings vert (Attributes v)
|
||||
{
|
||||
Varyings o = (Varyings)0;
|
||||
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
|
||||
VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz);
|
||||
o.vertex = vertexInput.positionCS;
|
||||
o.worldPos.xyz = vertexInput.positionWS;
|
||||
|
||||
o.texcoord.xy = TRANSFORM_TEX(v.texcoord, _MainTex);
|
||||
o.texcoord.zw = v.texcoord.xy;
|
||||
o.texCustomData = v.texcoord3.y;
|
||||
o.color = v.color;
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
inline half4 frag (Varyings i) : SV_Target
|
||||
{
|
||||
UNITY_SETUP_INSTANCE_ID(i);
|
||||
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
|
||||
|
||||
half4 col = i.color * _TintColor * SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.texcoord);
|
||||
half a = col.a;
|
||||
half glowOffset = _GlowCustomData * i.texCustomData * _Glow + (1 - _GlowCustomData) * _Glow;
|
||||
col *= glowOffset;
|
||||
#if defined(_CUTOFF_ON)
|
||||
clip(col.a - _CutOffAlpha);
|
||||
#endif
|
||||
|
||||
#if defined(_SPHEREDUELMASK_ON)
|
||||
half dotResDul = dot(half2(0, 1), normalize(i.texcoord.xy - half2(0.5, 0.5)));
|
||||
half dotClampDul = step(degrees(acos(dotResDul)), _AngleDuelRange / 2);
|
||||
col.rgb *= dotClampDul;
|
||||
#else
|
||||
//第一象限:step(0.5, i.texcoord.x) * step(dotRes, 0)
|
||||
//第二象限:step(i.texcoord.x, 0.5) * step(dotRes, 0)
|
||||
//第三象限:step(i.texcoord.x, 0.5) * step(0, dotRes)
|
||||
//第三象限:step(i.texcoord.x, 0.5) * step(dotRes, 0)
|
||||
|
||||
half dotRes = dot(half2(0, -1), normalize(i.texcoord.xy - half2(0.5, 0.5)));
|
||||
half dotRes2 = dot(half2(0, 1), normalize(i.texcoord.xy - half2(0.5, 0.5)));
|
||||
|
||||
// half dotClampOri = step(dotResDul, _AngleRange - 180) -
|
||||
half dotClamp = step(degrees(acos(dotRes)), abs(180 - _AngleRange)) * step(0.5, i.texcoord.x) * step(180, _AngleRange);
|
||||
half dotClamp2 = step(degrees(acos(dotRes2)), _AngleRange) * step(i.texcoord.x, 0.5);
|
||||
// col.rgb = acos(dotRes) / UNITY_PI;
|
||||
col.rgb *= dotClamp2 + dotClamp;
|
||||
#endif
|
||||
|
||||
half uvMask = step(_InnerCutOut, i.texcoord.w);
|
||||
half mask = step(_InnerCutOut, length(i.texcoord.xy - half2(0.5, 0.5)));
|
||||
mask = lerp(mask, uvMask, _UVCutOn);
|
||||
|
||||
a = step(_HorizontalLine, i.worldPos.y) * a * _HorizontalClip + a * (1 - _HorizontalClip);
|
||||
return half4(col.rgb * col.a, clamp(a * mask, 0, 1));
|
||||
}
|
||||
ENDHLSL
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "UniversalForward" }
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
//剔除不受 扭曲影响Pass,默认用脚本Disable掉
|
||||
|
||||
Tags { "LightMode" = "ScreenDistortion" }
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
FallBack "Mobile/VertexLit"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ecae83392a282cc4596bfaf308a95e36
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName: allshader.ab
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,171 @@
|
||||
Shader "SGame/Particles/Alpha Blended"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
[Enum(Off, 0, On, 1)] _ZWrite("深度写入", Float) = 0
|
||||
[Enum(Off, 0, On, 2)] _ZTest ("深度测试", Float) = 2
|
||||
_TintColor ("颜色", Color) = (0.5,0.5,0.5,0.5)
|
||||
_MainTex ("基础贴图(RGB: 颜色,A: Alpha)", 2D) = "white" {}
|
||||
[MaterialToggle]_CutOff ("透贴开关", Float) = 0
|
||||
_CutOffAlpha ("透贴Alpha阈值", Range(0, 1)) = 0
|
||||
[MaterialToggle]_GlowCustomData ("加亮CustomData", Float) = 0
|
||||
_Glow("加亮", Range(0,10)) = 1
|
||||
|
||||
|
||||
[Space(15)]
|
||||
[HideInInspector] _HorizontalLine ("地平面分割线", Float) = -5000
|
||||
[HideInInspector] _HorizontalClip ("地平面切割", Float) = 0
|
||||
[Enum(Double, 0, Front, 1, Back, 2)]_CullMode ("面剔除", Float) = 0
|
||||
|
||||
[Space(15)]
|
||||
[MaterialToggle] _DECAL ("自行贴地开关", Float) = 0
|
||||
_DecalOffset("Z轴偏移,普通为0,需要Z缩放为-0.5", Float) = -0.5
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"Queue"="Overlay"
|
||||
"RenderType" = "Transparent"
|
||||
"IgnoreProjector" = "True"
|
||||
"PreviewType" = "Plane"
|
||||
"PerformanceChecks" = "False"
|
||||
"RenderPipeline" = "UniversalPipeline"
|
||||
}
|
||||
|
||||
Blend SrcAlpha OneMinusSrcAlpha, SrcAlpha OneMinusSrcAlpha
|
||||
Cull [_CullMode] Lighting Off
|
||||
ZWrite [_ZWrite] ZTest[_ZTest]
|
||||
|
||||
HLSLINCLUDE
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/core.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareDepthTexture.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareOpaqueTexture.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
||||
|
||||
#pragma multi_compile __ _CUTOFF_ON
|
||||
#pragma multi_compile __ _DECAL_ON
|
||||
|
||||
TEXTURE2D(_MainTex); SAMPLER(sampler_MainTex);
|
||||
CBUFFER_START(UnityPerMaterial)
|
||||
float4 _MainTex_ST; half4 _TintColor; half _Glow; half _CutOffAlpha;
|
||||
half _HorizontalClip;
|
||||
half _HorizontalLine;
|
||||
half _GlowCustomData;
|
||||
half _DecalOffset;
|
||||
CBUFFER_END
|
||||
|
||||
struct Attributes
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
half4 color : COLOR;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float4 texcoord2 : TEXCOORD1;
|
||||
float4 texcoord3 : TEXCOORD2;
|
||||
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
struct Varyings
|
||||
{
|
||||
float4 vertex : SV_POSITION;
|
||||
half4 color : COLOR;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
half3 worldPos : TEXCOORD1;
|
||||
float texCustomData : FLOAT;
|
||||
|
||||
#if defined(_DECAL_ON)
|
||||
float4 viewRayOS : TEXCOORD11;
|
||||
float3 camPosOS : TEXCOORD12;
|
||||
float4 screenUV : TEXCOORD13;
|
||||
#endif
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
inline Varyings vert (Attributes v)
|
||||
{
|
||||
Varyings o = (Varyings)0;
|
||||
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
|
||||
VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz);
|
||||
o.vertex = vertexInput.positionCS;
|
||||
o.worldPos.xyz = vertexInput.positionWS;
|
||||
|
||||
o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex);
|
||||
o.texCustomData = v.texcoord3.y;
|
||||
o.color = v.color;
|
||||
//DECAL
|
||||
#if defined(_DECAL_ON)
|
||||
float4 positionVS = mul(UNITY_MATRIX_MV, v.vertex);
|
||||
float3 viewRayVS = positionVS.xyz;
|
||||
o.viewRayOS.w = positionVS.z;
|
||||
float4x4 ViewToObjectMatrix = mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V);
|
||||
o.viewRayOS.xyz = mul((float3x3)ViewToObjectMatrix, -viewRayVS).xyz;
|
||||
o.camPosOS = ViewToObjectMatrix._m03_m13_m23;
|
||||
o.screenUV = ComputeScreenPos(o.vertex);
|
||||
#endif
|
||||
return o;
|
||||
}
|
||||
|
||||
inline half4 frag (Varyings i) : SV_Target
|
||||
{
|
||||
UNITY_SETUP_INSTANCE_ID(i);
|
||||
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
|
||||
|
||||
#if defined(_DECAL_ON)
|
||||
i.viewRayOS.xyz *= rcp(i.viewRayOS.w);
|
||||
float2 uv = i.screenUV.xy / i.screenUV.w;
|
||||
float rawDepth = SAMPLE_DEPTH_TEXTURE_LOD(_CameraDepthTexture, sampler_CameraDepthTexture, uv, 0);
|
||||
float depth = LinearEyeDepth(rawDepth, _ZBufferParams);
|
||||
float3 positionOS = i.camPosOS + i.viewRayOS.xyz * depth + float3(0, 0, _DecalOffset);
|
||||
clip(float3(0.5, 0.5, 0.5) - abs(positionOS.xyz));
|
||||
|
||||
i.texcoord = TRANSFORM_TEX( positionOS.xz + float2(0.5, 0.5) , _MainTex);
|
||||
// _GlowCustomData = 0;
|
||||
#endif
|
||||
|
||||
half4 col = i.color * _TintColor * SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.texcoord);
|
||||
half a = col.a;
|
||||
half glowOffset = _GlowCustomData * i.texCustomData * _Glow + (1 - _GlowCustomData) * _Glow;
|
||||
|
||||
#if !defined(_DECAL_ON)
|
||||
col *= glowOffset;
|
||||
#endif
|
||||
|
||||
#if defined(_CUTOFF_ON)
|
||||
clip(col.a - _CutOffAlpha);
|
||||
#endif
|
||||
|
||||
a = step(_HorizontalLine, i.worldPos.y) * a * _HorizontalClip + a * (1 - _HorizontalClip);
|
||||
return half4(col.rgb * col.a, clamp(a, 0, 1));
|
||||
}
|
||||
ENDHLSL
|
||||
|
||||
Pass
|
||||
{
|
||||
|
||||
Tags { "LightMode" = "UniversalForward" }
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
//剔除不受 扭曲影响Pass,默认用脚本Disable掉
|
||||
|
||||
Tags { "LightMode" = "ScreenDistortion" }
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
FallBack Off
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 82d6a6fb3b7aa3d4c9bdd9be364412c8
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName: allshader.ab
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,174 @@
|
||||
Shader "SGame/Particles/AlphaBlend_DepthCap"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
[Enum(Off, 0, On, 1)] _ZWrite("深度写入", Float) = 0
|
||||
[Enum(Off, 0, On, 2)] _ZTest ("深度测试", Float) = 2
|
||||
_TintColor ("颜色", Color) = (0.5,0.5,0.5,0.5)
|
||||
_MainTex ("基础贴图(RGB: 颜色,A: Alpha)", 2D) = "white" {}
|
||||
[MaterialToggle]_CutOff ("透贴开关", Float) = 0
|
||||
_CutOffAlpha ("透贴Alpha阈值", Range(0, 1)) = 0
|
||||
[MaterialToggle]_GlowCustomData ("加亮CustomData", Float) = 0
|
||||
_Glow("加亮", Range(0,10)) = 1
|
||||
_AngleRange ("单边区域角度", Range(0, 360)) = 360
|
||||
|
||||
[Space(15)]
|
||||
[MaterialToggle] _SphereDuelMask ("扇形双边遮罩开关", Float) = 0
|
||||
_AngleDuelRange ("双边区域角度", Range(0, 360)) = 360
|
||||
// _AngleProc ("扇形遮罩百分比", Range(0, 1)) = 0
|
||||
[Space(15)]
|
||||
[MaterialToggle] _UVCutOn ("UV 线性剔除开关", Float) = 0
|
||||
_InnerCutOut ("内圈剔除", Range(0, 1)) = 0
|
||||
|
||||
[Space(15)]
|
||||
[HideInInspector] _HorizontalLine ("地平面分割线", Float) = -5000
|
||||
[HideInInspector] _HorizontalClip ("地平面切割", Float) = 0
|
||||
[Enum(Double, 0, Front, 1, Back, 2)]_CullMode ("面剔除", Float) = 0
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"Queue"="Overlay"
|
||||
"RenderType" = "Transparent"
|
||||
"IgnoreProjector" = "True"
|
||||
"PreviewType" = "Plane"
|
||||
"PerformanceChecks" = "False"
|
||||
"RenderPipeline" = "UniversalPipeline"
|
||||
}
|
||||
|
||||
Blend SrcAlpha OneMinusSrcAlpha, SrcAlpha OneMinusSrcAlpha
|
||||
Cull [_CullMode] Lighting Off
|
||||
ZWrite [_ZWrite] ZTest[_ZTest]
|
||||
|
||||
HLSLINCLUDE
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/core.hlsl"
|
||||
|
||||
#pragma multi_compile __ _CUTOFF_ON
|
||||
#pragma multi_compile __ _SPHEREDUELMASK_ON
|
||||
|
||||
TEXTURE2D(_MainTex); SAMPLER(sampler_MainTex);
|
||||
CBUFFER_START(UnityPerMaterial)
|
||||
float4 _MainTex_ST;
|
||||
half4 _TintColor; half _Glow;
|
||||
half _CutOffAlpha;
|
||||
|
||||
half _HorizontalClip;
|
||||
half _HorizontalLine;
|
||||
half _GlowCustomData;
|
||||
|
||||
half _AngleRange;
|
||||
half _AngleDuelRange;
|
||||
half _InnerCutOut;
|
||||
|
||||
half _UVCutOn;
|
||||
CBUFFER_END
|
||||
|
||||
struct Attributes
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
half4 color : COLOR;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float4 texcoord2 : TEXCOORD1;
|
||||
float4 texcoord3 : TEXCOORD2;
|
||||
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
struct Varyings
|
||||
{
|
||||
float4 vertex : SV_POSITION;
|
||||
half4 color : COLOR;
|
||||
float4 texcoord : TEXCOORD0;
|
||||
half3 worldPos : TEXCOORD1;
|
||||
float texCustomData : FLOAT;
|
||||
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
inline Varyings vert (Attributes v)
|
||||
{
|
||||
Varyings o = (Varyings)0;
|
||||
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
|
||||
VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz);
|
||||
o.vertex = vertexInput.positionCS;
|
||||
o.worldPos.xyz = vertexInput.positionWS;
|
||||
|
||||
o.texcoord.xy = TRANSFORM_TEX(v.texcoord, _MainTex);
|
||||
o.texcoord.zw = v.texcoord.xy;
|
||||
o.texCustomData = v.texcoord3.y;
|
||||
o.color = v.color;
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
inline half4 frag (Varyings i) : SV_Target
|
||||
{
|
||||
UNITY_SETUP_INSTANCE_ID(i);
|
||||
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
|
||||
|
||||
half4 col = i.color * _TintColor * SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.texcoord);
|
||||
half a = col.a;
|
||||
half glowOffset = _GlowCustomData * i.texCustomData * _Glow + (1 - _GlowCustomData) * _Glow;
|
||||
col *= glowOffset;
|
||||
#if defined(_CUTOFF_ON)
|
||||
clip(col.a - _CutOffAlpha);
|
||||
#endif
|
||||
|
||||
#if defined(_SPHEREDUELMASK_ON)
|
||||
half dotResDul = dot(half2(0, 1), normalize(i.texcoord.xy - half2(0.5, 0.5)));
|
||||
half dotClampDul = step(degrees(acos(dotResDul)), _AngleDuelRange / 2);
|
||||
col.rgb *= dotClampDul;
|
||||
#else
|
||||
//第一象限:step(0.5, i.texcoord.x) * step(dotRes, 0)
|
||||
//第二象限:step(i.texcoord.x, 0.5) * step(dotRes, 0)
|
||||
//第三象限:step(i.texcoord.x, 0.5) * step(0, dotRes)
|
||||
//第三象限:step(i.texcoord.x, 0.5) * step(dotRes, 0)
|
||||
|
||||
half dotRes = dot(half2(0, -1), normalize(i.texcoord.xy - half2(0.5, 0.5)));
|
||||
half dotRes2 = dot(half2(0, 1), normalize(i.texcoord.xy - half2(0.5, 0.5)));
|
||||
|
||||
// half dotClampOri = step(dotResDul, _AngleRange - 180) -
|
||||
half dotClamp = step(degrees(acos(dotRes)), abs(180 - _AngleRange)) * step(0.5, i.texcoord.x) * step(180, _AngleRange);
|
||||
half dotClamp2 = step(degrees(acos(dotRes2)), _AngleRange) * step(i.texcoord.x, 0.5);
|
||||
// col.rgb = acos(dotRes) / UNITY_PI;
|
||||
col.rgb *= dotClamp2 + dotClamp;
|
||||
#endif
|
||||
|
||||
half uvMask = step(_InnerCutOut, i.texcoord.w);
|
||||
half mask = step(_InnerCutOut, length(i.texcoord.xy - half2(0.5, 0.5)));
|
||||
mask = lerp(mask, uvMask, _UVCutOn);
|
||||
|
||||
a = step(_HorizontalLine, i.worldPos.y) * a * _HorizontalClip + a * (1 - _HorizontalClip);
|
||||
return half4(col.rgb * col.a, clamp(a * mask, 0, 1));
|
||||
}
|
||||
ENDHLSL
|
||||
|
||||
Pass
|
||||
{
|
||||
|
||||
Tags { "LightMode" = "UniversalForward" }
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
//剔除不受 扭曲影响Pass,默认用脚本Disable掉
|
||||
|
||||
Tags { "LightMode" = "ScreenDistortion" }
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
FallBack "Mobile/VertexLit"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 637201979d44d76419d4d1b103b29446
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName: allshader.ab
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,109 @@
|
||||
Shader "SGame/Particles/Screen_Distortion"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_Diffuse ("基础贴图", 2D) = "white" {}
|
||||
_V ("基础贴图动画V", Float ) = 0
|
||||
_U ("基础贴图动画U", Float ) = 0
|
||||
_Value ("扭曲强度", Float ) = 1
|
||||
_Mask ("遮罩贴图", 2D) = "white" {}
|
||||
[MaterialToggle] _MaskUseR ("遮罩是否黑底", Float) = 0
|
||||
_Mask1USpeed ("遮罩动画U", Float) = 0
|
||||
_Mask1VSpeed ("遮罩动画V", Float) = 0
|
||||
_MaskIntensity ("遮罩强度", Float) = 1
|
||||
[HideInInspector]_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"Queue"="Overlay"
|
||||
"RenderType" = "Transparent"
|
||||
"IgnoreProjector" = "True"
|
||||
"PreviewType" = "Plane"
|
||||
"PerformanceChecks" = "False"
|
||||
"RenderPipeline" = "UniversalPipeline"
|
||||
|
||||
"LightMode" = "ScreenDistortion"
|
||||
}
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
Cull Off ZWrite Off Lighting Off
|
||||
|
||||
Pass
|
||||
{
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma fragmentoption ARB_precision_hint_fastest
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
|
||||
TEXTURE2D(_Diffuse); SAMPLER(sampler_Diffuse);
|
||||
TEXTURE2D(_Mask); SAMPLER(sampler_Mask);
|
||||
TEXTURE2D_X(_CameraOpaqueTextureClone);
|
||||
SAMPLER(sampler_CameraOpaqueTextureClone);
|
||||
|
||||
CBUFFER_START(UnityPerMaterial)
|
||||
float4 _Diffuse_ST; half4 _Mask_ST; half _Mask1USpeed; half _Mask1VSpeed;
|
||||
float _V; float _U; float _Value; float _MaskIntensity; half _MaskUseR;
|
||||
CBUFFER_END
|
||||
|
||||
struct Attributes
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float2 texcoord0 : TEXCOORD0;
|
||||
float4 vertexColor : COLOR;
|
||||
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
struct Varyings
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv0 : TEXCOORD0;
|
||||
float4 vertexColor : COLOR;
|
||||
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
inline float3 SampleSceneColor(float2 uv)
|
||||
{
|
||||
return SAMPLE_TEXTURE2D_X(_CameraOpaqueTextureClone, sampler_CameraOpaqueTextureClone, UnityStereoTransformScreenSpaceTex(uv)).rgb;
|
||||
}
|
||||
|
||||
inline Varyings vert (Attributes v)
|
||||
{
|
||||
Varyings o = (Varyings)0;
|
||||
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
|
||||
VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz);
|
||||
o.pos = vertexInput.positionCS;
|
||||
o.vertexColor = v.vertexColor;
|
||||
o.uv0 = v.texcoord0;
|
||||
|
||||
return o;
|
||||
}
|
||||
inline half4 frag(Varyings i) : SV_Target
|
||||
{
|
||||
UNITY_SETUP_INSTANCE_ID(i);
|
||||
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
|
||||
|
||||
float2 uvDiffuse = i.uv0 + float2(_U, _V) * _Time.y;
|
||||
float4 diffuseTex = SAMPLE_TEXTURE2D(_Diffuse, sampler_Diffuse, TRANSFORM_TEX(uvDiffuse, _Diffuse));
|
||||
half2 sceneUVs = (i.pos.xy / _ScreenParams.xy) + (_Value * diffuseTex.a * float2(diffuseTex.r, diffuseTex.g) * i.vertexColor.a);
|
||||
|
||||
half4 mask_Var = SAMPLE_TEXTURE2D(_Mask, sampler_Mask, TRANSFORM_TEX(i.uv0, _Mask) + half2(_Mask1USpeed, _Mask1VSpeed) * _Time.y);
|
||||
half mask = ((sqrt(mask_Var.r) * _MaskUseR + mask_Var.a * (1 - _MaskUseR))) * _MaskIntensity;
|
||||
half4 sceneColor = half4(SampleSceneColor(sceneUVs), 1);
|
||||
|
||||
half alpha = mask * diffuseTex.a * i.vertexColor.a;
|
||||
|
||||
return half4(sceneColor.rgb, clamp(alpha, 0, 1));
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 33eaf7e1bb70a1646aa3485ddcfce252
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName: allshader.ab
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,443 @@
|
||||
|
||||
Shader "SGame/Particles/Effect_Multiple"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
[HideInInspector]_ValueCustomData ("颜色强度CustomData", Float) = 0
|
||||
[HideInInspector]_Value ("总颜色强度", Float) = 1
|
||||
[HideInInspector]_Color("颜色混色", Color) = (1, 1, 1, 1)
|
||||
[HideInInspector]_CutOff ("透贴开关", Float) = 0
|
||||
[HideInInspector]_CutOffAlpha("透贴Alpha阈值", Range(0, 1)) = 0
|
||||
[HideInInspector]_Texture ("基础贴图", 2D) = "white" {}
|
||||
[HideInInspector]_TexuteRorAlpha ("黑底开关", Float) = 0
|
||||
[HideInInspector]_MainTexCustomData ("基础贴图CustomData开关", Float) = 0
|
||||
[HideInInspector]_MainTexUSpeed ("基础贴图流动U", Float) = 0
|
||||
[HideInInspector]_MainTexVSpeed ("基础贴图流动V", Float) = 0
|
||||
|
||||
[Space(10)]
|
||||
[HideInInspector]_Mask ("遮罩贴图", 2D) = "white" {}
|
||||
[HideInInspector]_MaskUseR ("遮罩是否黑底", Float) = 0
|
||||
[HideInInspector]_MaskTexCustomData ("遮罩CustomData开关", Float) = 0
|
||||
[HideInInspector]_MaskTexColorSwitch ("遮罩颜色开关", Float) = 0
|
||||
[HideInInspector]_Mask_USpeed ("遮罩流动U Speed", Float) = 0
|
||||
[HideInInspector]_Mask_VSpeed ("遮罩流动V Speed", Float) = 0
|
||||
[HideInInspector]_MaskIntensity ("遮罩强度", Float) = 1
|
||||
|
||||
[Space(10)]
|
||||
[HideInInspector]_RimLight ("边缘光开关", Float) = 0
|
||||
[HideInInspector]_RimInverseToggle ("边缘光反向开关", Float) = 0
|
||||
[HideInInspector]_ColorOuter ("边缘颜色", Color) = (1, 1, 1, 1)
|
||||
[HideInInspector]_ColorInner ("内部颜色", Color) = (1, 1, 1, 1)
|
||||
[HideInInspector]_RimIntensity ("边缘强度", Float) = 1
|
||||
[HideInInspector]_TextureIntensity ("内部贴图强度", Float) = 1
|
||||
[HideInInspector]_bianyuan ("边缘光偏移", Float) = 1
|
||||
|
||||
[Space(10)]
|
||||
[HideInInspector]_Dissolve ("溶解开关", Float) = 0
|
||||
[HideInInspector]_NoiseTex("溶解图", 2D) = "white" {}
|
||||
[HideInInspector]_NoiseUSpeed ("溶解动画USpeed", Float) = 0
|
||||
[HideInInspector]_NoiseVSpeed ("溶解动画VSpeed", Float) = 0
|
||||
[Space(3)]
|
||||
[HideInInspector]_ThresholdToggle ("溶解度反向", Float) = 0
|
||||
[HideInInspector]_DissCustomData ("溶解度流动CustomData", Float) = 0
|
||||
[HideInInspector]_Threshold("溶解度", Range(-1, 3)) = 2
|
||||
[HideInInspector]_EdgeHardness ("溶解边缘硬度", Range(0, 0.5)) = 0
|
||||
[HideInInspector]_EdgeIntensity ("溶解边缘强度", Float) = 1
|
||||
[HideInInspector]_EdgeLength("溶解边缘长度", Range(0, 0.5)) = 0
|
||||
[HideInInspector]_EdgeColor("溶解边缘颜色", Color) = (0, 0, 0, 1)
|
||||
|
||||
[Space(10)]
|
||||
[HideInInspector]_DistortionCustomData ("扭曲CustomData", Float) = 0
|
||||
[HideInInspector]_Distortion ("扭曲开关", Float) = 0
|
||||
[HideInInspector]_NiuQu ("扭曲贴图", 2D) = "white" {}
|
||||
[HideInInspector]_DUspeed ("扭曲贴图动画U", Float ) = 0
|
||||
[HideInInspector]_DVsped ("扭曲贴图动画V", Float ) = 0
|
||||
[HideInInspector]_DistortUIns ("扭曲U方向强度", Float) = 1
|
||||
[HideInInspector]_DistortVIns ("扭曲V方向强度", Float) = 1
|
||||
[HideInInspector]_DistortionIntensity ("扭曲强度", Float ) = 0
|
||||
|
||||
[Space(10)]
|
||||
[HideInInspector]_Flow("流动开关", Float) = 0
|
||||
[HideInInspector]_PolarFlow ("极坐标流动开关", Float) = 0
|
||||
[HideInInspector]_FlowAddOn ("流动混合开关", Float) = 0
|
||||
[HideInInspector]_FlowColor ("流动颜色", Color) = (0, 0, 0, 1)
|
||||
[HideInInspector]_FlowStrength ("流动贴图强度", Float) = 0
|
||||
[HideInInspector]_FlowTex ("流动贴图", 2D) = "white" {}
|
||||
[HideInInspector]_FlowCustomData ("流动CustomData", Float) = 0
|
||||
[HideInInspector]_FlowUSpeed ("流动USpeed", Float) = 0
|
||||
[HideInInspector]_FlowVSpeed ("流动VSpeed", Float) = 0
|
||||
// [HideInInspector]_FlowCutPart ("极坐标流动缩放", Float) = 1
|
||||
[HideInInspector]_FlowAngularSpeed ("极坐标流动角速度", Float) = 0
|
||||
[HideInInspector]_FlowLinearSpeed ("极坐标流动线速度", Float) = 0
|
||||
|
||||
[Space(10)]
|
||||
[HideInInspector]_FlowMask ("流动遮罩贴图", 2D) = "white" {}
|
||||
[HideInInspector]_FlowMaskUseR ("流动遮罩是否黑底", Float) = 0
|
||||
[HideInInspector]_FlowMask_USpeed ("流动遮罩流动U Speed", Float) = 0
|
||||
[HideInInspector]_FlowMask_VSpeed ("流动遮罩流动V Speed", Float) = 0
|
||||
[HideInInspector]_FlowMaskIntensity ("流动遮罩强度", Float) = 1
|
||||
|
||||
//Adding 2021-0515: 顶点偏移
|
||||
[Space(10)]
|
||||
[HideInInspector]_VertOffset ("顶点偏移开关", Float) = 0
|
||||
[HideInInspector]_VertexAnimMap ("顶点动画采样图", 2D) = "Black" {}
|
||||
[HideInInspector]_VertexAnimMapUseR ("顶点采样图黑底", Float) = 0
|
||||
[HideInInspector]_VertexAnimMapFlow_U ("采样图_U", Float) = 0
|
||||
[HideInInspector]_VertexAnimMapFlow_V ("采样图_V", Float) = 0
|
||||
[HideInInspector]_VertexAnimOffset_CustomData ("采样CustomData开关", Float) = 0
|
||||
[HideInInspector]_VertexAnimIntensity ("偏移强度", Float) = 0
|
||||
[HideInInspector]_VertexAnimMapFlow_WorldPos ("世界方向偏移开关", Float) = 0
|
||||
[HideInInspector]_VertexAnimMapVec ("偏移方向向量", Vector) = (0, 0, 0, 0)
|
||||
|
||||
[HideInInspector]_VertexAnimMask ("顶点偏移遮罩", 2D) = "White" {}
|
||||
[HideInInspector]_VertexAnimMaskUseR ("顶点遮罩是否黑底", Float) = 1
|
||||
[HideInInspector]_VertexAnimMapFlowU ("偏移方向-U", Float) = 1
|
||||
[HideInInspector]_VertexAnimMapFlowV ("偏移方向-V", Float) = 1
|
||||
|
||||
[Space(15)]
|
||||
[HideInInspector] _HorizontalLine ("地平面分割线", Float) = -5000
|
||||
[HideInInspector] _HorizontalClip ("地平面切割", Float) = 0
|
||||
|
||||
[Enum(Off, 0, On, 1)]_ZRt("深度写入", Float) = 0
|
||||
[Enum(Off, 0, On, 2)] _ZTest ("深度测试", Float) = 2
|
||||
[Enum(Add, 1, Blend, 10)]_BlendMode("混合模式", Float) = 10
|
||||
[Enum(Double, 0, Front, 1, Back, 2)]_CullMode ("面剔除", Float) = 0
|
||||
|
||||
[Space(15)]
|
||||
[MaterialToggle] _DECAL ("自行贴地开关", Float) = 0
|
||||
_DecalOffset("Z轴偏移,普通为0,需要Z缩放为-0.5", Float) = -0.5
|
||||
_EffectFogFactor("特效雾效Factor", Range(0, 1)) = 0
|
||||
|
||||
[Space(15)]
|
||||
[MaterialToggle] _FADE ("深度渐变开关", Float) = 0
|
||||
_DepthFadeFactor("物体相交深度渐变", Range(1, 8)) = 0
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"IgnoreProjector"="True"
|
||||
"Queue"="Overlay"
|
||||
"RenderType"="Transparent"
|
||||
"PreviewType" = "Plane"
|
||||
"CameraCap" = "Effect"
|
||||
"RenderPipeline" = "UniversalPipeline"
|
||||
}
|
||||
Blend SrcAlpha [_BlendMode]
|
||||
Cull [_CullMode]
|
||||
ZWrite [_ZRt] ZTest [_ZTest]
|
||||
Lighting Off
|
||||
|
||||
HLSLINCLUDE
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/core.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareDepthTexture.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareOpaqueTexture.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
||||
|
||||
#include "../Base/Lighting_Base.hlsl"
|
||||
|
||||
#pragma multi_compile __ _VERTOFFSET_ON
|
||||
#pragma multi_compile __ _RIMLIGHT_ON
|
||||
#pragma multi_compile __ _DISSOLVE_ON
|
||||
#pragma multi_compile __ _DISTORTION_ON
|
||||
#pragma multi_compile __ _FLOW_ON
|
||||
#pragma multi_compile __ _POLARFLOW_ON
|
||||
#pragma multi_compile __ _CUTOFF_ON
|
||||
#pragma multi_compile __ _DECAL_ON
|
||||
#pragma multi_compile __ _FADE_ON
|
||||
|
||||
CBUFFER_START(UnityPerMaterial)
|
||||
half _bianyuan; half4 _ColorOuter; half4 _ColorInner; half _TextureIntensity;
|
||||
half _DissCustomData; half _ValueCustomData; half _FlowCustomData; half _MaskTexCustomData; half _MainTexCustomData;
|
||||
half _Value; half4 _Color; half4 _Texture_ST; half _MainTexUSpeed; half _MainTexVSpeed; half4 _Mask_ST;
|
||||
half _Mask_USpeed; half _Mask_VSpeed; half _MaskIntensity; half _MaskTexColorSwitch; half _EdgeIntensity;
|
||||
half4 _NoiseTex_ST; half _NoiseUSpeed; half _NoiseVSpeed; half _Threshold; half _EdgeLength; half4 _EdgeColor;
|
||||
half _RimInverseToggle; half _RimIntensity; half _MaskUseR; half _EdgeHardness; half _ThresholdToggle;
|
||||
half _DUspeed; half _DVsped; half _DistortionIntensity; half _DistortionCustomData;
|
||||
half4 _NiuQu_ST; half _DistortUIns; half _DistortVIns; half _BlendMode; half _TexuteRorAlpha; half4 _FlowColor; half _FlowStrength;
|
||||
half4 _FlowTex_ST; half _FlowUSpeed; half _FlowVSpeed; half _FlowAngularSpeed; half _FlowLinearSpeed; half _FlowAddOn;
|
||||
half _FlowMaskUseR; half _FlowMask_USpeed; half _FlowMask_VSpeed; half _FlowMaskIntensity; half4 _FlowMask_ST;
|
||||
|
||||
half _CutOffAlpha; half _HorizontalClip; half _HorizontalLine;
|
||||
half4 _VertexAnimMap_ST; half _VertexAnimMapUseR; half _VertexAnimMapFlow_U; half _VertexAnimMapFlow_V;
|
||||
half _VertexAnimOffset_CustomData; half _VertexAnimMapFlow_WorldPos; half4 _VertexAnimMapVec; half _VertexAnimIntensity;
|
||||
half4 _VertexAnimMask_ST; half _VertexAnimMaskUseR; half _VertexAnimMapFlowU; half _VertexAnimMapFlowV;
|
||||
half _FogMultiplier;
|
||||
|
||||
half _DecalOffset;
|
||||
half _EffectFogFactor;
|
||||
half _DepthFadeFactor;
|
||||
CBUFFER_END
|
||||
|
||||
sampler2D _Texture;
|
||||
sampler2D _Mask;
|
||||
sampler2D _NoiseTex;
|
||||
sampler2D _NiuQu;
|
||||
sampler2D _FlowTex;
|
||||
sampler2D _FlowMask;
|
||||
sampler2D _VertexAnimMap;
|
||||
sampler2D _VertexAnimMask;
|
||||
|
||||
struct VertexInput
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float3 normal : NORMAL;
|
||||
float2 texcoord0 : TEXCOORD0;
|
||||
float4 texcoord2 : TEXCOORD1;
|
||||
float4 texcoord3 : TEXCOORD2;
|
||||
half4 vertexColor : COLOR;
|
||||
};
|
||||
|
||||
struct VertexOutput
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv0 : TEXCOORD0;
|
||||
half3 worldViewDir : TEXCOORD1;
|
||||
float3 worldNormal : TEXCOORD2;
|
||||
float4 uv1 : TEXCOORD3;
|
||||
half4 uv2 : TEXCOORD4;
|
||||
half4 color : COLOR;
|
||||
half3 worldPos : TEXCOORD5;
|
||||
|
||||
float4 texCustomData : TEXCOORD6;
|
||||
|
||||
#if defined(_FADE_ON)
|
||||
float4 screenPos : TEXCOORD7;
|
||||
#endif
|
||||
|
||||
#if defined(_DECAL_ON)
|
||||
float4 viewRayOS : TEXCOORD11;
|
||||
float3 camPosOS : TEXCOORD12;
|
||||
float4 screenUV : TEXCOORD13;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
inline float3 UnityObjectToViewPos( in float3 pos )
|
||||
{
|
||||
return mul(UNITY_MATRIX_V, mul(unity_ObjectToWorld, float4(pos, 1.0))).xyz;
|
||||
}
|
||||
#define COMPUTE_EYEDEPTH(o, vert) o = -UnityObjectToViewPos( vert ).z
|
||||
|
||||
inline half2 GetPolarCoords(half2 uv, half linearSpeed, half angularSpeed, half flowPart)
|
||||
{
|
||||
half2 tempUV = uv * 2 - 1;
|
||||
half x = length(tempUV);
|
||||
half y = (atan2(tempUV.x, tempUV.y) / 6.283) + 0.5;
|
||||
half2 offset = half2(linearSpeed, angularSpeed) * _Time.y + _FlowTex_ST.zw;
|
||||
return half2(x, y) * (flowPart + _FlowTex_ST.xy) + offset;
|
||||
}
|
||||
|
||||
VertexOutput vert (VertexInput v)
|
||||
{
|
||||
VertexOutput o = (VertexOutput)0;
|
||||
|
||||
//DECAL
|
||||
#if defined(_DECAL_ON)
|
||||
o.uv1 = v.texcoord2;
|
||||
#else
|
||||
half2 uvOffsetMain = _MainTexCustomData * v.texcoord2.xy + (1 - _MainTexCustomData) * half2(_MainTexUSpeed, _MainTexVSpeed) * _Time.y;
|
||||
half2 uvOffsetMask = _MaskTexCustomData * v.texcoord2.zw + (1 - _MaskTexCustomData) * half2(_Mask_USpeed, _Mask_VSpeed) * _Time.y;
|
||||
o.uv0 = TRANSFORM_TEX(v.texcoord0, _Texture) + uvOffsetMain;
|
||||
o.uv1.xy = TRANSFORM_TEX(v.texcoord0, _NoiseTex) + half2(_NoiseUSpeed, _NoiseVSpeed) * _Time.y;
|
||||
o.uv1.zw = TRANSFORM_TEX(v.texcoord0, _Mask) + uvOffsetMask;
|
||||
o.uv2.xy = TRANSFORM_TEX(v.texcoord0, _NiuQu) + half2(_DUspeed, _DVsped) * _Time.y;
|
||||
#endif
|
||||
|
||||
o.uv2.zw = v.texcoord0;
|
||||
|
||||
#if defined(_VERTOFFSET_ON)
|
||||
float2 vertOffsetAnimUV = TRANSFORM_TEX(v.texcoord0, _VertexAnimMap) + float2(_VertexAnimMapFlow_U, _VertexAnimMapFlow_V) * _Time.y; //对顶点偏移进行采样
|
||||
float2 vertOffsetMaskUV = TRANSFORM_TEX(v.texcoord0, _VertexAnimMask) + float2(_VertexAnimMapFlowU, _VertexAnimMapFlowV) * _Time.y; //对偏移进行遮罩处理
|
||||
float4 animOffsetMap = tex2Dlod(_VertexAnimMap, float4(vertOffsetAnimUV, 1, 1));
|
||||
float4 maskOffsetMap = tex2Dlod(_VertexAnimMask, float4(vertOffsetMaskUV, 1, 1));
|
||||
|
||||
half vertAnimOffsetCut = (animOffsetMap.a * (1 - _VertexAnimMapUseR) + sqrt(animOffsetMap.r) * _VertexAnimMapUseR); //透明底或者黑底
|
||||
half vertexMaskCut = (maskOffsetMap.a * (1 - _VertexAnimMaskUseR) + sqrt(maskOffsetMap.r) * _VertexAnimMaskUseR);
|
||||
half intensityAdd = _VertexAnimOffset_CustomData * v.texcoord3.w + (1 - _VertexAnimOffset_CustomData) * _VertexAnimIntensity;
|
||||
|
||||
half3 vertOffsetNormal = vertAnimOffsetCut * normalize(v.normal.xyz);
|
||||
half3 vertOffsetworldPos = _VertexAnimMapVec.xyz * vertAnimOffsetCut;
|
||||
half3 vertOffset = lerp(vertOffsetNormal, vertOffsetworldPos, _VertexAnimMapFlow_WorldPos) * intensityAdd;
|
||||
// vertOffset *= _VertexAnimIntensity + intensityAdd;
|
||||
v.vertex.xyz += lerp(0, vertOffset, vertexMaskCut);
|
||||
#endif
|
||||
|
||||
VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz);
|
||||
VertexNormalInputs normalInput = GetVertexNormalInputs(v.normal.xyz, half4(0, 0, 0, 0));
|
||||
o.color = v.vertexColor;
|
||||
o.worldNormal = normalInput.normalWS;
|
||||
o.worldViewDir = normalize(_WorldSpaceCameraPos.xyz - mul(unity_ObjectToWorld, v.vertex));
|
||||
o.pos = vertexInput.positionCS;
|
||||
o.worldPos = mul(unity_ObjectToWorld, half4(v.vertex.xyz, 1));
|
||||
|
||||
o.texCustomData = v.texcoord3.xyzw;
|
||||
|
||||
//DECAL
|
||||
#if defined(_DECAL_ON)
|
||||
float4 positionVS = mul(UNITY_MATRIX_MV, v.vertex);
|
||||
float3 viewRayVS = positionVS.xyz;
|
||||
o.viewRayOS.w = positionVS.z;
|
||||
float4x4 ViewToObjectMatrix = mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V);
|
||||
o.viewRayOS.xyz = mul((float3x3)ViewToObjectMatrix, -viewRayVS).xyz;
|
||||
o.camPosOS = ViewToObjectMatrix._m03_m13_m23;
|
||||
o.screenUV = ComputeScreenPos(o.pos);
|
||||
#endif
|
||||
|
||||
#if defined(_FADE_ON)
|
||||
//Water
|
||||
o.screenPos = ComputeScreenPos(o.pos);
|
||||
COMPUTE_EYEDEPTH(o.screenPos.z, v.vertex.xyz);
|
||||
#endif
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag(VertexOutput i) : SV_Target
|
||||
{
|
||||
float diffZ = 1;
|
||||
#if defined(_FADE_ON)
|
||||
float sceneZ = 0;
|
||||
float partZ = max(0, i.screenPos.z - _ProjectionParams.g);
|
||||
|
||||
float sampleDepth = SAMPLE_TEXTURE2D(_CameraDepthTexture, sampler_CameraDepthTexture, i.screenPos.xy / i.screenPos.z).r;
|
||||
sampleDepth = 1.0 / (_ZBufferParams.z * sampleDepth + _ZBufferParams.w);
|
||||
sceneZ = max(0, sampleDepth - _ProjectionParams.g);
|
||||
diffZ = (sceneZ - partZ) / _DepthFadeFactor;
|
||||
#endif
|
||||
|
||||
#if defined(_DECAL_ON)
|
||||
i.viewRayOS.xyz *= rcp(i.viewRayOS.w);
|
||||
float2 uv = i.screenUV.xy / i.screenUV.w;
|
||||
float rawDepth = SAMPLE_DEPTH_TEXTURE_LOD(_CameraDepthTexture, sampler_CameraDepthTexture, uv, 0);
|
||||
float depth = LinearEyeDepth(rawDepth, _ZBufferParams);
|
||||
float3 positionOS = i.camPosOS + i.viewRayOS.xyz * depth + float3(0, 0, _DecalOffset);
|
||||
clip(float3(0.5, 0.5, 0.5) - abs(positionOS.xyz));
|
||||
|
||||
half2 uvOffsetMain = half2(_MainTexUSpeed, _MainTexVSpeed) * _Time.y;
|
||||
half2 uvOffsetMask = half2(_Mask_USpeed, _Mask_VSpeed) * _Time.y;
|
||||
i.uv0 = TRANSFORM_TEX(positionOS.xz + float2(0.5, 0.5), _Texture) + uvOffsetMain;
|
||||
i.uv1.xy = TRANSFORM_TEX(positionOS.xz + float2(0.5, 0.5), _NoiseTex) + half2(_NoiseUSpeed, _NoiseVSpeed) * _Time.y;
|
||||
i.uv1.zw = TRANSFORM_TEX(positionOS.xz + float2(0.5, 0.5), _Mask) + uvOffsetMask;
|
||||
i.uv2.xy = TRANSFORM_TEX(positionOS.xz + float2(0.5, 0.5), _NiuQu) + half2(_DUspeed, _DVsped) * _Time.y;
|
||||
|
||||
_DistortionCustomData = 0;
|
||||
_DissCustomData = 0;
|
||||
_ValueCustomData = 0;
|
||||
#endif
|
||||
|
||||
half4 _mask_var = tex2D(_Mask, i.uv1.zw);
|
||||
half4 mainTex = tex2D(_Texture, i.uv0);
|
||||
float3 worldNormal = normalize(i.worldNormal);
|
||||
|
||||
#if defined(_DISTORTION_ON) //打开扭曲
|
||||
half distortAdd = _DistortionCustomData * i.texCustomData.z + (1 - _DistortionCustomData) * _DistortionIntensity;
|
||||
half4 niuquTex = tex2D(_NiuQu, i.uv2 + half2(_DUspeed, _DVsped) * _Time.g) * distortAdd;
|
||||
mainTex = tex2D(_Texture, i.uv0 + niuquTex.rg * half2(_DistortUIns, _DistortVIns) * niuquTex.a);
|
||||
_mask_var = tex2D(_Mask, i.uv1.zw + niuquTex.rg * half2(_DistortUIns, _DistortVIns) * niuquTex.a);
|
||||
worldNormal += niuquTex.rgb;
|
||||
#endif
|
||||
half3 finalColor = mainTex.rgb;
|
||||
half alpha = 1;
|
||||
half maskCut = (_mask_var.a * (1 - _MaskUseR) + sqrt(_mask_var.r) * _MaskUseR) * _MaskIntensity;
|
||||
half mainCut = mainTex.a;
|
||||
mainCut = _TexuteRorAlpha * mainCut + (1 - _TexuteRorAlpha) * mainTex.a;
|
||||
|
||||
#if defined(_CUTOFF_ON)
|
||||
clip(mainCut - _CutOffAlpha);
|
||||
#endif
|
||||
|
||||
#if defined(_RIMLIGHT_ON) //打开边缘光
|
||||
half3 viewDirection = normalize(i.worldViewDir);
|
||||
half fresnelStrength = pow(1.002 - saturate(dot(worldNormal, viewDirection)), _bianyuan);
|
||||
fresnelStrength = fresnelStrength * (1 - _RimInverseToggle) + pow((1 - fresnelStrength), 2) * _RimInverseToggle;
|
||||
half3 reversCol = mainTex.rgb;
|
||||
half3 rimFinCol = fresnelStrength * _ColorOuter.rgb * _RimIntensity + saturate(1 - fresnelStrength) * _ColorInner.rgb * mainTex.rgb * _TextureIntensity;
|
||||
finalColor = reversCol * _RimInverseToggle * fresnelStrength + rimFinCol * (1 - _RimInverseToggle);
|
||||
alpha *= fresnelStrength * _RimInverseToggle + (1 - _RimInverseToggle) * max(fresnelStrength, _ColorInner.a);
|
||||
#endif
|
||||
|
||||
finalColor *= _Color.rgb;
|
||||
#if defined(_DISSOLVE_ON) //打开溶解
|
||||
half2 uv_dissolve = i.uv1.xy;
|
||||
#if defined(_DISTORTION_ON) //打开扭曲
|
||||
uv_dissolve += niuquTex.rg * niuquTex.a;
|
||||
#endif
|
||||
half4 noiseCol = tex2D(_NoiseTex, uv_dissolve);
|
||||
half noiseCut = sqrt(noiseCol.r * noiseCol.a);
|
||||
mainCut = (mainTex.a * (1 - _TexuteRorAlpha) + _TexuteRorAlpha * sqrt(mainTex.r)) * step(_BlendMode, 9) + mainTex.a * step(9, _BlendMode);
|
||||
|
||||
half thresholdResult = _DissCustomData * i.texCustomData.x + (1 - _DissCustomData) * _Threshold;
|
||||
thresholdResult = thresholdResult * (1 - _ThresholdToggle) + (1 - thresholdResult) * _ThresholdToggle;
|
||||
half cutout = (noiseCut - thresholdResult) * _ThresholdToggle + (thresholdResult - noiseCut) * (1 - _ThresholdToggle);
|
||||
half blend = smoothstep(_EdgeHardness, 0, cutout - _EdgeLength);
|
||||
half colCut = smoothstep(0, _EdgeHardness, cutout);
|
||||
finalColor = lerp(finalColor, _EdgeColor * _EdgeIntensity, blend).rgb;
|
||||
alpha *= colCut;
|
||||
#endif
|
||||
|
||||
#if defined(_FLOW_ON)
|
||||
half2 finalFlowUV = 0;
|
||||
#if defined(_POLARFLOW_ON)
|
||||
half2 flowUV = GetPolarCoords(i.uv2.zw, _FlowLinearSpeed, _FlowAngularSpeed, 0) + finalFlowUV;
|
||||
#else
|
||||
half2 flowUV = TRANSFORM_TEX(i.uv2.zw, _FlowTex) + half2(_FlowUSpeed, _FlowVSpeed) * _Time.y + finalFlowUV;
|
||||
#endif
|
||||
|
||||
#if defined(_DISTORTION_ON) //打开扭曲
|
||||
flowUV += niuquTex.rg * niuquTex.a;
|
||||
#endif
|
||||
|
||||
half4 flowCol = tex2D(_FlowTex, flowUV);
|
||||
half flowMask = sqrt(flowCol.r) * flowCol.a;
|
||||
finalColor = finalColor * flowMask * _FlowAddOn + finalColor * (1 - _FlowAddOn);
|
||||
mainCut = (mainTex.a * (1 - _TexuteRorAlpha) + _TexuteRorAlpha * sqrt(mainTex.r)) * step(_BlendMode, 9) + mainTex.a * step(9, _BlendMode);
|
||||
half3 flowAdd = flowCol.rgb * mainCut * _FlowColor * _FlowStrength * flowMask;
|
||||
|
||||
half4 flowMask_Var = tex2D(_FlowMask, TRANSFORM_TEX(i.uv2.zw, _FlowMask) + half2(_FlowMask_USpeed, _FlowMask_VSpeed) * _Time.y);
|
||||
half flowMaskCut = (flowMask_Var.a * (1 - _FlowMaskUseR) + sqrt(flowMask_Var.r) * _FlowMaskUseR) * _FlowMaskIntensity;
|
||||
|
||||
finalColor += flowAdd * flowMaskCut;
|
||||
alpha = alpha * flowMask * _FlowAddOn * flowMaskCut + (1 - _FlowAddOn) * alpha;
|
||||
#endif
|
||||
|
||||
alpha *= maskCut * mainCut * _Color.a;
|
||||
alpha = step(_HorizontalLine, i.worldPos.y) * alpha * _HorizontalClip + alpha * (1 - _HorizontalClip);
|
||||
|
||||
half3 valueOffset = _Value * (1 - _ValueCustomData) + _ValueCustomData * _Value * i.texCustomData.y;
|
||||
half3 colorMaskAdd = (1 - _MaskTexColorSwitch) + _MaskTexColorSwitch * _mask_var.rgb;
|
||||
|
||||
finalColor *= alpha * valueOffset * colorMaskAdd;
|
||||
|
||||
//float2 fogAtten = ComputeFogAtten(i.worldPos);
|
||||
//half2 fogAttenHalf = half2(fogAtten.x, fogAtten.y);
|
||||
finalColor.rgb = ApplyFog(finalColor.rgb,
|
||||
i.worldPos, _EffectFogFactor);
|
||||
return half4(finalColor, clamp(alpha * diffZ, 0, 1)) * i.color;
|
||||
}
|
||||
ENDHLSL
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "UniversalForward" }
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
//剔除不受 扭曲影响Pass,默认用脚本Disable掉
|
||||
Tags { "LightMode" = "ScreenDistortion" }
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
FallBack Off
|
||||
CustomEditor "RimDistortMaskFlowEditor"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 48f6aca57979f0744ac789eb7764e431
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName: allshader.ab
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user