Lux URP Versatile Blend Inputs.hlsl 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #ifndef INPUT_LUXLURP_BASE_INCLUDED
  2. #define INPUT_LUXLURP_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 Blend 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. float _Shift;
  16. half _BlendWidth;
  17. half _BlendSharpness;
  18. half _AlphaShift;
  19. half _AlphaWidth;
  20. float _ShadowShiftThreshold;
  21. float _ShadowShift;
  22. float _ShadowShiftView;
  23. half _BumpScale;
  24. half4 _BaseColor;
  25. half _Cutoff;
  26. float4 _BaseMap_ST;
  27. half _Smoothness;
  28. half4 _SpecColor;
  29. half _OcclusionStrength;
  30. CBUFFER_END
  31. // Additional textures
  32. #if defined(_MASKMAP)
  33. TEXTURE2D(_MaskMap); SAMPLER(sampler_MaskMap);
  34. #endif
  35. // Depth texture
  36. #if defined(SHADER_API_GLES)
  37. TEXTURE2D(_CameraDepthTexture); SAMPLER(sampler_CameraDepthTexture);
  38. #else
  39. TEXTURE2D_X_FLOAT(_CameraDepthTexture);
  40. float4 _CameraDepthTexture_TexelSize;
  41. #endif
  42. // Global Inputs
  43. // Structs
  44. struct VertexInput
  45. {
  46. float3 positionOS : POSITION;
  47. float3 normalOS : NORMAL;
  48. float4 tangentOS : TANGENT;
  49. float2 texcoord : TEXCOORD0;
  50. float2 lightmapUV : TEXCOORD1;
  51. UNITY_VERTEX_INPUT_INSTANCE_ID
  52. };
  53. struct VertexOutput
  54. {
  55. float4 positionCS : SV_POSITION;
  56. float2 uv : TEXCOORD0;
  57. #if !defined(UNITY_PASS_SHADOWCASTER) && !defined(DEPTHONLYPASS)
  58. DECLARE_LIGHTMAP_OR_SH(lightmapUV, vertexSH, 1);
  59. //#if defined(REQUIRES_WORLD_SPACE_POS_INTERPOLATOR)
  60. float3 positionWS : TEXCOORD2;
  61. //#endif
  62. float3 normalWS : TEXCOORD3;
  63. #if defined(_NORMALMAP)
  64. float4 tangentWS : TEXCOORD4;
  65. #endif
  66. float3 viewDirWS : TEXCOORD5;
  67. half4 fogFactorAndVertexLight : TEXCOORD6;
  68. float2 screenUV : TEXCOORD8;
  69. #endif
  70. UNITY_VERTEX_INPUT_INSTANCE_ID
  71. UNITY_VERTEX_OUTPUT_STEREO
  72. };
  73. struct SurfaceDescription
  74. {
  75. half3 albedo;
  76. half alpha;
  77. half3 normalTS;
  78. half3 emission;
  79. half metallic;
  80. half3 specular;
  81. half smoothness;
  82. half occlusion;
  83. };
  84. #endif