先修复一下,错误的场景 删除不必要的钓场资产 修复into场景 update:更新meta文件,修复报错 update:修复资源 修复第一章节建造 修复建造第三章 update:删除多余内容 update:更新README.md update:还原图标 update:更新README update:更新配置
52 lines
1.3 KiB
Plaintext
52 lines
1.3 KiB
Plaintext
Shader "Hidden/UI/SoftMask"
|
|
{
|
|
Properties
|
|
{
|
|
_MainTex ("Sprite Texture", 2D) = "white" {}
|
|
[Enum (UnityEngine.Rendering.BlendOp)] _BlendOp ("BlendOp", float) = 1
|
|
}
|
|
|
|
SubShader
|
|
{
|
|
Tags
|
|
{
|
|
"Queue"="Transparent"
|
|
"IgnoreProjector"="True"
|
|
"RenderType"="Transparent"
|
|
}
|
|
|
|
Cull Off
|
|
ZWrite Off
|
|
Blend SrcColor One
|
|
BlendOp [_BlendOp]
|
|
|
|
Pass
|
|
{
|
|
CGPROGRAM
|
|
#pragma vertex vert_img
|
|
#pragma fragment frag
|
|
#pragma target 2.0
|
|
|
|
#include "UnityCG.cginc"
|
|
|
|
sampler2D _MainTex;
|
|
float _ThresholdMin;
|
|
float _ThresholdMax;
|
|
float4 _ColorMask;
|
|
|
|
float invLerp(const float from, const float to, const float value)
|
|
{
|
|
return saturate(max(0, value - from) / max(0.000000001, to - from));
|
|
}
|
|
|
|
fixed4 frag(v2f_img i) : SV_Target
|
|
{
|
|
const half maxValue = max(_ThresholdMin, _ThresholdMax);
|
|
const half minValue = min(_ThresholdMin, _ThresholdMax);
|
|
const half alpha = invLerp(minValue, maxValue, tex2D(_MainTex, i.uv).a);
|
|
return alpha * _ColorMask;
|
|
}
|
|
ENDCG
|
|
}
|
|
}
|
|
} |