You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.0 KiB
62 lines
1.0 KiB
2 years ago
|
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||
|
|
||
|
Shader "Hidden/Fluvio/FluidEffectPreComposite" {
|
||
|
Properties {
|
||
|
_MainTex ("Base (RGBA)", 2D) = "white" {}
|
||
|
}
|
||
|
SubShader {
|
||
|
|
||
|
Pass{
|
||
|
ZTest Always
|
||
|
Cull Off
|
||
|
ZWrite Off
|
||
|
Fog { Mode Off }
|
||
|
Tags {"Queue" = "Overlay" }
|
||
|
CGPROGRAM
|
||
|
#pragma vertex vert
|
||
|
#pragma fragment frag
|
||
|
#include "UnityCG.cginc"
|
||
|
|
||
|
sampler2D _MainTex;
|
||
|
half4 _MainTex_TexelSize;
|
||
|
float _FluidThreshold;
|
||
|
|
||
|
struct v2f {
|
||
|
float4 pos : POSITION;
|
||
|
float2 uv : TEXCOORD0;
|
||
|
};
|
||
|
|
||
|
v2f vert( appdata_img v )
|
||
|
{
|
||
|
v2f o;
|
||
|
o.pos = UnityObjectToClipPos (v.vertex);
|
||
|
o.uv = v.texcoord;
|
||
|
#if UNITY_UV_STARTS_AT_TOP
|
||
|
if (_MainTex_TexelSize.y < 0)
|
||
|
o.uv.y = 1-o.uv.y;
|
||
|
#endif
|
||
|
return o;
|
||
|
}
|
||
|
|
||
|
|
||
|
float4 frag (v2f i) : COLOR
|
||
|
{
|
||
|
// Get input color
|
||
|
float4 color = tex2D(_MainTex, i.uv);
|
||
|
|
||
|
// Composite clip
|
||
|
clip(color.a - _FluidThreshold);
|
||
|
float val = color.a;
|
||
|
color.a = 1;
|
||
|
|
||
|
// Final color
|
||
|
return color;
|
||
|
}
|
||
|
|
||
|
ENDCG
|
||
|
|
||
|
}
|
||
|
}
|
||
|
Fallback Off
|
||
|
}
|