WavingGrassBillboard.shader 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
  2. Shader "Hidden/TerrainEngine/Details/UniversalPipeline/BillboardWavingDoublePass"
  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" = "GrassBillBoard" "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 _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN
  25. #pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
  26. #pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS
  27. #pragma multi_compile_fragment _ _SHADOWS_SOFT
  28. #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING
  29. #pragma multi_compile _ SHADOWS_SHADOWMASK
  30. #pragma multi_compile _ _CLUSTERED_RENDERING
  31. // -------------------------------------
  32. // Unity defined keywords
  33. #pragma multi_compile _ DIRLIGHTMAP_COMBINED
  34. #pragma multi_compile _ LIGHTMAP_ON
  35. #pragma multi_compile_fog
  36. #pragma multi_compile_fragment _ DEBUG_DISPLAY
  37. //--------------------------------------
  38. // GPU Instancing
  39. #pragma multi_compile_instancing
  40. #pragma vertex WavingGrassBillboardVert
  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. Pass
  70. {
  71. Name "DepthNormals"
  72. Tags{"LightMode" = "DepthNormals"}
  73. ZWrite On
  74. Cull Off
  75. HLSLPROGRAM
  76. #pragma target 2.0
  77. #pragma vertex DepthNormalOnlyVertex
  78. #pragma fragment DepthNormalOnlyFragment
  79. // -------------------------------------
  80. // Material Keywords
  81. #define _ALPHATEST_ON
  82. #pragma shader_feature_local_fragment _GLOSSINESS_FROM_BASE_ALPHA
  83. //--------------------------------------
  84. // GPU Instancing
  85. #pragma multi_compile_instancing
  86. #include "Packages/com.unity.render-pipelines.universal/Shaders/Terrain/WavingGrassInput.hlsl"
  87. #include "Packages/com.unity.render-pipelines.universal/Shaders/Terrain/WavingGrassDepthNormalsPass.hlsl"
  88. ENDHLSL
  89. }
  90. }
  91. }