Lit.shader 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570
  1. Shader "Universal Render Pipeline/Lit"
  2. {
  3. Properties
  4. {
  5. // Specular vs Metallic workflow
  6. [HideInInspector] _WorkflowMode("WorkflowMode", Float) = 1.0
  7. [MainTexture] _BaseMap("Albedo", 2D) = "white" {}
  8. [MainColor] _BaseColor("Color", Color) = (1,1,1,1)
  9. _Cutoff("Alpha Cutoff", Range(0.0, 1.0)) = 0.5
  10. _Smoothness("Smoothness", Range(0.0, 1.0)) = 0.5
  11. _GlossMapScale("Smoothness Scale", Range(0.0, 1.0)) = 1.0
  12. _SmoothnessTextureChannel("Smoothness texture channel", Float) = 0
  13. _Metallic("Metallic", Range(0.0, 1.0)) = 0.0
  14. _MetallicGlossMap("Metallic", 2D) = "white" {}
  15. _SpecColor("Specular", Color) = (0.2, 0.2, 0.2)
  16. _SpecGlossMap("Specular", 2D) = "white" {}
  17. [ToggleOff] _SpecularHighlights("Specular Highlights", Float) = 1.0
  18. [ToggleOff] _EnvironmentReflections("Environment Reflections", Float) = 1.0
  19. _BumpScale("Scale", Float) = 1.0
  20. _BumpMap("Normal Map", 2D) = "bump" {}
  21. _Parallax("Scale", Range(0.005, 0.08)) = 0.005
  22. _ParallaxMap("Height Map", 2D) = "black" {}
  23. _OcclusionStrength("Strength", Range(0.0, 1.0)) = 1.0
  24. _OcclusionMap("Occlusion", 2D) = "white" {}
  25. [HDR] _EmissionColor("Color", Color) = (0,0,0)
  26. _EmissionMap("Emission", 2D) = "white" {}
  27. _DetailMask("Detail Mask", 2D) = "white" {}
  28. _DetailAlbedoMapScale("Scale", Range(0.0, 2.0)) = 1.0
  29. _DetailAlbedoMap("Detail Albedo x2", 2D) = "linearGrey" {}
  30. _DetailNormalMapScale("Scale", Range(0.0, 2.0)) = 1.0
  31. [Normal] _DetailNormalMap("Normal Map", 2D) = "bump" {}
  32. // SRP batching compatibility for Clear Coat (Not used in Lit)
  33. [HideInInspector] _ClearCoatMask("_ClearCoatMask", Float) = 0.0
  34. [HideInInspector] _ClearCoatSmoothness("_ClearCoatSmoothness", Float) = 0.0
  35. // Blending state
  36. [HideInInspector] _Surface("__surface", Float) = 0.0
  37. [HideInInspector] _Blend("__blend", Float) = 0.0
  38. [HideInInspector] _AlphaClip("__clip", Float) = 0.0
  39. [HideInInspector] _SrcBlend("__src", Float) = 1.0
  40. [HideInInspector] _DstBlend("__dst", Float) = 0.0
  41. [HideInInspector] _ZWrite("__zw", Float) = 1.0
  42. [HideInInspector] _Cull("__cull", Float) = 2.0
  43. _ReceiveShadows("Receive Shadows", Float) = 1.0
  44. // Editmode props
  45. [HideInInspector] _QueueOffset("Queue offset", Float) = 0.0
  46. // ObsoleteProperties
  47. [HideInInspector] _MainTex("BaseMap", 2D) = "white" {}
  48. [HideInInspector] _Color("Base Color", Color) = (1, 1, 1, 1)
  49. [HideInInspector] _GlossMapScale("Smoothness", Float) = 0.0
  50. [HideInInspector] _Glossiness("Smoothness", Float) = 0.0
  51. [HideInInspector] _GlossyReflections("EnvironmentReflections", Float) = 0.0
  52. [HideInInspector][NoScaleOffset]unity_Lightmaps("unity_Lightmaps", 2DArray) = "" {}
  53. [HideInInspector][NoScaleOffset]unity_LightmapsInd("unity_LightmapsInd", 2DArray) = "" {}
  54. [HideInInspector][NoScaleOffset]unity_ShadowMasks("unity_ShadowMasks", 2DArray) = "" {}
  55. }
  56. SubShader
  57. {
  58. // Universal Pipeline tag is required. If Universal render pipeline is not set in the graphics settings
  59. // this Subshader will fail. One can add a subshader below or fallback to Standard built-in to make this
  60. // material work with both Universal Render Pipeline and Builtin Unity Pipeline
  61. Tags{"RenderType" = "Opaque" "RenderPipeline" = "UniversalPipeline" "UniversalMaterialType" = "Lit" "IgnoreProjector" = "True" "ShaderModel"="4.5"}
  62. LOD 300
  63. // ------------------------------------------------------------------
  64. // Forward pass. Shades all light in a single pass. GI + emission + Fog
  65. Pass
  66. {
  67. // Lightmode matches the ShaderPassName set in UniversalRenderPipeline.cs. SRPDefaultUnlit and passes with
  68. // no LightMode tag are also rendered by Universal Render Pipeline
  69. Name "ForwardLit"
  70. Tags{"LightMode" = "UniversalForward"}
  71. Blend[_SrcBlend][_DstBlend]
  72. ZWrite[_ZWrite]
  73. Cull[_Cull]
  74. HLSLPROGRAM
  75. #pragma exclude_renderers gles gles3 glcore
  76. #pragma target 4.5
  77. // -------------------------------------
  78. // Material Keywords
  79. #pragma shader_feature_local _NORMALMAP
  80. #pragma shader_feature_local_fragment _ALPHATEST_ON
  81. #pragma shader_feature_local_fragment _ALPHAPREMULTIPLY_ON
  82. #pragma shader_feature_local_fragment _EMISSION
  83. #pragma shader_feature_local_fragment _METALLICSPECGLOSSMAP
  84. #pragma shader_feature_local_fragment _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
  85. #pragma shader_feature_local_fragment _OCCLUSIONMAP
  86. #pragma shader_feature_local _PARALLAXMAP
  87. #pragma shader_feature_local _ _DETAIL_MULX2 _DETAIL_SCALED
  88. #pragma shader_feature_local_fragment _SPECULARHIGHLIGHTS_OFF
  89. #pragma shader_feature_local_fragment _ENVIRONMENTREFLECTIONS_OFF
  90. #pragma shader_feature_local_fragment _SPECULAR_SETUP
  91. #pragma shader_feature_local _RECEIVE_SHADOWS_OFF
  92. // -------------------------------------
  93. // Universal Pipeline keywords
  94. #pragma multi_compile _ _MAIN_LIGHT_SHADOWS
  95. #pragma multi_compile _ _MAIN_LIGHT_SHADOWS_CASCADE
  96. #pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
  97. #pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS
  98. #pragma multi_compile_fragment _ _SHADOWS_SOFT
  99. #pragma multi_compile_fragment _ _SCREEN_SPACE_OCCLUSION
  100. #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING
  101. #pragma multi_compile _ SHADOWS_SHADOWMASK
  102. // -------------------------------------
  103. // Unity defined keywords
  104. #pragma multi_compile _ DIRLIGHTMAP_COMBINED
  105. #pragma multi_compile _ LIGHTMAP_ON
  106. #pragma multi_compile_fog
  107. //--------------------------------------
  108. // GPU Instancing
  109. #pragma multi_compile_instancing
  110. #pragma multi_compile _ DOTS_INSTANCING_ON
  111. #pragma vertex LitPassVertex
  112. #pragma fragment LitPassFragment
  113. #include "Packages/com.unity.render-pipelines.universal/Shaders/LitInput.hlsl"
  114. #include "Packages/com.unity.render-pipelines.universal/Shaders/LitForwardPass.hlsl"
  115. ENDHLSL
  116. }
  117. Pass
  118. {
  119. Name "ShadowCaster"
  120. Tags{"LightMode" = "ShadowCaster"}
  121. ZWrite On
  122. ZTest LEqual
  123. ColorMask 0
  124. Cull[_Cull]
  125. HLSLPROGRAM
  126. #pragma exclude_renderers gles gles3 glcore
  127. #pragma target 4.5
  128. // -------------------------------------
  129. // Material Keywords
  130. #pragma shader_feature_local_fragment _ALPHATEST_ON
  131. #pragma shader_feature_local_fragment _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
  132. //--------------------------------------
  133. // GPU Instancing
  134. #pragma multi_compile_instancing
  135. #pragma multi_compile _ DOTS_INSTANCING_ON
  136. #pragma vertex ShadowPassVertex
  137. #pragma fragment ShadowPassFragment
  138. #include "Packages/com.unity.render-pipelines.universal/Shaders/LitInput.hlsl"
  139. #include "Packages/com.unity.render-pipelines.universal/Shaders/ShadowCasterPass.hlsl"
  140. ENDHLSL
  141. }
  142. Pass
  143. {
  144. // Lightmode matches the ShaderPassName set in UniversalRenderPipeline.cs. SRPDefaultUnlit and passes with
  145. // no LightMode tag are also rendered by Universal Render Pipeline
  146. Name "GBuffer"
  147. Tags{"LightMode" = "UniversalGBuffer"}
  148. ZWrite[_ZWrite]
  149. ZTest LEqual
  150. Cull[_Cull]
  151. HLSLPROGRAM
  152. #pragma exclude_renderers gles gles3 glcore
  153. #pragma target 4.5
  154. // -------------------------------------
  155. // Material Keywords
  156. #pragma shader_feature_local _NORMALMAP
  157. #pragma shader_feature_local_fragment _ALPHATEST_ON
  158. //#pragma shader_feature_local_fragment _ALPHAPREMULTIPLY_ON
  159. #pragma shader_feature_local_fragment _EMISSION
  160. #pragma shader_feature_local_fragment _METALLICSPECGLOSSMAP
  161. #pragma shader_feature_local_fragment _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
  162. #pragma shader_feature_local_fragment _OCCLUSIONMAP
  163. #pragma shader_feature_local _PARALLAXMAP
  164. #pragma shader_feature_local _ _DETAIL_MULX2 _DETAIL_SCALED
  165. #pragma shader_feature_local_fragment _SPECULARHIGHLIGHTS_OFF
  166. #pragma shader_feature_local_fragment _ENVIRONMENTREFLECTIONS_OFF
  167. #pragma shader_feature_local_fragment _SPECULAR_SETUP
  168. #pragma shader_feature_local _RECEIVE_SHADOWS_OFF
  169. // -------------------------------------
  170. // Universal Pipeline keywords
  171. #pragma multi_compile _ _MAIN_LIGHT_SHADOWS
  172. #pragma multi_compile _ _MAIN_LIGHT_SHADOWS_CASCADE
  173. //#pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
  174. //#pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS
  175. #pragma multi_compile _ _SHADOWS_SOFT
  176. #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE
  177. // -------------------------------------
  178. // Unity defined keywords
  179. #pragma multi_compile _ DIRLIGHTMAP_COMBINED
  180. #pragma multi_compile _ LIGHTMAP_ON
  181. #pragma multi_compile_fragment _ _GBUFFER_NORMALS_OCT
  182. //--------------------------------------
  183. // GPU Instancing
  184. #pragma multi_compile_instancing
  185. #pragma multi_compile _ DOTS_INSTANCING_ON
  186. #pragma vertex LitGBufferPassVertex
  187. #pragma fragment LitGBufferPassFragment
  188. #include "Packages/com.unity.render-pipelines.universal/Shaders/LitInput.hlsl"
  189. #include "Packages/com.unity.render-pipelines.universal/Shaders/LitGBufferPass.hlsl"
  190. ENDHLSL
  191. }
  192. Pass
  193. {
  194. Name "DepthOnly"
  195. Tags{"LightMode" = "DepthOnly"}
  196. ZWrite On
  197. ColorMask 0
  198. Cull[_Cull]
  199. HLSLPROGRAM
  200. #pragma exclude_renderers gles gles3 glcore
  201. #pragma target 4.5
  202. #pragma vertex DepthOnlyVertex
  203. #pragma fragment DepthOnlyFragment
  204. // -------------------------------------
  205. // Material Keywords
  206. #pragma shader_feature_local_fragment _ALPHATEST_ON
  207. #pragma shader_feature_local_fragment _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
  208. //--------------------------------------
  209. // GPU Instancing
  210. #pragma multi_compile_instancing
  211. #pragma multi_compile _ DOTS_INSTANCING_ON
  212. #include "Packages/com.unity.render-pipelines.universal/Shaders/LitInput.hlsl"
  213. #include "Packages/com.unity.render-pipelines.universal/Shaders/DepthOnlyPass.hlsl"
  214. ENDHLSL
  215. }
  216. // This pass is used when drawing to a _CameraNormalsTexture texture
  217. Pass
  218. {
  219. Name "DepthNormals"
  220. Tags{"LightMode" = "DepthNormals"}
  221. ZWrite On
  222. Cull[_Cull]
  223. HLSLPROGRAM
  224. #pragma exclude_renderers gles gles3 glcore
  225. #pragma target 4.5
  226. #pragma vertex DepthNormalsVertex
  227. #pragma fragment DepthNormalsFragment
  228. // -------------------------------------
  229. // Material Keywords
  230. #pragma shader_feature_local _NORMALMAP
  231. #pragma shader_feature_local_fragment _ALPHATEST_ON
  232. #pragma shader_feature_local_fragment _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
  233. //--------------------------------------
  234. // GPU Instancing
  235. #pragma multi_compile_instancing
  236. #pragma multi_compile _ DOTS_INSTANCING_ON
  237. #include "Packages/com.unity.render-pipelines.universal/Shaders/LitInput.hlsl"
  238. #include "Packages/com.unity.render-pipelines.universal/Shaders/DepthNormalsPass.hlsl"
  239. ENDHLSL
  240. }
  241. // This pass it not used during regular rendering, only for lightmap baking.
  242. Pass
  243. {
  244. Name "Meta"
  245. Tags{"LightMode" = "Meta"}
  246. Cull Off
  247. HLSLPROGRAM
  248. #pragma exclude_renderers gles gles3 glcore
  249. #pragma target 4.5
  250. #pragma vertex UniversalVertexMeta
  251. #pragma fragment UniversalFragmentMeta
  252. #pragma shader_feature_local_fragment _SPECULAR_SETUP
  253. #pragma shader_feature_local_fragment _EMISSION
  254. #pragma shader_feature_local_fragment _METALLICSPECGLOSSMAP
  255. #pragma shader_feature_local_fragment _ALPHATEST_ON
  256. #pragma shader_feature_local_fragment _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
  257. #pragma shader_feature_local _ _DETAIL_MULX2 _DETAIL_SCALED
  258. #pragma shader_feature_local_fragment _SPECGLOSSMAP
  259. #include "Packages/com.unity.render-pipelines.universal/Shaders/LitInput.hlsl"
  260. #include "Packages/com.unity.render-pipelines.universal/Shaders/LitMetaPass.hlsl"
  261. ENDHLSL
  262. }
  263. Pass
  264. {
  265. Name "Universal2D"
  266. Tags{ "LightMode" = "Universal2D" }
  267. Blend[_SrcBlend][_DstBlend]
  268. ZWrite[_ZWrite]
  269. Cull[_Cull]
  270. HLSLPROGRAM
  271. #pragma exclude_renderers gles gles3 glcore
  272. #pragma target 4.5
  273. #pragma vertex vert
  274. #pragma fragment frag
  275. #pragma shader_feature_local_fragment _ALPHATEST_ON
  276. #pragma shader_feature_local_fragment _ALPHAPREMULTIPLY_ON
  277. #include "Packages/com.unity.render-pipelines.universal/Shaders/LitInput.hlsl"
  278. #include "Packages/com.unity.render-pipelines.universal/Shaders/Utils/Universal2D.hlsl"
  279. ENDHLSL
  280. }
  281. }
  282. SubShader
  283. {
  284. // Universal Pipeline tag is required. If Universal render pipeline is not set in the graphics settings
  285. // this Subshader will fail. One can add a subshader below or fallback to Standard built-in to make this
  286. // material work with both Universal Render Pipeline and Builtin Unity Pipeline
  287. Tags{"RenderType" = "Opaque" "RenderPipeline" = "UniversalPipeline" "UniversalMaterialType" = "Lit" "IgnoreProjector" = "True" "ShaderModel"="2.0"}
  288. LOD 300
  289. // ------------------------------------------------------------------
  290. // Forward pass. Shades all light in a single pass. GI + emission + Fog
  291. Pass
  292. {
  293. // Lightmode matches the ShaderPassName set in UniversalRenderPipeline.cs. SRPDefaultUnlit and passes with
  294. // no LightMode tag are also rendered by Universal Render Pipeline
  295. Name "ForwardLit"
  296. Tags{"LightMode" = "UniversalForward"}
  297. Blend[_SrcBlend][_DstBlend]
  298. ZWrite[_ZWrite]
  299. Cull[_Cull]
  300. HLSLPROGRAM
  301. #pragma only_renderers gles gles3 glcore d3d11
  302. #pragma target 2.0
  303. //--------------------------------------
  304. // GPU Instancing
  305. #pragma multi_compile_instancing
  306. // -------------------------------------
  307. // Material Keywords
  308. #pragma shader_feature_local _NORMALMAP
  309. #pragma shader_feature_local_fragment _ALPHATEST_ON
  310. #pragma shader_feature_local_fragment _ALPHAPREMULTIPLY_ON
  311. #pragma shader_feature_local_fragment _EMISSION
  312. #pragma shader_feature_local_fragment _METALLICSPECGLOSSMAP
  313. #pragma shader_feature_local_fragment _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
  314. #pragma shader_feature_local_fragment _OCCLUSIONMAP
  315. #pragma shader_feature_local _PARALLAXMAP
  316. #pragma shader_feature_local _ _DETAIL_MULX2 _DETAIL_SCALED
  317. #pragma shader_feature_local_fragment _SPECULARHIGHLIGHTS_OFF
  318. #pragma shader_feature_local_fragment _ENVIRONMENTREFLECTIONS_OFF
  319. #pragma shader_feature_local_fragment _SPECULAR_SETUP
  320. #pragma shader_feature_local _RECEIVE_SHADOWS_OFF
  321. // -------------------------------------
  322. // Universal Pipeline keywords
  323. #pragma multi_compile _ _MAIN_LIGHT_SHADOWS
  324. #pragma multi_compile _ _MAIN_LIGHT_SHADOWS_CASCADE
  325. #pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
  326. #pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS
  327. #pragma multi_compile_fragment _ _SHADOWS_SOFT
  328. #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING
  329. #pragma multi_compile _ SHADOWS_SHADOWMASK
  330. #pragma multi_compile_fragment _ _SCREEN_SPACE_OCCLUSION
  331. // -------------------------------------
  332. // Unity defined keywords
  333. #pragma multi_compile _ DIRLIGHTMAP_COMBINED
  334. #pragma multi_compile _ LIGHTMAP_ON
  335. #pragma multi_compile_fog
  336. #pragma vertex LitPassVertex
  337. #pragma fragment LitPassFragment
  338. #include "Packages/com.unity.render-pipelines.universal/Shaders/LitInput.hlsl"
  339. #include "Packages/com.unity.render-pipelines.universal/Shaders/LitForwardPass.hlsl"
  340. ENDHLSL
  341. }
  342. Pass
  343. {
  344. Name "ShadowCaster"
  345. Tags{"LightMode" = "ShadowCaster"}
  346. ZWrite On
  347. ZTest LEqual
  348. ColorMask 0
  349. Cull[_Cull]
  350. HLSLPROGRAM
  351. #pragma only_renderers gles gles3 glcore d3d11
  352. #pragma target 2.0
  353. //--------------------------------------
  354. // GPU Instancing
  355. #pragma multi_compile_instancing
  356. // -------------------------------------
  357. // Material Keywords
  358. #pragma shader_feature_local_fragment _ALPHATEST_ON
  359. #pragma shader_feature_local_fragment _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
  360. #pragma vertex ShadowPassVertex
  361. #pragma fragment ShadowPassFragment
  362. #include "Packages/com.unity.render-pipelines.universal/Shaders/LitInput.hlsl"
  363. #include "Packages/com.unity.render-pipelines.universal/Shaders/ShadowCasterPass.hlsl"
  364. ENDHLSL
  365. }
  366. Pass
  367. {
  368. Name "DepthOnly"
  369. Tags{"LightMode" = "DepthOnly"}
  370. ZWrite On
  371. ColorMask 0
  372. Cull[_Cull]
  373. HLSLPROGRAM
  374. #pragma only_renderers gles gles3 glcore d3d11
  375. #pragma target 2.0
  376. //--------------------------------------
  377. // GPU Instancing
  378. #pragma multi_compile_instancing
  379. #pragma vertex DepthOnlyVertex
  380. #pragma fragment DepthOnlyFragment
  381. // -------------------------------------
  382. // Material Keywords
  383. #pragma shader_feature_local_fragment _ALPHATEST_ON
  384. #pragma shader_feature_local_fragment _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
  385. #include "Packages/com.unity.render-pipelines.universal/Shaders/LitInput.hlsl"
  386. #include "Packages/com.unity.render-pipelines.universal/Shaders/DepthOnlyPass.hlsl"
  387. ENDHLSL
  388. }
  389. // This pass is used when drawing to a _CameraNormalsTexture texture
  390. Pass
  391. {
  392. Name "DepthNormals"
  393. Tags{"LightMode" = "DepthNormals"}
  394. ZWrite On
  395. Cull[_Cull]
  396. HLSLPROGRAM
  397. #pragma only_renderers gles gles3 glcore d3d11
  398. #pragma target 2.0
  399. #pragma vertex DepthNormalsVertex
  400. #pragma fragment DepthNormalsFragment
  401. // -------------------------------------
  402. // Material Keywords
  403. #pragma shader_feature_local _NORMALMAP
  404. #pragma shader_feature_local_fragment _ALPHATEST_ON
  405. #pragma shader_feature_local_fragment _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
  406. //--------------------------------------
  407. // GPU Instancing
  408. #pragma multi_compile_instancing
  409. #include "Packages/com.unity.render-pipelines.universal/Shaders/LitInput.hlsl"
  410. #include "Packages/com.unity.render-pipelines.universal/Shaders/DepthNormalsPass.hlsl"
  411. ENDHLSL
  412. }
  413. // This pass it not used during regular rendering, only for lightmap baking.
  414. Pass
  415. {
  416. Name "Meta"
  417. Tags{"LightMode" = "Meta"}
  418. Cull Off
  419. HLSLPROGRAM
  420. #pragma only_renderers gles gles3 glcore d3d11
  421. #pragma target 2.0
  422. #pragma vertex UniversalVertexMeta
  423. #pragma fragment UniversalFragmentMeta
  424. #pragma shader_feature_local_fragment _SPECULAR_SETUP
  425. #pragma shader_feature_local_fragment _EMISSION
  426. #pragma shader_feature_local_fragment _METALLICSPECGLOSSMAP
  427. #pragma shader_feature_local_fragment _ALPHATEST_ON
  428. #pragma shader_feature_local_fragment _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
  429. #pragma shader_feature_local _ _DETAIL_MULX2 _DETAIL_SCALED
  430. #pragma shader_feature_local_fragment _SPECGLOSSMAP
  431. #include "Packages/com.unity.render-pipelines.universal/Shaders/LitInput.hlsl"
  432. #include "Packages/com.unity.render-pipelines.universal/Shaders/LitMetaPass.hlsl"
  433. ENDHLSL
  434. }
  435. Pass
  436. {
  437. Name "Universal2D"
  438. Tags{ "LightMode" = "Universal2D" }
  439. Blend[_SrcBlend][_DstBlend]
  440. ZWrite[_ZWrite]
  441. Cull[_Cull]
  442. HLSLPROGRAM
  443. #pragma only_renderers gles gles3 glcore d3d11
  444. #pragma target 2.0
  445. #pragma vertex vert
  446. #pragma fragment frag
  447. #pragma shader_feature_local_fragment _ALPHATEST_ON
  448. #pragma shader_feature_local_fragment _ALPHAPREMULTIPLY_ON
  449. #include "Packages/com.unity.render-pipelines.universal/Shaders/LitInput.hlsl"
  450. #include "Packages/com.unity.render-pipelines.universal/Shaders/Utils/Universal2D.hlsl"
  451. ENDHLSL
  452. }
  453. }
  454. FallBack "Hidden/Universal Render Pipeline/FallbackError"
  455. CustomEditor "UnityEditor.Rendering.Universal.ShaderGUI.LitShader"
  456. }