Unity Flow distort of screen
Posted bearworks
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Unity Flow distort of screen相关的知识,希望对你有一定的参考价值。
Shader "ScreenWater" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_Field ("Field Channel", 2D) = "black" {}
_Flow ("Flow", 2D) = "black" {}
}
SubShader {
Pass {
ZTest Always Cull Off ZWrite Off Fog { Mode off }
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma fragmentoption ARB_precision_hint_fastest
#include "UnityCG.cginc"
struct v2f {
float4 pos : POSITION;
float2 uv : TEXCOORD0;
};
uniform sampler2D _MainTex;
sampler2D _Field;
sampler2D _Flow;
half _Speed;
half _Intens;
v2f vert (appdata_img v)
{
v2f o;
o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
o.uv = MultiplyUV (UNITY_MATRIX_TEXTURE0, v.texcoord);
return o;
}
half4 frag (v2f i) : COLOR
{
float t = _Time.x * _Speed;
float2 coor = i.uv ;
half4 flow = tex2D (_Flow,coor + t);
half4 fc = tex2D(_Field, i.uv) * flow;
half4 distort = fc * _Intens ;
return tex2D(_MainTex, i.uv + distort );
}
ENDCG
}
}
Fallback off
}
以上是关于Unity Flow distort of screen的主要内容,如果未能解决你的问题,请参考以下文章
The items of cash flow Classifications
The items of cash flow Classifications
The items of cash flow Classifications
css 来自https://stackoverflow.com/questions/28565976/css-how-to-overflow-from-div-to-full-width-of-scr