Lux URP Billboard.shader 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542
  1. Shader "Lux URP/Billboard"
  2. {
  3. Properties
  4. {
  5. [HeaderHelpLuxURP_URL(miywznst4xsx)]
  6. [Header(Surface Options)]
  7. [Space(8)]
  8. [Enum(UnityEngine.Rendering.CompareFunction)]
  9. _ZTest ("ZTest", Int) = 4
  10. [Enum(Tested,0,Blended,1)]
  11. _Surface ("Alpha", Float) = 0.0
  12. _Cutoff (" Threshold", Range(0.0, 1.0)) = 0.5
  13. [Enum(Transparent,0,Additive,1,SoftAdditive,2)]
  14. _Blend (" Blending", Float) = 0.0
  15. [Space(5)]
  16. [ToggleOff(_RECEIVE_SHADOWS_OFF)]
  17. _ReceiveShadows ("Receive Shadows", Float) = 1.0
  18. _ShadowOffset ("Billboard Shadow Offset", Float) = 1.0
  19. [Header(Billboard Options)]
  20. [Space(8)]
  21. [Toggle(_UPRIGHT)]
  22. _Upright ("Enable upright oriented Billboard", Float) = 0.0
  23. [Toggle(_PIVOTTOBOTTOM)]
  24. _Pivot ("Set Pivot to Bottom", Float) = 0.0
  25. _Shrink ("Expand X", Range(0.0, 1.0)) = 1.0
  26. [Header(Surface Inputs)]
  27. [MainColor]
  28. [HDR]_BaseColor ("Base Color", Color) = (1,1,1,1)
  29. [NoScaleOffset] [MainTexture]
  30. _BaseMap ("Albedo (RGB) Alpha (A)", 2D) = "white" {}
  31. [Header(Lighting)]
  32. [Space(8)]
  33. [Toggle(_NORMALMAP)]
  34. _ApplyNormal ("Enable Lighting", Float) = 0.0
  35. [Space(5)]
  36. [NoScaleOffset]
  37. _BumpMap (" Normal Map", 2D) = "bump" {}
  38. _BumpScale (" Normal Scale", Float) = 1.0
  39. _Smoothness (" Smoothness", Range(0.0, 1.0)) = 0.5
  40. _SpecColor (" Specular", Color) = (0.2, 0.2, 0.2)
  41. [Header(Fog)]
  42. [Space(8)]
  43. //[Toggle(_APPLYFOG)] _ApplyFog("Enable Fog", Float) = 1.0
  44. [Toggle] _ApplyFog ("Enable Fog", Float) = 1.0
  45. [Header(Render Queue)]
  46. [Space(8)]
  47. [IntRange] _QueueOffset ("Queue Offset", Range(-50, 50)) = 0
  48. [Header(Advanced)]
  49. [Space(8)]
  50. [ToggleOff]
  51. _SpecularHighlights ("Enable Specular Highlights", Float) = 1.0
  52. [ToggleOff]
  53. _EnvironmentReflections ("Environment Reflections", Float) = 1.0
  54. [HideInInspector] _ZWrite ("__zw", Float) = 1.0
  55. [HideInInspector] _SrcBlend ("__src", Float) = 1.0
  56. [HideInInspector] _DstBlend ("__dst", Float) = 0.0
  57. // Lightmapper and outline selection shader need _MainTex, _Color and _Cutoff
  58. [HideInInspector] _MainTex ("Albedo", 2D) = "white" {}
  59. [HideInInspector] _Color ("Color", Color) = (1,1,1,1)
  60. }
  61. SubShader
  62. {
  63. Tags
  64. {
  65. "RenderPipeline" = "UniversalPipeline"
  66. "RenderType" = "Opaque"
  67. "Queue" = "Transparent"
  68. "DisableBatching" = "True" // Has nor effet on static batching?!
  69. "PreviewType" = "Plane"
  70. }
  71. Pass
  72. {
  73. Name "ForwardLit"
  74. Tags{"LightMode" = "UniversalForward"}
  75. Blend[_SrcBlend][_DstBlend]
  76. Cull Back
  77. ZTest [_ZTest]
  78. ZWrite[_ZWrite]
  79. HLSLPROGRAM
  80. // Required to compile gles 2.0 with standard srp library
  81. #pragma prefer_hlslcc gles
  82. #pragma exclude_renderers d3d11_9x
  83. #pragma target 2.0
  84. // -------------------------------------
  85. // Material Keywords
  86. #define _SPECULAR_SETUP 1
  87. #pragma shader_feature _NORMALMAP
  88. #pragma shader_feature _ALPHATEST_ON
  89. #pragma shader_feature_local _UPRIGHT
  90. #pragma shader_feature_local _PIVOTTOBOTTOM
  91. #pragma shader_feature_local _ _APPLYFOG _APPLYFOGADDITIVELY
  92. #pragma shader_feature_local_fragment _SPECULARHIGHLIGHTS_OFF
  93. #pragma shader_feature_local_fragment _ENVIRONMENTREFLECTIONS_OFF
  94. #pragma shader_feature_local _RECEIVE_SHADOWS_OFF
  95. // -------------------------------------
  96. // Universal Pipeline keywords
  97. #pragma multi_compile _ _MAIN_LIGHT_SHADOWS
  98. #pragma multi_compile _ _MAIN_LIGHT_SHADOWS_CASCADE
  99. #pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
  100. #pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS
  101. #pragma multi_compile_fragment _ _SHADOWS_SOFT
  102. // -------------------------------------
  103. // Unity defined keywords
  104. #pragma multi_compile_fog
  105. //--------------------------------------
  106. // GPU Instancing
  107. #pragma multi_compile_instancing
  108. // #pragma multi_compile _ DOTS_INSTANCING_ON // needs shader target 4.5
  109. #pragma vertex vert
  110. #pragma fragment frag
  111. // Lighting include is needed because of GI
  112. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  113. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  114. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  115. #include "Includes/Lux URP Billboard Inputs.hlsl"
  116. struct VertexInput
  117. {
  118. float4 positionOS : POSITION;
  119. float2 texcoord : TEXCOORD0;
  120. float3 normalOS : NORMAL;
  121. float4 tangentOS : TANGENT;
  122. UNITY_VERTEX_INPUT_INSTANCE_ID
  123. };
  124. struct VertexOutput
  125. {
  126. float4 positionCS : POSITION;
  127. float2 uv : TEXCOORD0;
  128. float3 positionWS : TEXCOORD1;
  129. #if defined(_APPLYFOG) || defined (_APPLYFOGADDITIVELY)
  130. half fogCoord : TEXCOORD2;
  131. #endif
  132. #ifdef _NORMALMAP
  133. half4 normalWS : TEXCOORD3;
  134. half4 tangentWS : TEXCOORD4;
  135. half4 bitangentWS : TEXCOORD5;
  136. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  137. float4 shadowCoord : TEXCOORD6;
  138. #endif
  139. #endif
  140. UNITY_VERTEX_INPUT_INSTANCE_ID
  141. UNITY_VERTEX_OUTPUT_STEREO
  142. };
  143. VertexOutput vert (VertexInput input)
  144. {
  145. VertexOutput output = (VertexOutput)0;
  146. UNITY_SETUP_INSTANCE_ID(input);
  147. UNITY_TRANSFER_INSTANCE_ID(input, output);
  148. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
  149. // Instance world position
  150. float3 positionWS = float3(UNITY_MATRIX_M[0].w, UNITY_MATRIX_M[1].w, UNITY_MATRIX_M[2].w);
  151. half3 viewDirWS = normalize(GetCameraPositionWS() - positionWS);
  152. #if !defined(_UPRIGHT)
  153. input.positionOS.xyz = 0;
  154. #if defined(_PIVOTTOBOTTOM)
  155. input.positionOS.xy = input.texcoord.xy - float2(0.5f, 0.0f);
  156. #else
  157. input.positionOS.xy = input.texcoord.xy - 0.5;
  158. #endif
  159. input.positionOS.x *= _Shrink;
  160. float2 scale;
  161. // Using unity_ObjectToWorld may break. So we use the official function.
  162. scale.x = length(float3(UNITY_MATRIX_M[0].x, UNITY_MATRIX_M[1].x, UNITY_MATRIX_M[2].x));
  163. scale.y = length(float3(UNITY_MATRIX_M[0].y, UNITY_MATRIX_M[1].y, UNITY_MATRIX_M[2].y));
  164. //float4 positionVS = mul(UNITY_MATRIX_MV, float4(0, 0, 0, 1.0));
  165. float4 positionVS = mul(UNITY_MATRIX_V, float4(UNITY_MATRIX_M._m03_m13_m23, 1.0));
  166. positionVS.xyz += input.positionOS.xyz * float3(scale.xy, 1.0);
  167. output.positionCS = mul(UNITY_MATRIX_P, positionVS);
  168. output.positionWS = mul(UNITY_MATRIX_I_V, positionVS).xyz;
  169. // we have to make the normal point towards the cam
  170. half3 billboardTangentWS = normalize(float3(-viewDirWS.z, 0, viewDirWS.x));
  171. half3 billboardNormalWS = viewDirWS; //float3(billboardTangentWS.z, 0, -billboardTangentWS.x);
  172. // Sign!
  173. half3 billboardBitangentWS = -cross(billboardNormalWS, billboardTangentWS);
  174. #else
  175. half3 billboardTangentWS = normalize(float3(-viewDirWS.z, 0, viewDirWS.x));
  176. half3 billboardNormalWS = float3(billboardTangentWS.z, 0, -billboardTangentWS.x);
  177. // Sign!
  178. half3 billboardBitangentWS = -cross(billboardNormalWS, billboardTangentWS);
  179. // Expand Billboard
  180. float2 percent = input.texcoord.xy;
  181. float3 billboardPos = (percent.x - 0.5) * _Shrink * billboardTangentWS;
  182. #if defined(_PIVOTTOBOTTOM)
  183. billboardPos.y += percent.y;
  184. #else
  185. billboardPos.y += percent.y - 0.5;
  186. #endif
  187. output.positionWS = TransformObjectToWorld(billboardPos).xyz;
  188. output.positionCS = TransformWorldToHClip(output.positionWS);
  189. #endif
  190. output.uv = input.texcoord.xy;
  191. output.uv.x = (output.uv.x - 0.5) * _Shrink + 0.5;
  192. #ifdef _NORMALMAP
  193. // Recalulate viewDirWS
  194. viewDirWS = normalize(GetCameraPositionWS() - output.positionWS);
  195. output.normalWS = half4(billboardNormalWS, viewDirWS.x);
  196. output.tangentWS = half4(billboardTangentWS, viewDirWS.y);
  197. output.bitangentWS = half4(billboardBitangentWS, viewDirWS.z);
  198. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  199. output.shadowCoord = TransformWorldToShadowCoord(output.positionWS);
  200. #endif
  201. #endif
  202. //half3 vertexLight = VertexLighting(vertexInput.positionWS, normalInput.normalWS);
  203. //half fogFactor = ComputeFogFactor(vertexInput.positionCS.z);
  204. //output.uv = TRANSFORM_TEX(input.texcoord, _BaseMap);
  205. #if defined(_APPLYFOG) || defined(_APPLYFOGADDITIVELY)
  206. output.fogCoord = ComputeFogFactor(output.positionCS.z);
  207. #endif
  208. return output;
  209. }
  210. half4 frag (VertexOutput input ) : SV_Target
  211. {
  212. UNITY_SETUP_INSTANCE_ID(input);
  213. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
  214. half4 albedoAlpha = SampleAlbedoAlpha(input.uv, TEXTURE2D_ARGS(_BaseMap, sampler_BaseMap));
  215. half alpha = Alpha(albedoAlpha.a, _BaseColor, _Cutoff);
  216. albedoAlpha.rgb *= _BaseColor.rgb;
  217. #ifdef _NORMALMAP
  218. half3 normalTS = SampleNormal(input.uv, TEXTURE2D_ARGS(_BumpMap, sampler_BumpMap), _BumpScale);
  219. half3 normalWS = TransformTangentToWorld(normalTS, half3x3(input.tangentWS.xyz, input.bitangentWS.xyz, input.normalWS.xyz));
  220. //col.rgb = normalize(normalWS) * 0.5 + 0.5;
  221. InputData inputData = (InputData)0;
  222. inputData.positionWS = input.positionWS;
  223. inputData.normalWS = NormalizeNormalPerPixel(normalWS);
  224. inputData.viewDirectionWS = SafeNormalize(half3(input.normalWS.w, input.tangentWS.w, input.bitangentWS.w));
  225. //inputData.fogCoord = 0;
  226. //inputData.vertexLighting = 0;
  227. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  228. inputData.shadowCoord = input.shadowCoord;
  229. #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
  230. inputData.shadowCoord = TransformWorldToShadowCoord(inputData.positionWS);
  231. #else
  232. inputData.shadowCoord = float4(0, 0, 0, 0);
  233. #endif
  234. // We have to sample SH per pixel
  235. inputData.bakedGI = SampleSH(inputData.normalWS);
  236. half4 color = UniversalFragmentPBR(
  237. inputData,
  238. albedoAlpha.rgb, // albedo
  239. 0, // metallic,
  240. _SpecColor.rgb, // specular
  241. _Smoothness, // smoothness,
  242. 1.0h, // occlusion,
  243. 0, // emission,
  244. alpha // alpha
  245. );
  246. #else
  247. half4 color = albedoAlpha;
  248. #endif
  249. #if defined(_APPLYFOGADDITIVELY)
  250. color.rgb = MixFogColor(color.rgb, half3(0,0,0), input.fogCoord);
  251. #endif
  252. #if defined(_APPLYFOG)
  253. color.rgb = MixFog(color.rgb, input.fogCoord);
  254. #endif
  255. return color;
  256. }
  257. ENDHLSL
  258. }
  259. Pass
  260. {
  261. Name "ShadowCaster"
  262. Tags{"LightMode" = "ShadowCaster"}
  263. ZWrite On
  264. ZTest LEqual
  265. ColorMask 0
  266. Cull Off
  267. HLSLPROGRAM
  268. // Required to compile gles 2.0 with standard srp library
  269. #pragma prefer_hlslcc gles
  270. #pragma exclude_renderers d3d11_9x
  271. #pragma target 2.0
  272. // -------------------------------------
  273. // Material Keywords
  274. #define _ALPHATEST_ON 1
  275. #pragma shader_feature_local _UPRIGHT
  276. #pragma shader_feature_local _PIVOTTOBOTTOM
  277. //--------------------------------------
  278. // GPU Instancing
  279. #pragma multi_compile_instancing
  280. // #pragma multi_compile _ DOTS_INSTANCING_ON // needs shader target 4.5
  281. #pragma vertex ShadowPassVertex
  282. #pragma fragment ShadowPassFragment
  283. #include "Includes/Lux URP Billboard Inputs.hlsl"
  284. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl"
  285. // Shadow caster specific input
  286. float3 _LightDirection;
  287. struct VertexInput
  288. {
  289. float4 positionOS : POSITION;
  290. float2 texcoord : TEXCOORD0;
  291. UNITY_VERTEX_INPUT_INSTANCE_ID
  292. };
  293. struct VertexOutput
  294. {
  295. float4 positionCS : POSITION;
  296. float2 uv : TEXCOORD0;
  297. UNITY_VERTEX_INPUT_INSTANCE_ID
  298. UNITY_VERTEX_OUTPUT_STEREO
  299. };
  300. VertexOutput ShadowPassVertex(VertexInput input)
  301. {
  302. VertexOutput output = (VertexOutput)0;
  303. UNITY_SETUP_INSTANCE_ID(input);
  304. UNITY_TRANSFER_INSTANCE_ID(input, output);
  305. #if !defined(_UPRIGHT)
  306. input.positionOS.xyz = 0;
  307. #if defined(_PIVOTTOBOTTOM)
  308. input.positionOS.xy = input.texcoord.xy - float2(0.5f, 0.0f);
  309. #else
  310. input.positionOS.xy = input.texcoord.xy - 0.5;
  311. #endif
  312. input.positionOS.x *= _Shrink;
  313. float2 scale;
  314. scale.x = length(float3(UNITY_MATRIX_M[0].x, UNITY_MATRIX_M[1].x, UNITY_MATRIX_M[2].x));
  315. scale.y = length(float3(UNITY_MATRIX_M[0].y, UNITY_MATRIX_M[1].y, UNITY_MATRIX_M[2].y));
  316. //float4 positionVS = mul(UNITY_MATRIX_MV, float4(0, 0, 0, 1.0));
  317. float4 positionVS = mul(UNITY_MATRIX_V, float4(UNITY_MATRIX_M._m03_m13_m23, 1.0));
  318. positionVS.xyz += input.positionOS.xyz * float3(scale.xy, 1.0);
  319. float3 positionWS = mul(UNITY_MATRIX_I_V, positionVS).xyz;
  320. positionWS -= _LightDirection * _ShadowOffset;
  321. #else
  322. half3 viewDirWS = _LightDirection;
  323. half3 billboardTangentWS = normalize(float3(-viewDirWS.z, 0, viewDirWS.x));
  324. // Expand Billboard
  325. float2 percent = input.texcoord.xy;
  326. float3 billboardPos = (percent.x - 0.5) * billboardTangentWS;
  327. #if defined(_PIVOTTOBOTTOM)
  328. billboardPos.y += percent.y;
  329. #else
  330. billboardPos.y += percent.y - 0.5;
  331. #endif
  332. float3 positionWS = TransformObjectToWorld(billboardPos).xyz;
  333. positionWS -= _LightDirection * _ShadowOffset;
  334. #endif
  335. half3 normalWS = -_LightDirection;
  336. output.uv = input.texcoord;
  337. output.positionCS = TransformWorldToHClip(ApplyShadowBias(positionWS, normalWS, _LightDirection));
  338. #if UNITY_REVERSED_Z
  339. output.positionCS.z = min(output.positionCS.z, output.positionCS.w * UNITY_NEAR_CLIP_VALUE);
  340. #else
  341. output.positionCS.z = max(output.positionCS.z, output.positionCS.w * UNITY_NEAR_CLIP_VALUE);
  342. #endif
  343. return output;
  344. }
  345. half4 ShadowPassFragment(VertexOutput input) : SV_TARGET
  346. {
  347. UNITY_SETUP_INSTANCE_ID(input);
  348. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
  349. Alpha(SampleAlbedoAlpha(input.uv.xy, TEXTURE2D_ARGS(_BaseMap, sampler_BaseMap)).a, _BaseColor, _Cutoff);
  350. return 0;
  351. }
  352. ENDHLSL
  353. }
  354. Pass
  355. {
  356. Name "DepthOnly"
  357. Tags{"LightMode" = "DepthOnly"}
  358. ZWrite On
  359. ZTest [_ZTest]
  360. ColorMask 0
  361. Cull Back
  362. HLSLPROGRAM
  363. // Required to compile gles 2.0 with standard srp library
  364. #pragma prefer_hlslcc gles
  365. #pragma exclude_renderers d3d11_9x
  366. #pragma target 2.0
  367. #pragma vertex DepthOnlyVertex
  368. #pragma fragment DepthOnlyFragment
  369. // -------------------------------------
  370. // Material Keywords
  371. #define _ALPHATEST_ON 1
  372. #pragma shader_feature_local _UPRIGHT
  373. #pragma shader_feature_local _PIVOTTOBOTTOM
  374. //--------------------------------------
  375. // GPU Instancing
  376. #pragma multi_compile_instancing
  377. // #pragma multi_compile _ DOTS_INSTANCING_ON // needs shader target 4.5
  378. #include "Includes/Lux URP Billboard Inputs.hlsl"
  379. struct VertexInput
  380. {
  381. float4 positionOS : POSITION;
  382. float2 texcoord : TEXCOORD0;
  383. UNITY_VERTEX_INPUT_INSTANCE_ID
  384. };
  385. struct VertexOutput
  386. {
  387. float4 positionCS : POSITION;
  388. float2 uv : TEXCOORD0;
  389. UNITY_VERTEX_INPUT_INSTANCE_ID
  390. UNITY_VERTEX_OUTPUT_STEREO
  391. };
  392. VertexOutput DepthOnlyVertex(VertexInput input)
  393. {
  394. VertexOutput output = (VertexOutput)0;
  395. UNITY_SETUP_INSTANCE_ID(input);
  396. UNITY_TRANSFER_INSTANCE_ID(input, output);
  397. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
  398. #if !defined(_UPRIGHT)
  399. input.positionOS.xyz = 0;
  400. #if defined(_PIVOTTOBOTTOM)
  401. input.positionOS.xy = input.texcoord.xy - float2(0.5f, 0.0f);
  402. #else
  403. input.positionOS.xy = input.texcoord.xy - 0.5;
  404. #endif
  405. input.positionOS.x *= _Shrink;
  406. float2 scale;
  407. scale.x = length(float3(UNITY_MATRIX_M[0].x, UNITY_MATRIX_M[1].x, UNITY_MATRIX_M[2].x));
  408. scale.y = length(float3(UNITY_MATRIX_M[0].y, UNITY_MATRIX_M[1].y, UNITY_MATRIX_M[2].y));
  409. //float4 positionVS = mul(UNITY_MATRIX_MV, float4(0, 0, 0, 1.0));
  410. float4 positionVS = mul(UNITY_MATRIX_V, float4(UNITY_MATRIX_M._m03_m13_m23, 1.0));
  411. positionVS.xyz += input.positionOS.xyz * float3(scale.xy, 1.0);
  412. output.positionCS = mul(UNITY_MATRIX_P, positionVS);
  413. #else
  414. // Instance world position
  415. float3 positionWS = float3(UNITY_MATRIX_M[0].w, UNITY_MATRIX_M[1].w, UNITY_MATRIX_M[2].w);
  416. half3 viewDirWS = normalize(GetCameraPositionWS() - positionWS);
  417. half3 billboardTangentWS = normalize(float3(-viewDirWS.z, 0, viewDirWS.x));
  418. // Expand Billboard
  419. float2 percent = input.texcoord.xy;
  420. float3 billboardPos = (percent.x - 0.5) * billboardTangentWS;
  421. #if defined(_PIVOTTOBOTTOM)
  422. billboardPos.y += percent.y;
  423. #else
  424. billboardPos.y += percent.y - 0.5;
  425. #endif
  426. output.positionCS = TransformObjectToHClip(billboardPos);
  427. #endif
  428. output.uv = input.texcoord;
  429. return output;
  430. }
  431. half4 DepthOnlyFragment(VertexOutput input) : SV_TARGET
  432. {
  433. UNITY_SETUP_INSTANCE_ID(input);
  434. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
  435. Alpha(SampleAlbedoAlpha(input.uv, TEXTURE2D_ARGS(_BaseMap, sampler_BaseMap)).a , _BaseColor, _Cutoff);
  436. return 0;
  437. }
  438. ENDHLSL
  439. }
  440. }
  441. FallBack "Hidden/InternalErrorShader"
  442. CustomEditor "LuxURPCustomBillboardShaderGUI"
  443. }