Lux URP Cloth Inputs.hlsl 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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 Cloth 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. half _Cutoff;
  17. float4 _BaseMap_ST;
  18. half _Smoothness;
  19. half4 _SpecColor;
  20. half _Anisotropy;
  21. half4 _SheenColor;
  22. half _BumpScale;
  23. float4 _MaskMap_ST;
  24. half _OcclusionStrength;
  25. half _TranslucencyPower;
  26. half _TranslucencyStrength;
  27. half _ShadowStrength;
  28. half _Distortion;
  29. half _ShadowOffset;
  30. half4 _RimColor;
  31. half _RimPower;
  32. half _RimMinPower;
  33. half _RimFrequency;
  34. half _RimPerPositionFrequency;
  35. CBUFFER_END
  36. // Additional textures
  37. #if defined(_MASKMAP)
  38. TEXTURE2D(_MaskMap); SAMPLER(sampler_MaskMap);
  39. #endif
  40. // Global Inputs
  41. // Structs
  42. struct VertexInput
  43. {
  44. float3 positionOS : POSITION;
  45. float3 normalOS : NORMAL;
  46. #if !defined(UNITY_PASS_SHADOWCASTER) && !defined(DEPTHONLYPASS) && !defined(DEPTHNORMALPASS)
  47. float4 tangentOS : TANGENT;
  48. float2 lightmapUV : TEXCOORD1;
  49. #endif
  50. float2 texcoord : TEXCOORD0;
  51. //half4 color : COLOR;
  52. UNITY_VERTEX_INPUT_INSTANCE_ID
  53. };
  54. struct VertexOutput
  55. {
  56. float4 positionCS : SV_POSITION;
  57. #if defined(_MASKMAP)
  58. float4 uv : TEXCOORD0;
  59. #else
  60. float2 uv : TEXCOORD0;
  61. #endif
  62. #if !defined(UNITY_PASS_SHADOWCASTER) && !defined(DEPTHONLYPASS)
  63. float3 normalWS : TEXCOORD3;
  64. #endif
  65. #if !defined(UNITY_PASS_SHADOWCASTER) && !defined(DEPTHONLYPASS)
  66. DECLARE_LIGHTMAP_OR_SH(lightmapUV, vertexSH, 1);
  67. #if defined(REQUIRES_WORLD_SPACE_POS_INTERPOLATOR)
  68. float3 positionWS : TEXCOORD2;
  69. #endif
  70. float3 viewDirWS : TEXCOORD4;
  71. #if defined(_NORMALMAP) || !defined(_COTTONWOOL)
  72. float4 tangentWS : TEXCOORD5;
  73. #endif
  74. half4 fogFactorAndVertexLight : TEXCOORD6;
  75. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  76. float4 shadowCoord : TEXCOORD7;
  77. #endif
  78. #endif
  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 translucency;
  93. };
  94. #endif