Shader "Sbin/vf36" { SubShader { pass{ CGPROGRAM #pragma vertex vert #pragma fragment frag #include "UnityCG.cginc" struct v2f{ float4 pos : POSITION; float4 col : COLOR; }; v2f vert(appdata_base v){ //v.vertex.y += sin(-length(v.vertex.xz)+_Time.y)/2; v.vertex.y +=sin((v.vertex.x+v.vertex.z)+_Time.y)/2; v.vertex.y +=sin((v.vertex.x-v.vertex.z)+_Time.y)/2; v2f o; o.pos = mul(UNITY_MATRIX_MVP,v.vertex); o.col = fixed4(0,v.vertex.y,1,1); return o; } fixed4 frag(v2f v):COLOR { return v.col; } ENDCG } } }
石头丢进水里效果: xz方向水波纹效果:
时间: 2024-12-22 02:22:39