WavingGrass.shader 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
  2. Shader "Hidden/TerrainEngine/Details/UniversalPipeline/WavingDoublePass"
  3. {
  4. Properties
  5. {
  6. _WavingTint ("Fade Color", Color) = (.7,.6,.5, 0)
  7. _MainTex ("Base (RGB) Alpha (A)", 2D) = "white" {}
  8. _WaveAndDistance ("Wave and distance", Vector) = (12, 3.6, 1, 1)
  9. _Cutoff ("Cutoff", float) = 0.5
  10. }
  11. SubShader
  12. {
  13. Tags {"Queue" = "Geometry+200" "RenderType" = "Grass" "IgnoreProjector" = "True" "RenderPipeline" = "UniversalPipeline" "UniversalMaterialType" = "SimpleLit" }//"DisableBatching"="True"
  14. Cull Off
  15. LOD 200
  16. AlphaTest Greater [_Cutoff]
  17. ColorMask RGB
  18. Pass
  19. {
  20. HLSLPROGRAM
  21. #pragma target 2.0
  22. // -------------------------------------
  23. // Universal Pipeline keywords
  24. #pragma multi_compile _ _MAIN_LIGHT_SHADOWS
  25. #pragma multi_compile _ _MAIN_LIGHT_SHADOWS_CASCADE
  26. #pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
  27. #pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS
  28. #pragma multi_compile _ _SHADOWS_SOFT
  29. #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING
  30. #pragma multi_compile _ SHADOWS_SHADOWMASK
  31. #pragma multi_compile_fragment _ _SCREEN_SPACE_OCCLUSION
  32. // -------------------------------------
  33. // Unity defined keywords
  34. #pragma multi_compile _ DIRLIGHTMAP_COMBINED
  35. #pragma multi_compile _ LIGHTMAP_ON
  36. #pragma multi_compile_fog
  37. //--------------------------------------
  38. // GPU Instancing
  39. #pragma multi_compile_instancing
  40. #pragma vertex WavingGrassVert
  41. #pragma fragment LitPassFragmentGrass
  42. #define _ALPHATEST_ON
  43. #include "Packages/com.unity.render-pipelines.universal/Shaders/Terrain/WavingGrassInput.hlsl"
  44. #include "Packages/com.unity.render-pipelines.universal/Shaders/Terrain/WavingGrassPasses.hlsl"
  45. ENDHLSL
  46. }
  47. Pass
  48. {
  49. Name "DepthOnly"
  50. Tags{"LightMode" = "DepthOnly"}
  51. ZWrite On
  52. ColorMask 0
  53. Cull Off
  54. HLSLPROGRAM
  55. #pragma target 2.0
  56. #pragma vertex DepthOnlyVertex
  57. #pragma fragment DepthOnlyFragment
  58. // -------------------------------------
  59. // Material Keywords
  60. #define _ALPHATEST_ON
  61. #pragma shader_feature_local_fragment _GLOSSINESS_FROM_BASE_ALPHA
  62. //--------------------------------------
  63. // GPU Instancing
  64. #pragma multi_compile_instancing
  65. #include "Packages/com.unity.render-pipelines.universal/Shaders/Terrain/WavingGrassInput.hlsl"
  66. #include "Packages/com.unity.render-pipelines.universal/Shaders/Terrain/WavingGrassPasses.hlsl"
  67. ENDHLSL
  68. }
  69. // This pass is used when drawing to a _CameraNormalsTexture texture
  70. Pass
  71. {
  72. Name "DepthNormals"
  73. Tags{"LightMode" = "DepthNormals"}
  74. ZWrite On
  75. Cull Off
  76. HLSLPROGRAM
  77. #pragma target 2.0
  78. #pragma vertex DepthNormalOnlyVertex
  79. #pragma fragment DepthNormalOnlyFragment
  80. // -------------------------------------
  81. // Material Keywords
  82. #define _ALPHATEST_ON
  83. #pragma shader_feature_local_fragment _GLOSSINESS_FROM_BASE_ALPHA
  84. //--------------------------------------
  85. // GPU Instancing
  86. #pragma multi_compile_instancing
  87. #include "Packages/com.unity.render-pipelines.universal/Shaders/Terrain/WavingGrassInput.hlsl"
  88. #include "Packages/com.unity.render-pipelines.universal/Shaders/Terrain/WavingGrassPasses.hlsl"
  89. ENDHLSL
  90. }
  91. }
  92. }