Advertisement
Guest User

WavingGrass.shader

a guest
Mar 14th, 2016
420
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. Shader "Hidden/TerrainEngine/Details/WavingDoublePass" {
  2. Properties {
  3. _WavingTint ("Fade Color", Color) = (.7,.6,.5, 0)
  4. _MainTex ("Base (RGB) Alpha (A)", 2D) = "white" {}
  5. _WaveAndDistance ("Wave and distance", Vector) = (12, 3.6, 1, 1)
  6. }
  7.  
  8. SubShader {
  9. Tags {
  10. "Queue" = "Transparent+200"
  11. "IgnoreProjector"="True"
  12. "RenderType"="Grass"
  13. }
  14. Cull Off
  15. LOD 200
  16. ColorMask RGB
  17.  
  18. CGPROGRAM
  19. #pragma surface surf Lambert vertex:WavingGrassVert alpha
  20. #pragma exclude_renderers flash
  21. #include "TerrainEngine.cginc"
  22.  
  23. sampler2D _MainTex;
  24.  
  25. struct Input {
  26. float2 uv_MainTex;
  27. fixed4 color : COLOR;
  28. };
  29.  
  30. void surf (Input IN, inout SurfaceOutput o) {
  31. fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * IN.color;
  32. o.Albedo = c.rgb;
  33. o.Alpha = c.a * IN.color.a;
  34. }
  35. ENDCG
  36. }
  37.  
  38. SubShader {
  39. Tags {
  40. "Queue" = "Transparent+200"
  41. "IgnoreProjector"="True"
  42. "RenderType"="Grass"
  43. }
  44. Cull Off
  45. LOD 200
  46. ColorMask RGB
  47.  
  48. Pass {
  49. Tags { "LightMode" = "Vertex" }
  50. Material {
  51. Diffuse (1,1,1,1)
  52. Ambient (1,1,1,1)
  53. }
  54. Lighting On
  55. ColorMaterial AmbientAndDiffuse
  56. AlphaTest Greater [_Cutoff]
  57. SetTexture [_MainTex] { combine texture * primary DOUBLE, texture }
  58. }
  59. Pass {
  60. Tags { "LightMode" = "VertexLMRGBM" }
  61. AlphaTest Greater [_Cutoff]
  62. BindChannels {
  63. Bind "Vertex", vertex
  64. Bind "texcoord1", texcoord0 // lightmap uses 2nd uv
  65. Bind "texcoord", texcoord1 // main uses 1st uv
  66. }
  67. SetTexture [unity_Lightmap] {
  68. matrix [unity_LightmapMatrix]
  69. combine texture * texture alpha DOUBLE
  70. }
  71. SetTexture [_MainTex] { combine texture * previous QUAD, texture }
  72. }
  73. }
  74.  
  75. Fallback Off
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement