Lux URP Simple Fuzz Inputs.hlsl 3.5 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 Simple Fuzz 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. // Simple
  21. half _FuzzStrength;
  22. half _FuzzAmbient;
  23. half _FuzzWrap;
  24. half _FuzzPower;
  25. half _FuzzBias;
  26. half _BumpScale;
  27. float4 _MaskMap_ST;
  28. half _OcclusionStrength;
  29. half _TranslucencyPower;
  30. half _TranslucencyStrength;
  31. half _ShadowStrength;
  32. half _Distortion;
  33. half _ShadowOffset;
  34. half4 _RimColor;
  35. half _RimPower;
  36. half _RimMinPower;
  37. half _RimFrequency;
  38. half _RimPerPositionFrequency;
  39. CBUFFER_END
  40. // Additional textures
  41. #if defined(_MASKMAP)
  42. TEXTURE2D(_MaskMap); SAMPLER(sampler_MaskMap);
  43. #endif
  44. // Global Inputs
  45. // Structs
  46. struct VertexInput
  47. {
  48. float3 positionOS : POSITION;
  49. float3 normalOS : NORMAL;
  50. float4 tangentOS : TANGENT;
  51. float2 texcoord : TEXCOORD0;
  52. float2 lightmapUV : TEXCOORD1;
  53. half4 color : COLOR;
  54. UNITY_VERTEX_INPUT_INSTANCE_ID
  55. };
  56. struct VertexOutput
  57. {
  58. float4 positionCS : SV_POSITION;
  59. #if defined(_MASKMAP)
  60. float4 uv : TEXCOORD0;
  61. #else
  62. float2 uv : TEXCOORD0;
  63. #endif
  64. #if !defined(UNITY_PASS_SHADOWCASTER) && !defined(DEPTHONLYPASS)
  65. DECLARE_LIGHTMAP_OR_SH(lightmapUV, vertexSH, 1);
  66. #if defined(REQUIRES_WORLD_SPACE_POS_INTERPOLATOR)
  67. float3 positionWS : TEXCOORD2;
  68. #endif
  69. float3 normalWS : TEXCOORD3;
  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. half fuzzMask;
  94. };
  95. #endif