Lux URP Transmission Inputs.hlsl 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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 Translucent 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. // NOTE: Do not ifdef the properties here as SRP batcher can not handle different layouts.
  14. // Material Inputs
  15. CBUFFER_START(UnityPerMaterial)
  16. float4 _BaseMap_ST;
  17. half4 _BaseColor;
  18. half4 _SpecColor;
  19. half _Smoothness;
  20. half _Metallic;
  21. half _Cutoff;
  22. half _ShadowOffset;
  23. float4 _BumpMap_ST;
  24. half _BumpScale;
  25. float4 _MaskMap_ST;
  26. half _TranslucencyPower;
  27. half _TranslucencyStrength;
  28. half _ShadowStrength;
  29. half _MaskByShadowStrength;
  30. half _Distortion;
  31. half _CustomWrap;
  32. half4 _RimColor;
  33. half _RimPower;
  34. half _RimMinPower;
  35. half _RimFrequency;
  36. half _RimPerPositionFrequency;
  37. half _Occlusion;
  38. CBUFFER_END
  39. // Additional textures
  40. #if defined(_MASKMAP)
  41. TEXTURE2D(_MaskMap); SAMPLER(sampler_MaskMap);
  42. #endif
  43. // Global Inputs
  44. // Structs
  45. struct VertexInput
  46. {
  47. float3 positionOS : POSITION;
  48. float3 normalOS : NORMAL;
  49. float4 tangentOS : TANGENT;
  50. float2 texcoord : TEXCOORD0;
  51. float2 lightmapUV : TEXCOORD1;
  52. // half4 color : COLOR;
  53. UNITY_VERTEX_INPUT_INSTANCE_ID
  54. };
  55. struct VertexOutput
  56. {
  57. float4 positionCS : SV_POSITION;
  58. #if defined(_MASKMAP)
  59. float4 uv : TEXCOORD0;
  60. #else
  61. float2 uv : TEXCOORD0;
  62. #endif
  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. float3 normalWS : TEXCOORD3;
  69. float3 viewDirWS : TEXCOORD4;
  70. #if defined(_NORMALMAP)
  71. float4 tangentWS : TEXCOORD5;
  72. #endif
  73. half4 fogFactorAndVertexLight : TEXCOORD6;
  74. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  75. float4 shadowCoord : TEXCOORD7;
  76. #endif
  77. #endif
  78. UNITY_VERTEX_INPUT_INSTANCE_ID
  79. UNITY_VERTEX_OUTPUT_STEREO
  80. };
  81. struct SurfaceDescription
  82. {
  83. half3 albedo;
  84. half alpha;
  85. half3 normalTS;
  86. half3 emission;
  87. half metallic;
  88. half3 specular;
  89. half smoothness;
  90. half occlusion;
  91. half translucency;
  92. half mask;
  93. };
  94. #endif