Lux URP Foliage Debug.shader 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577
  1. // Shader uses custom editor to set double sided GI
  2. // Needs _Culling to be set properly
  3. Shader "Lux URP/Vegetation/Foliage Debug"
  4. {
  5. Properties
  6. {
  7. //[IntRange] _DebugColor ("Debug Vertex Color", Range(0, 4)) = 0
  8. [Enum(None,0,Red,1,Green,2,Blue,3,Alpha,4)] _DebugColor ("Debug Vertex Color", Float) = 0
  9. _Brightness ("Brightness", Float) = 1
  10. [Header(Surface Options)]
  11. [Space(5)]
  12. [Toggle(_ALPHATEST_ON)]
  13. _AlphaClip ("Alpha Clipping", Float) = 1.0
  14. _Cutoff (" Threshold", Range(0.0, 1.0)) = 0.5
  15. [ToggleOff(_RECEIVE_SHADOWS_OFF)]
  16. _ReceiveShadows ("Receive Shadows", Float) = 1.0
  17. [Header(Surface Inputs)]
  18. [Space(5)]
  19. [NoScaleOffset][MainTexture]
  20. _BaseMap ("Albedo (RGB) Alpha (A)", 2D) = "white" {}
  21. [HideInInspector][MainColor]
  22. _BaseColor ("Color", Color) = (1,1,1,1)
  23. [Space(5)]
  24. _Smoothness ("Smoothness", Range(0.0, 1.0)) = 0.5
  25. _SpecColor ("Specular", Color) = (0.2, 0.2, 0.2)
  26. [Space(5)]
  27. [Toggle(_NORMALMAP)]
  28. _ApplyNormal ("Enable Normal Smoothness Trans Map", Float) = 0.0
  29. [NoScaleOffset] _BumpSpecMap
  30. (" Normal (AG) Smoothness (B) Trans (R)", 2D) = "white" {}
  31. _GlossMapScale (" Smoothness Scale", Range(0.0, 1.0)) = 1.0
  32. [Header(Transmission)]
  33. [Space(5)]
  34. _TranslucencyPower ("Power", Range(0.0, 10.0)) = 7.0
  35. _TranslucencyStrength ("Strength", Range(0.0, 1.0)) = 1.0
  36. _ShadowStrength ("Shadow Strength", Range(0.0, 1.0)) = 0.7
  37. _Distortion ("Distortion", Range(0.0, 0.1)) = 0.01
  38. [Header(Wind)]
  39. [Space(5)]
  40. [KeywordEnum(Texture, Math)]
  41. _Wind ("Wind Input", Float) = 0
  42. [LuxURPWindFoliageDrawer]
  43. _WindMultiplier ("Wind Strength (X) Secondary Strength (Y) Edge Flutter (Z) Lod Level (W)", Vector) = (1, 2, 1, 0)
  44. _SampleSize ("Sample Size", Range(0.0, 1.0)) = 0.5
  45. [Header(Distance Fading)]
  46. [Space(5)]
  47. [LuxURPDistanceFadeDrawer]
  48. _DistanceFade ("Distance Fade Params", Vector) = (2500, 0.001, 0, 0)
  49. [Header(Advanced)]
  50. [Space(5)]
  51. [ToggleOff]
  52. _SpecularHighlights ("Enable Specular Highlights", Float) = 1.0
  53. [ToggleOff]
  54. _EnvironmentReflections ("Environment Reflections", Float) = 1.0
  55. // Needed by the inspector
  56. [HideInInspector] _Culling ("Culling", 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" = "TransparentCutout"
  67. "IgnoreProjector" = "True"
  68. "Queue"="AlphaTest"
  69. }
  70. LOD 100
  71. Pass
  72. {
  73. Tags{"LightMode" = "UniversalForward"}
  74. ZWrite On
  75. Cull Off
  76. HLSLPROGRAM
  77. // Required to compile gles 2.0 with standard SRP library
  78. #pragma prefer_hlslcc gles
  79. #pragma exclude_renderers d3d11_9x
  80. #pragma target 2.0
  81. // -------------------------------------
  82. // Material Keywords
  83. #pragma shader_feature_local _ALPHATEST_ON
  84. #define _SPECULAR_SETUP 1
  85. #pragma shader_feature _NORMALMAP
  86. #pragma shader_feature _SPECULARHIGHLIGHTS_OFF
  87. #pragma shader_feature _ENVIRONMENTREFLECTIONS_OFF
  88. #pragma shader_feature _RECEIVE_SHADOWS_OFF
  89. #pragma shader_feature_local _WIND_MATH
  90. // -------------------------------------
  91. // Lightweight Pipeline keywords
  92. #pragma multi_compile _ _MAIN_LIGHT_SHADOWS
  93. #pragma multi_compile _ _MAIN_LIGHT_SHADOWS_CASCADE
  94. #pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
  95. #pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS
  96. #pragma multi_compile _ _SHADOWS_SOFT
  97. #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE
  98. // -------------------------------------
  99. // Unity defined keywords
  100. #pragma multi_compile _ DIRLIGHTMAP_COMBINED
  101. #pragma multi_compile _ LIGHTMAP_ON
  102. #pragma multi_compile_fog
  103. //--------------------------------------
  104. // GPU Instancing
  105. #pragma multi_compile_instancing
  106. #define DEBUG
  107. // Include base inputs and all other needed "base" includes
  108. #include "Includes/Lux URP Foliage Inputs.hlsl"
  109. #pragma vertex LitPassVertex
  110. #pragma fragment LitPassFragment
  111. //--------------------------------------
  112. // Vertex shader
  113. VertexOutput LitPassVertex(VertexInput input)
  114. {
  115. VertexOutput output = (VertexOutput)0;
  116. UNITY_SETUP_INSTANCE_ID(input);
  117. UNITY_TRANSFER_INSTANCE_ID(input, output);
  118. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
  119. // Set distance fade value
  120. float3 worldInstancePos = UNITY_MATRIX_M._m03_m13_m23;
  121. float3 diff = (_WorldSpaceCameraPos - worldInstancePos);
  122. float dist = dot(diff, diff);
  123. output.fade = saturate( (_DistanceFade.x - dist) * _DistanceFade.y );
  124. // Wind in ObjectSpace -------------------------------
  125. // WEE NEED 2 samples because of offset (by phase variation)
  126. VertexPositionInputs vertexInput; // = GetVertexPositionInputs(input.positionOS.xyz);
  127. animateVertex(input.color, input.normalOS.xyz, input.positionOS.xyz);
  128. /*
  129. #if !defined(_WIND_MATH)
  130. float2 samplePos = TransformObjectToWorld(input.positionOS.xyz * _SampleSize).xz;
  131. // Bring wind into object space
  132. _LuxLWRPWindDirSize.xyz = mul(UNITY_MATRIX_I_M, float4(_LuxLWRPWindDirSize.xyz, 0)).xyz;
  133. float fVtxPhase = dot( normalize(input.positionOS.xyz), ((input.color.g + input.color.r) * 0.5).xxx );
  134. half4 wind = SAMPLE_TEXTURE2D_LOD(_LuxLWRPWindRT, sampler_LuxLWRPWindRT, samplePos.xy * _LuxLWRPWindDirSize.w - _LuxLWRPWindDirSize.xz * input.color.rr * 0, 0);
  135. float origLength = length(input.positionOS.xyz);
  136. wind.r = wind.r * wind.g;
  137. wind.r = wind.g;
  138. half3 windDir = _LuxLWRPWindDirSize.xyz;
  139. float windStrength = input.color.a * wind.r * _LuxLWRPWindStrengthMultipliers.y * _WindMultiplier.x;
  140. // Primary bending
  141. input.positionOS.xz += windDir.xz * windStrength ;
  142. // here we cant rotate...
  143. // now we can
  144. wind = SAMPLE_TEXTURE2D_LOD(_LuxLWRPWindRT, sampler_LuxLWRPWindRT, samplePos.xy * _LuxLWRPWindDirSize.w - input.color.rr * 3 , 0);
  145. // pos.xyz += ((vWavesSum.xyx * bend) + (_Wind.xyz * vWavesSum.y * animParams.w)) * _Wind.w;
  146. float3 bend = input.color.g * input.normalOS.xyz * windDir * _WindMultiplier.z * lerp(_LuxLWRPSinTime.y, _LuxLWRPSinTime.z, wind.r); //saturate(wind.b * fVtxPhase)); // saturate(wind.b + input.positionOS.x + input.positionOS.z ));
  147. bend.y = 0; //input.color.b * 0.3; // * fBranchAmp;
  148. input.positionOS.xyz += bend + ((windDir * input.color.b )) * ( wind.r * (wind.g )) * _LuxLWRPWindStrengthMultipliers.y * _WindMultiplier.y ;
  149. input.positionOS.xyz = normalize(input.positionOS.xyz) * origLength;
  150. #endif
  151. */
  152. vertexInput.positionWS = TransformObjectToWorld(input.positionOS.xyz);
  153. VertexNormalInputs normalInput = GetVertexNormalInputs(input.normalOS, input.tangentOS);
  154. // We have to recalculate ClipPos! / see: GetVertexPositionInputs in Core.hlsl
  155. vertexInput.positionVS = TransformWorldToView(vertexInput.positionWS);
  156. vertexInput.positionCS = TransformWorldToHClip(vertexInput.positionWS);
  157. float4 ndc = vertexInput.positionCS * 0.5f;
  158. vertexInput.positionNDC.xy = float2(ndc.x, ndc.y * _ProjectionParams.x) + ndc.w;
  159. vertexInput.positionNDC.zw = vertexInput.positionCS.zw;
  160. // End Wind -------------------------------
  161. half3 viewDirWS = GetCameraPositionWS() - vertexInput.positionWS;
  162. half3 vertexLight = VertexLighting(vertexInput.positionWS, normalInput.normalWS);
  163. half fogFactor = ComputeFogFactor(vertexInput.positionCS.z);
  164. output.uv.xy = input.texcoord;
  165. output.normalWS = normalInput.normalWS;
  166. output.viewDirWS = viewDirWS;
  167. #ifdef _NORMALMAP
  168. half sign = input.tangentOS.w * GetOddNegativeScale();
  169. output.tangentWS = half4(normalInput.tangentWS, sign);
  170. #endif
  171. OUTPUT_LIGHTMAP_UV(input.lightmapUV, unity_LightmapST, output.lightmapUV);
  172. #if defined(_NORMALMAP)
  173. OUTPUT_SH(output.normalWS.xyz, output.vertexSH);
  174. #else
  175. // When no normal map is applied we have to lookup SH fully per pixel
  176. output.vertexSH = 0;
  177. #endif
  178. output.fogFactorAndVertexLight = half4(fogFactor, vertexLight);
  179. #if defined(REQUIRES_WORLD_SPACE_POS_INTERPOLATOR)
  180. output.positionWS = vertexInput.positionWS;
  181. #endif
  182. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  183. output.shadowCoord = GetShadowCoord(vertexInput);
  184. #endif
  185. output.positionCS = vertexInput.positionCS;
  186. output.color = input.color;
  187. return output;
  188. }
  189. //--------------------------------------
  190. // Fragment shader and functions
  191. inline void InitializeFoliageLitSurfaceData(float2 uv, half fade, out SurfaceDescription outSurfaceData)
  192. {
  193. half4 albedoAlpha = SampleAlbedoAlpha(uv, TEXTURE2D_ARGS(_BaseMap, sampler_BaseMap));
  194. // Add fade
  195. albedoAlpha.a *= fade;
  196. // Early out
  197. outSurfaceData.alpha = Alpha(albedoAlpha.a, 1, _Cutoff);
  198. outSurfaceData.albedo = albedoAlpha.rgb;
  199. outSurfaceData.metallic = 0;
  200. outSurfaceData.specular = _SpecColor.rgb;
  201. // Normal Map
  202. #if defined (_NORMALMAP)
  203. float4 sampleNormal = SAMPLE_TEXTURE2D(_BumpSpecMap, sampler_BumpSpecMap, uv);
  204. float3 tangentNormal;
  205. tangentNormal.xy = sampleNormal.ag * 2 - 1;
  206. tangentNormal.z = sqrt(1.0 - dot(tangentNormal.xy, tangentNormal.xy));
  207. outSurfaceData.normalTS = tangentNormal;
  208. outSurfaceData.smoothness = sampleNormal.b * _GlossMapScale;
  209. outSurfaceData.translucency = sampleNormal.r;
  210. #else
  211. outSurfaceData.normalTS = float3(0, 0, 1);
  212. outSurfaceData.smoothness = _Smoothness;
  213. outSurfaceData.translucency = 1;
  214. #endif
  215. outSurfaceData.occlusion = 1;
  216. outSurfaceData.emission = 0;
  217. }
  218. void InitializeInputData(VertexOutput input, half3 normalTS, half facing, out InputData inputData)
  219. {
  220. inputData = (InputData)0;
  221. #if defined(REQUIRES_WORLD_SPACE_POS_INTERPOLATOR)
  222. inputData.positionWS = input.positionWS;
  223. #endif
  224. half3 viewDirWS = input.viewDirWS;
  225. #ifdef _NORMALMAP
  226. normalTS.z *= facing;
  227. float sgn = input.tangentWS.w; // should be either +1 or -1
  228. float3 bitangent = sgn * cross(input.normalWS.xyz, input.tangentWS.xyz);
  229. inputData.normalWS = TransformTangentToWorld(normalTS, half3x3(input.tangentWS.xyz, bitangent, input.normalWS.xyz));
  230. #else
  231. inputData.normalWS = input.normalWS * facing;
  232. #endif
  233. inputData.normalWS = NormalizeNormalPerPixel(inputData.normalWS);
  234. viewDirWS = SafeNormalize(viewDirWS);
  235. inputData.viewDirectionWS = viewDirWS;
  236. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  237. inputData.shadowCoord = input.shadowCDDDDDDDDDDDDDDDDDDDoord;
  238. #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
  239. inputData.shadowCoord = TransformWorldToShadowCoord(inputData.positionWS);
  240. #else
  241. inputData.shadowCoord = float4(0, 0, 0, 0);
  242. #endif
  243. inputData.fogCoord = input.fogFactorAndVertexLight.x;
  244. inputData.vertexLighting = input.fogFactorAndVertexLight.yzw;
  245. //
  246. #if defined(_NORMALMAP)
  247. inputData.bakedGI = SAMPLE_GI(input.lightmapUV, input.vertexSH, inputData.normalWS);
  248. #endif
  249. // Using VFACE and vertex normals – so we should sample SH fully per pixel
  250. #if !defined(_NORMALMAP) && !defined(LIGHTMAP_ON)
  251. inputData.bakedGI = SampleSH(inputData.normalWS);
  252. #endif
  253. }
  254. half4 LitPassFragment(VertexOutput input, half facing : VFACE) : SV_Target
  255. {
  256. UNITY_SETUP_INSTANCE_ID(input);
  257. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
  258. // Get the surface description
  259. SurfaceDescription surfaceData;
  260. InitializeFoliageLitSurfaceData(input.uv.xy, input.fade, surfaceData);
  261. // Prepare surface data (like bring normal into world space (incl. VFACE)) and get missing inputs like gi
  262. InputData inputData;
  263. InitializeInputData(input, surfaceData.normalTS, facing, inputData);
  264. // Apply lighting
  265. half4 color = half4(surfaceData.albedo,1);
  266. if(_DebugColor != 0)
  267. color = half4(0,0,0,1);
  268. if(_DebugColor == 1)
  269. color.r = input.color.r * _Brightness;
  270. if(_DebugColor == 2)
  271. color.g = input.color.g * _Brightness;
  272. if(_DebugColor == 3)
  273. color.b = input.color.b * _Brightness;
  274. if(_DebugColor == 4)
  275. color.rgb = input.color.aaa * _Brightness;
  276. return color;
  277. }
  278. ENDHLSL
  279. }
  280. // Shadows -----------------------------------------------------
  281. Pass
  282. {
  283. Name "ShadowCaster"
  284. Tags{"LightMode" = "ShadowCaster"}
  285. ZWrite On
  286. ZTest LEqual
  287. Cull Off
  288. HLSLPROGRAM
  289. // Required to compile gles 2.0 with standard srp library
  290. #pragma prefer_hlslcc gles
  291. #pragma exclude_renderers d3d11_9x
  292. #pragma target 3.0
  293. // -------------------------------------
  294. // Material Keywords
  295. #define _ALPHATEST_ON 1
  296. #pragma shader_feature_local _WIND_MATH
  297. //--------------------------------------
  298. // GPU Instancing
  299. #pragma multi_compile_instancing
  300. #pragma vertex ShadowPassVertex
  301. #pragma fragment ShadowPassFragment
  302. // Include base inputs and all other needed "base" includes
  303. #include "Includes/Lux URP Foliage Inputs.hlsl"
  304. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl"
  305. // Shadow caster specific input
  306. float3 _LightDirection;
  307. VertexOutput ShadowPassVertex(VertexInput input)
  308. {
  309. VertexOutput output;
  310. UNITY_SETUP_INSTANCE_ID(input);
  311. UNITY_TRANSFER_INSTANCE_ID(input, output);
  312. float3 worldInstancePos = UNITY_MATRIX_M._m03_m13_m23;
  313. float3 diff = (_WorldSpaceCameraPos - worldInstancePos);
  314. float dist = dot(diff, diff);
  315. output.fade = saturate( (_DistanceFade.x - dist) * _DistanceFade.y );
  316. output.uv = input.texcoord;
  317. // Wind in Object Space -------------------------------
  318. animateVertex(input.color, input.normalOS.xyz, input.positionOS.xyz);
  319. // End Wind -------------------------------
  320. float3 positionWS = TransformObjectToWorld(input.positionOS.xyz);
  321. float3 normalWS = TransformObjectToWorldDir(input.normalOS);
  322. output.positionCS = TransformWorldToHClip(ApplyShadowBias(positionWS, normalWS, _LightDirection));
  323. #if UNITY_REVERSED_Z
  324. output.positionCS.z = min(output.positionCS.z, output.positionCS.w * UNITY_NEAR_CLIP_VALUE);
  325. #else
  326. output.positionCS.z = max(output.positionCS.z, output.positionCS.w * UNITY_NEAR_CLIP_VALUE);
  327. #endif
  328. return output;
  329. }
  330. half4 ShadowPassFragment(VertexOutput input) : SV_TARGET
  331. {
  332. half alpha = SampleAlbedoAlpha(input.uv, TEXTURE2D_ARGS(_BaseMap, sampler_BaseMap)).a;
  333. // Works in scene view but not in GameView?
  334. alpha *= input.fade;
  335. clip(alpha - _Cutoff);
  336. return 0;
  337. }
  338. ENDHLSL
  339. }
  340. // Depth -----------------------------------------------------
  341. Pass
  342. {
  343. Tags{"LightMode" = "DepthOnly"}
  344. ZWrite On
  345. ColorMask 0
  346. Cull Off
  347. HLSLPROGRAM
  348. // Required to compile gles 2.0 with standard srp library
  349. #pragma prefer_hlslcc gles
  350. #pragma exclude_renderers d3d11_9x
  351. #pragma target 3.0
  352. #pragma vertex DepthOnlyVertex
  353. #pragma fragment DepthOnlyFragment
  354. // -------------------------------------
  355. // Material Keywords
  356. #define _ALPHATEST_ON 1
  357. #pragma shader_feature_local _WIND_MATH
  358. //--------------------------------------
  359. // GPU Instancing
  360. #pragma multi_compile_instancing
  361. #define DEPTHONLYPASS
  362. #include "Includes/Lux URP Foliage Inputs.hlsl"
  363. VertexOutput DepthOnlyVertex(VertexInput input)
  364. {
  365. VertexOutput output = (VertexOutput)0;
  366. UNITY_SETUP_INSTANCE_ID(input);
  367. UNITY_TRANSFER_INSTANCE_ID(input, output);
  368. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
  369. float3 worldInstancePos = UNITY_MATRIX_M._m03_m13_m23;
  370. float3 diff = (_WorldSpaceCameraPos - worldInstancePos);
  371. float dist = dot(diff, diff);
  372. output.fade = saturate( (_DistanceFade.x - dist) * _DistanceFade.y );
  373. // Wind in Object Space -------------------------------
  374. animateVertex(input.color, input.normalOS.xyz, input.positionOS.xyz);
  375. // End Wind -------------------------------
  376. VertexPositionInputs vertexInput;
  377. vertexInput.positionWS = TransformObjectToWorld(input.positionOS.xyz);
  378. // We have to recalculate ClipPos! / see: GetVertexPositionInputs in Core.hlsl
  379. vertexInput.positionVS = TransformWorldToView(vertexInput.positionWS);
  380. vertexInput.positionCS = TransformWorldToHClip(vertexInput.positionWS);
  381. float4 ndc = vertexInput.positionCS * 0.5f;
  382. vertexInput.positionNDC.xy = float2(ndc.x, ndc.y * _ProjectionParams.x) + ndc.w;
  383. vertexInput.positionNDC.zw = vertexInput.positionCS.zw;
  384. // End Wind -------------------------------
  385. output.uv.xy = input.texcoord;
  386. output.positionCS = vertexInput.positionCS;
  387. return output;
  388. }
  389. half4 DepthOnlyFragment(VertexOutput input) : SV_TARGET
  390. {
  391. UNITY_SETUP_INSTANCE_ID(input);
  392. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
  393. half alpha = SampleAlbedoAlpha(input.uv.xy, TEXTURE2D_ARGS(_BaseMap, sampler_BaseMap)).a;
  394. alpha *= input.fade;
  395. clip(alpha - _Cutoff);
  396. return 0;
  397. }
  398. ENDHLSL
  399. }
  400. // Meta -----------------------------------------------------
  401. Pass
  402. {
  403. Tags{"LightMode" = "Meta"}
  404. Cull Off
  405. HLSLPROGRAM
  406. // Required to compile gles 2.0 with standard srp library
  407. #pragma prefer_hlslcc gles
  408. #pragma vertex UniversalVertexMeta
  409. #pragma fragment UniversalFragmentMeta
  410. #define _SPECULAR_SETUP
  411. #define _ALPHATEST_ON 1
  412. // First include all our custom stuff
  413. #include "Includes/Lux URP Grass Inputs.hlsl"
  414. //--------------------------------------
  415. // Fragment shader and functions
  416. inline void InitializeStandardLitSurfaceData(float2 uv, out SurfaceData outSurfaceData)
  417. {
  418. half4 albedoAlpha = SampleAlbedoAlpha(uv, TEXTURE2D_ARGS(_BaseMap, sampler_BaseMap));
  419. outSurfaceData.alpha = Alpha(albedoAlpha.a, 1, _Cutoff);
  420. outSurfaceData.albedo = albedoAlpha.rgb;
  421. outSurfaceData.metallic = 0;
  422. outSurfaceData.specular = _SpecColor.rgb;
  423. outSurfaceData.smoothness = _Smoothness;
  424. outSurfaceData.normalTS = half3(0,0,1); //SampleNormal(uv, TEXTURE2D_ARGS(_BumpMap, sampler_BumpMap));
  425. outSurfaceData.occlusion = 1;
  426. outSurfaceData.emission = 0;
  427. outSurfaceData.clearCoatMask = 0;
  428. outSurfaceData.clearCoatSmoothness = 0;
  429. }
  430. // Finally include the meta pass related stuff
  431. #include "Packages/com.unity.render-pipelines.universal/Shaders/LitMetaPass.hlsl"
  432. ENDHLSL
  433. }
  434. // End Passes -----------------------------------------------------
  435. }
  436. FallBack "Hidden/InternalErrorShader"
  437. CustomEditor "LuxURPCustomSingleSidedShaderGUI"
  438. }