Shader "MY/Grass/UnlitGrassWind" { Properties{ _Color("Main Color", Color) = (1,1,1,1) _MainTex("Base (RGB)", 2D) = "white" {} _Cutoff("Alpha cutoff", Range(0, 1)) = 0.2 _Frequency("Frequency", Range(0, 5)) = 1 _Intensity("Intensity", Vector) = (0.4,0,0.2,0) } SubShader{ Tags {"Queue" = "AlphaTest" "IgnoreProjector" = "True" "RenderType" = "TransparentCutout"} LOD 200 Lighting Off Cull Off Pass { CGPROGRAM #pragma vertex vert #pragma fragment frag #pragma target 2.0 #pragma multi_compile_fog #include "UnityCG.cginc" struct appdata_t { float4 vertex : POSITION; float2 texcoord : TEXCOORD0; UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : SV_POSITION; float2 texcoord : TEXCOORD0; UNITY_FOG_COORDS(1) UNITY_VERTEX_OUTPUT_STEREO }; sampler2D _MainTex; float4 _MainTex_ST; fixed _Cutoff; fixed4 _Color; float _Frequency; float4 _Intensity; v2f vert(appdata_t v) { v2f o; UNITY_SETUP_INSTANCE_ID(v); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); float3 u_xlat0 = float3(0.0, 0.0, 0.0); u_xlat0.xz = v.vertex.xz; u_xlat0.x = u_xlat0.x + u_xlat0.z; u_xlat0.x = frac(u_xlat0.x); u_xlat0.y = _Time.y * _Frequency + u_xlat0.x * 6.28; u_xlat0.x = sin(u_xlat0.y); u_xlat0.z = cos(u_xlat0.y); u_xlat0.y = 0.0; float uvy = saturate(v.texcoord.y - _Intensity.w); u_xlat0.xyz = u_xlat0.xyz * uvy * uvy * 2; u_xlat0.xyz = u_xlat0.xyz * _Intensity.xyz + v.vertex.xyz; o.vertex = UnityObjectToClipPos(u_xlat0); o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); UNITY_TRANSFER_FOG(o,o.vertex); return o; } fixed4 frag(v2f i) : SV_Target { fixed4 col = tex2D(_MainTex, i.texcoord); clip(col.a - _Cutoff); col *= _Color; UNITY_APPLY_FOG(i.fogCoord, col); return col; } ENDCG } } }