shaoxiadiablo/Assets/AGame/Res/Shaders/MY/MYGrassWind.shader
2025-05-18 01:04:31 +08:00

52 lines
1.3 KiB
GLSL

Shader "MY/Grass/GrassWind" {
Properties{
[HDR]_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
//Cull Off
CGPROGRAM
#pragma surface surf Lambert vertex:myvert alphatest:_Cutoff
sampler2D _MainTex;
fixed4 _Color;
float _Frequency;
float4 _Intensity;
struct Input {
float2 uv_MainTex;
};
void myvert(inout appdata_full v)
{
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;
v.vertex.xyz = u_xlat0.xyz;
}
void surf(Input IN, inout SurfaceOutput o) {
fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color;
o.Albedo = c.rgb;
o.Alpha = c.a;
}
ENDCG
}
Fallback "Legacy Shaders/Transparent/Cutout/VertexLit"
}