Lux URP Skin Inputs Custom.hlsl 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. #ifndef INPUT_LUXLWRP_BASE_INCLUDED
  2. #define INPUT_LUXLWRP_BASE_INCLUDED
  3. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  4. // defines a bunch of helper functions (like lerpwhiteto)
  5. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/CommonMaterial.hlsl"
  6. // defines SurfaceData, textures and the functions Alpha, SampleAlbedoAlpha, SampleNormal, SampleEmission
  7. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/SurfaceInput.hlsl"
  8. // defines e.g. "DECLARE_LIGHTMAP_OR_SH"
  9. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  10. #include "../Includes/Lux URP Skin Lighting.hlsl"
  11. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  12. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl"
  13. // Material Inputs
  14. CBUFFER_START(UnityPerMaterial)
  15. half4 _BaseColor;
  16. half4 _SpecularColor;
  17. float4 _BaseMap_ST;
  18. half _Smoothness;
  19. half _BumpScale;
  20. half _Bias;
  21. half _SkinShadowBias;
  22. half _SkinShadowSamplingBias;
  23. half _OcclusionStrength;
  24. half4 _SubsurfaceColor;
  25. half _SampleCurvature;
  26. half _Curvature;
  27. float2 _DistanceFade;
  28. half _TranslucencyPower;
  29. half _TranslucencyStrength;
  30. half _ShadowStrength;
  31. half _MaskByShadowStrength;
  32. half _Distortion;
  33. half _AmbientReflectionStrength;
  34. //#if defined(_RIMLIGHTING)
  35. half4 _RimColor;
  36. half _RimPower;
  37. half _RimMinPower;
  38. half _RimFrequency;
  39. half _RimPerPositionFrequency;
  40. //#endif
  41. // Needed by URP 10.1. and depthnormal
  42. half _Cutoff;
  43. half _Surface;
  44. half _Backscatter;
  45. half _VertexNormal;
  46. // Custom Inputs
  47. // Emission
  48. float3 _EmissionColor;
  49. // Mask
  50. float4 _MakeUpMask1_RGB_ST;
  51. float4 _MakeUpMask2_RGB_ST;
  52. float4 _Mask1_Rchannel_ColorAmountA;
  53. float4 _Mask1_Gchannel_ColorAmountA;
  54. float4 _Mask1_Bchannel_ColorAmountA;
  55. float4 _Mask1_Achannel_ColorAmountA;
  56. float4 _Mask2_Rchannel_ColorAmountA;
  57. float4 _Mask2_Gchannel_ColorAmountA;
  58. float4 _Mask2_Bchannel_ColorAmountA;
  59. float4 _Mask1_Rchannel_TextureAmountA_ST;
  60. float4 _Mask1_Gchannel_TextureAmountA_ST;
  61. float4 _Mask1_Bchannel_TextureAmountA_ST;
  62. float4 _Mask1_Achannel_TextureAmountA_ST;
  63. float4 _Mask2_Rchannel_TextureAmountA_ST;
  64. float4 _Mask2_Gchannel_TextureAmountA_ST;
  65. float4 _Mask2_Bchannel_TextureAmountA_ST;
  66. float4 _EmissionMap_ST;
  67. //catoon
  68. float _ToonThesHold;
  69. float _ToonHardness;
  70. float4 _SpecColor;
  71. float _SpecSize;
  72. float4 _RimLightDir;
  73. float4 _RimLightColor;
  74. CBUFFER_END
  75. // Additional textures
  76. TEXTURE2D(_SSSAOMap); SAMPLER(sampler_SSSAOMap);
  77. // Custom Textures
  78. // Emission (defined in SurfaceInput.hlsl)
  79. //TEXTURE2D(_EmissionMap);
  80. //SAMPLER(sampler_EmissionMap);
  81. // cloth mask
  82. TEXTURE2D(_ClothMask1);
  83. SAMPLER(sampler_ClothMask1);
  84. TEXTURE2D(_ClothMask2);
  85. //SAMPLER(sampler_ClothMask2);
  86. TEXTURE2D(_ClothMask3);
  87. //SAMPLER(sampler_ClothMask3);
  88. TEXTURE2D(_MakeUpMask1_RGB);
  89. SAMPLER(sampler_MakeUpMask1_RGB);
  90. TEXTURE2D(_MakeUpMask2_RGB);
  91. SAMPLER(sampler_MakeUpMask2_RGB);
  92. TEXTURE2D(_Mask1_Rchannel_TextureAmountA);
  93. SAMPLER(sampler_Mask1_Rchannel_TextureAmountA);
  94. TEXTURE2D(_Mask1_Gchannel_TextureAmountA);
  95. SAMPLER(sampler_Mask1_Gchannel_TextureAmountA);
  96. TEXTURE2D(_Mask1_Bchannel_TextureAmountA);
  97. SAMPLER(sampler_Mask1_Bchannel_TextureAmountA);
  98. TEXTURE2D(_Mask1_Achannel_TextureAmountA);
  99. SAMPLER(sampler_Mask1_Achannel_TextureAmountA);
  100. TEXTURE2D(_Mask2_Rchannel_TextureAmountA);
  101. SAMPLER(sampler_Mask2_Rchannel_TextureAmountA);
  102. TEXTURE2D(_Mask2_Gchannel_TextureAmountA);
  103. SAMPLER(sampler_Mask2_Gchannel_TextureAmountA);
  104. TEXTURE2D(_Mask2_Bchannel_TextureAmountA);
  105. SAMPLER(sampler_Mask2_Bchannel_TextureAmountA);
  106. // Global Inputs
  107. // Structs
  108. struct VertexInput
  109. {
  110. float3 positionOS : POSITION;
  111. float3 normalOS : NORMAL;
  112. float4 tangentOS : TANGENT;
  113. float2 texcoord : TEXCOORD0;
  114. float2 lightmapUV : TEXCOORD1;
  115. half4 color : COLOR;
  116. UNITY_VERTEX_INPUT_INSTANCE_ID
  117. };
  118. struct VertexOutput
  119. {
  120. float4 positionCS : SV_POSITION;
  121. float2 uv : TEXCOORD0;
  122. half fade : TEXCOORD9;
  123. #if !defined(UNITY_PASS_SHADOWCASTER) && !defined(DEPTHONLYPASS)
  124. DECLARE_LIGHTMAP_OR_SH(lightmapUV, vertexSH, 1);
  125. #if defined(REQUIRES_WORLD_SPACE_POS_INTERPOLATOR)
  126. float3 positionWS : TEXCOORD2;
  127. #endif
  128. float3 normalWS : TEXCOORD3;
  129. float3 viewDirWS : TEXCOORD4;
  130. #ifdef _NORMALMAP
  131. float4 tangentWS : TEXCOORD5;
  132. #endif
  133. half4 fogFactorAndVertexLight : TEXCOORD6;
  134. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  135. float4 shadowCoord : TEXCOORD7;
  136. #endif
  137. #endif
  138. UNITY_VERTEX_INPUT_INSTANCE_ID
  139. UNITY_VERTEX_OUTPUT_STEREO
  140. };
  141. struct SurfaceDescription
  142. {
  143. half3 albedo;
  144. half alpha;
  145. half3 normalTS;
  146. half3 diffuseNormalTS;
  147. half3 emission;
  148. half metallic;
  149. half3 specular;
  150. half smoothness;
  151. half occlusion;
  152. half translucency;
  153. half skinMask;
  154. half curvature;
  155. };
  156. #endif