Water Wave Effect
Shader"Custom/waterwave"{Properties {_maintex ("Base (RGB)", 2D) =" White"{} _wavestrength ("Wave Strength", Float) =0.01_wavefactor ("Wave Factor", Float) = -_timescale (" Time Scale", Float) =Ten} subshader {Pass {cgprogram#pragmaVertex vert#pragmaFragment FragstructAppData {float4 vertex:position; FLOAT2 uv:texcoord0; }; structv2f {float4 vertex:sv_position; FLOAT2 uv:texcoord0; }; Sampler2d _maintex; float_wavestrength; float_wavefactor; float_timescale; v2f Vert (AppData v) {v2f o; O.uv=V.uv; O.vertex=Mul (Unity_matrix_mvp,v.vertex); returno; } fixed4 Frag (v2f in): COLOR {fixed2 Uvdir= Normalize (In.uv-fixed2 (0.5,0.5)); fixeddis = distance (in.uv,fixed2 (0.5,0.5)); Fixed2 UV= In.uv+_wavestrength*uvdir*sin (_time.y*_timescale+dis*_wavefactor); returntex2d (_maintex, UV); } ENDCG}} FallBack"Diffuse"}
Unity3d Shader Water Wave effect