Lux URP Hair Inputs.hlsl 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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 Hair 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. float4 _BaseMap_ST;
  16. half4 _BaseColor;
  17. half4 _SecondaryColor;
  18. half _Cutoff;
  19. half _Smoothness;
  20. half4 _SpecColor;
  21. half _BumpScale;
  22. half _StrandDir;
  23. half _SpecularShift;
  24. half4 _SpecularTint;
  25. half _SpecularExponent;
  26. half _SecondarySpecularShift;
  27. half4 _SecondarySpecularTint;
  28. half _SecondarySpecularExponent;
  29. half _RimTransmissionIntensity;
  30. half _AmbientReflection;
  31. //half _OcclusionStrength;
  32. //float2 _DistanceFade;
  33. #if defined(_RIMLIGHTING)
  34. half4 _RimColor;
  35. half _RimPower;
  36. half _RimMinPower;
  37. half _RimFrequency;
  38. half _RimPerPositionFrequency;
  39. #endif
  40. // Needed by URP 10.1. depthnormal
  41. half _Surface;
  42. CBUFFER_END
  43. // Additional textures
  44. TEXTURE2D(_MaskMap); SAMPLER(sampler_MaskMap);
  45. //TEXTURE2D(_Dither); SAMPLER(sampler_Dither); float4 _Dither_TexelSize;
  46. // Global Inputs
  47. //float _FrameIndexMod4;
  48. // Structs
  49. struct VertexInput
  50. {
  51. float3 positionOS : POSITION;
  52. float3 normalOS : NORMAL;
  53. float4 tangentOS : TANGENT;
  54. float2 texcoord : TEXCOORD0;
  55. float2 lightmapUV : TEXCOORD1;
  56. half4 color : COLOR;
  57. UNITY_VERTEX_INPUT_INSTANCE_ID
  58. };
  59. struct VertexOutput
  60. {
  61. float4 positionCS : SV_POSITION;
  62. float2 uv : TEXCOORD0;
  63. #if !defined(UNITY_PASS_SHADOWCASTER) && !defined(DEPTHONLYPASS)
  64. DECLARE_LIGHTMAP_OR_SH(lightmapUV, vertexSH, 1);
  65. #if defined(REQUIRES_WORLD_SPACE_POS_INTERPOLATOR)
  66. float3 positionWS : TEXCOORD2;
  67. #endif
  68. // Hair lighting always needs tangent and bitangent
  69. float3 normalWS : TEXCOORD3;
  70. float3 viewDirWS : TEXCOORD4;
  71. float4 tangentWS : TEXCOORD5;
  72. half4 fogFactorAndVertexLight : TEXCOORD6;
  73. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  74. float4 shadowCoord : TEXCOORD7;
  75. #endif
  76. #endif
  77. //float4 screenPos : TEXCOORD8;
  78. half4 color : COLOR;
  79. UNITY_VERTEX_INPUT_INSTANCE_ID
  80. UNITY_VERTEX_OUTPUT_STEREO
  81. };
  82. struct SurfaceDescription
  83. {
  84. half3 albedo;
  85. half alpha;
  86. half3 normalTS;
  87. half3 emission;
  88. half metallic;
  89. half3 specular;
  90. half smoothness;
  91. half occlusion;
  92. half shift;
  93. };
  94. #endif