Guest User

Untitled

a guest
Jan 24th, 2018
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. Shader "Smkgames/Wind Shader" {
  2. Properties{
  3. _MainTex("Albedo and alpha (RGBA)", 2D) = "white" {}
  4. _BumpTex("BumpTex",2D) = "bump"{}
  5. _WindMap ("WindMap", 2D) = "white" {} // Add noies map like fbm noises
  6. _Cutoff ("Cutoff", Range(0,1)) = 0.5
  7. _Speed("Speed",float) = 1
  8. _Direction("Direction",Vector) = (0,0.2,0,0)
  9. }
  10.  
  11. SubShader{
  12. Cull Off
  13.  
  14. Tags{ "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "TransparentCutout" "DisableBatching"="True" }
  15. LOD 200
  16.  
  17. CGPROGRAM
  18. #pragma surface surf Standard alphatest:_Cutoff vertex:vert
  19.  
  20. #pragma target 3.0
  21.  
  22. sampler2D _MainTex,_WindMap,_BumpTex;
  23. fixed4 _Direction;
  24. fixed _Speed, _WindAmount;
  25. half _Glossiness, _Metallic;
  26. fixed4 _Color;
  27.  
  28. void vert(inout appdata_full v) {
  29. float4 tex = tex2Dlod(_WindMap, float4(v.texcoord.xy + (_Time.x * _Speed), 0, 0));
  30. v.vertex.xyz += tex.y * _Direction.xyz * _Speed;
  31. }
  32.  
  33. struct Input {
  34. float2 uv_MainTex;
  35. float2 uv_BumpTex;
  36. };
  37.  
  38. void surf(Input IN, inout SurfaceOutputStandard o) {
  39. fixed4 c = tex2D(_MainTex, IN.uv_MainTex);
  40. o.Albedo = c.rgb;
  41. o.Alpha = c.a;
  42. o.Normal = UnpackNormal(tex2D(_BumpTex,IN.uv_BumpTex));
  43. }
  44. ENDCG
  45. }
  46. FallBack "VertexLit"
  47. }
Add Comment
Please, Sign In to add comment