SpeedTree7.shader 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. Shader "Universal Render Pipeline/Nature/SpeedTree7"
  2. {
  3. Properties
  4. {
  5. _Color("Main Color", Color) = (1,1,1,1)
  6. _HueVariation("Hue Variation", Color) = (1.0,0.5,0.0,0.1)
  7. _MainTex("Base (RGB) Trans (A)", 2D) = "white" {}
  8. _DetailTex("Detail", 2D) = "black" {}
  9. _BumpMap("Normal Map", 2D) = "bump" {}
  10. _Cutoff("Alpha Cutoff", Range(0,1)) = 0.333
  11. [MaterialEnum(Off,0,Front,1,Back,2)] _Cull("Cull", Int) = 2
  12. [MaterialEnum(None,0,Fastest,1,Fast,2,Better,3,Best,4,Palm,5)] _WindQuality("Wind Quality", Range(0,5)) = 0
  13. }
  14. SubShader
  15. {
  16. Tags
  17. {
  18. "Queue" = "Geometry"
  19. "IgnoreProjector" = "True"
  20. "RenderType" = "Opaque"
  21. "DisableBatching" = "LODFading"
  22. "RenderPipeline" = "UniversalPipeline"
  23. }
  24. LOD 400
  25. Cull [_Cull]
  26. Pass
  27. {
  28. Name "ForwardLit"
  29. Tags { "LightMode" = "UniversalForward" }
  30. HLSLPROGRAM
  31. #pragma vertex SpeedTree7Vert
  32. #pragma fragment SpeedTree7Frag
  33. #pragma multi_compile _ _MAIN_LIGHT_SHADOWS
  34. #pragma multi_compile _ _MAIN_LIGHT_SHADOWS_CASCADE
  35. #pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
  36. #pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS
  37. #pragma multi_compile _ _SHADOWS_SOFT
  38. #pragma multi_compile_vertex LOD_FADE_PERCENTAGE
  39. #pragma multi_compile_fog
  40. #pragma multi_compile_instancing
  41. #pragma instancing_options assumeuniformscaling maxcount:50
  42. #pragma shader_feature_local GEOM_TYPE_BRANCH GEOM_TYPE_BRANCH_DETAIL GEOM_TYPE_FROND GEOM_TYPE_LEAF GEOM_TYPE_MESH
  43. #pragma shader_feature_local EFFECT_BUMP
  44. #pragma shader_feature_local EFFECT_HUE_VARIATION
  45. #define ENABLE_WIND
  46. #define VERTEX_COLOR
  47. #include "SpeedTree7Input.hlsl"
  48. #include "SpeedTree7Passes.hlsl"
  49. ENDHLSL
  50. }
  51. Pass
  52. {
  53. Name "SceneSelectionPass"
  54. Tags{"LightMode" = "SceneSelectionPass"}
  55. ColorMask 0
  56. HLSLPROGRAM
  57. #pragma vertex SpeedTree7VertDepth
  58. #pragma fragment SpeedTree7FragDepth
  59. #pragma multi_compile_instancing
  60. #pragma instancing_options assumeuniformscaling maxcount:50
  61. #pragma shader_feature_local GEOM_TYPE_BRANCH GEOM_TYPE_BRANCH_DETAIL GEOM_TYPE_FROND GEOM_TYPE_LEAF GEOM_TYPE_MESH
  62. #define ENABLE_WIND
  63. #define DEPTH_ONLY
  64. #define SCENESELECTIONPASS
  65. #include "SpeedTree7Input.hlsl"
  66. #include "SpeedTree7Passes.hlsl"
  67. ENDHLSL
  68. }
  69. Pass
  70. {
  71. Name "ShadowCaster"
  72. Tags{"LightMode" = "ShadowCaster"}
  73. HLSLPROGRAM
  74. #pragma vertex SpeedTree7VertDepth
  75. #pragma fragment SpeedTree7FragDepth
  76. #pragma multi_compile_vertex LOD_FADE_PERCENTAGE
  77. #pragma multi_compile_instancing
  78. #pragma instancing_options assumeuniformscaling maxcount:50
  79. #pragma shader_feature_local GEOM_TYPE_BRANCH GEOM_TYPE_BRANCH_DETAIL GEOM_TYPE_FROND GEOM_TYPE_LEAF GEOM_TYPE_MESH
  80. #define ENABLE_WIND
  81. #define DEPTH_ONLY
  82. #define SHADOW_CASTER
  83. #include "SpeedTree7Input.hlsl"
  84. #include "SpeedTree7Passes.hlsl"
  85. ENDHLSL
  86. }
  87. Pass
  88. {
  89. Name "DepthOnly"
  90. Tags{"LightMode" = "DepthOnly"}
  91. ColorMask 0
  92. HLSLPROGRAM
  93. #pragma vertex SpeedTree7VertDepth
  94. #pragma fragment SpeedTree7FragDepth
  95. #pragma multi_compile_vertex LOD_FADE_PERCENTAGE
  96. #pragma multi_compile_instancing
  97. #pragma instancing_options assumeuniformscaling maxcount:50
  98. #pragma shader_feature_local GEOM_TYPE_BRANCH GEOM_TYPE_BRANCH_DETAIL GEOM_TYPE_FROND GEOM_TYPE_LEAF GEOM_TYPE_MESH
  99. #define ENABLE_WIND
  100. #define DEPTH_ONLY
  101. #include "SpeedTree7Input.hlsl"
  102. #include "SpeedTree7Passes.hlsl"
  103. ENDHLSL
  104. }
  105. }
  106. Dependency "BillboardShader" = "Universal Render Pipeline/Nature/SpeedTree7 Billboard"
  107. CustomEditor "SpeedTreeMaterialInspector"
  108. }