Lux URP Skin Inputs.hlsl 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. CBUFFER_END
  47. // Additional textures
  48. TEXTURE2D(_SSSAOMap); SAMPLER(sampler_SSSAOMap);
  49. // Global Inputs
  50. // Structs
  51. struct VertexInput
  52. {
  53. float3 positionOS : POSITION;
  54. float3 normalOS : NORMAL;
  55. float4 tangentOS : TANGENT;
  56. float2 texcoord : TEXCOORD0;
  57. float2 lightmapUV : TEXCOORD1;
  58. half4 color : COLOR;
  59. UNITY_VERTEX_INPUT_INSTANCE_ID
  60. };
  61. struct VertexOutput
  62. {
  63. float4 positionCS : SV_POSITION;
  64. float2 uv : TEXCOORD0;
  65. half fade : TEXCOORD9;
  66. #if !defined(UNITY_PASS_SHADOWCASTER) && !defined(DEPTHONLYPASS)
  67. DECLARE_LIGHTMAP_OR_SH(lightmapUV, vertexSH, 1);
  68. #if defined(REQUIRES_WORLD_SPACE_POS_INTERPOLATOR)
  69. float3 positionWS : TEXCOORD2;
  70. #endif
  71. float3 normalWS : TEXCOORD3;
  72. float3 viewDirWS : TEXCOORD4;
  73. #ifdef _NORMALMAP
  74. float4 tangentWS : TEXCOORD5;
  75. #endif
  76. half4 fogFactorAndVertexLight : TEXCOORD6;
  77. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  78. float4 shadowCoord : TEXCOORD7;
  79. #endif
  80. #endif
  81. UNITY_VERTEX_INPUT_INSTANCE_ID
  82. UNITY_VERTEX_OUTPUT_STEREO
  83. };
  84. struct SurfaceDescription
  85. {
  86. half3 albedo;
  87. half alpha;
  88. half3 normalTS;
  89. half3 diffuseNormalTS;
  90. half3 emission;
  91. half metallic;
  92. half3 specular;
  93. half smoothness;
  94. half occlusion;
  95. half translucency;
  96. half skinMask;
  97. half curvature;
  98. };
  99. #endif