Top Down URP Inputs.hlsl 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. #ifndef INPUT_BASETOPDOWN_INCLUDED
  2. #define INPUT_BASETOPDOWN_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. CBUFFER_START(UnityPerMaterial)
  14. float4 _BaseMap_ST;
  15. half4 _BaseColor;
  16. half4 _SpecColor;
  17. half _BumpScale;
  18. half _GlossMapScale;
  19. half _GlossMapScaleDyn;
  20. half4 _EmissionColor;
  21. half _Occlusion;
  22. half _BumpScaleDyn;
  23. half _NormalFactor;
  24. half _NormalLimit;
  25. half _TopDownTiling;
  26. float3 _TerrainPosition;
  27. half _LowerNormalMinStrength;
  28. half _LowerNormalInfluence;
  29. half _HeightBlendSharpness;
  30. // Simple Fuzz
  31. half _FuzzStrength;
  32. half _FuzzAmbient;
  33. half _FuzzWrap;
  34. half _FuzzPower;
  35. half _FuzzBias;
  36. half _Cutoff; //HDRP 10.1. DepthNormal pass
  37. CBUFFER_END
  38. struct VertexInput
  39. {
  40. float4 positionOS : POSITION;
  41. float3 normalOS : NORMAL;
  42. float4 tangentOS : TANGENT;
  43. float2 texcoord : TEXCOORD0;
  44. float2 lightmapUV : TEXCOORD1;
  45. UNITY_VERTEX_INPUT_INSTANCE_ID
  46. };
  47. struct VertexOutput {
  48. float4 positionCS : SV_POSITION;
  49. //#ifdef _ADDITIONAL_LIGHTS
  50. float3 positionWS : TEXCOORD0;
  51. //#endif
  52. #if !defined(UNITY_PASS_SHADOWCASTER) && !defined(DEPTHONLYPASS) && !defined(DEPTHNORMALONLYPASS)
  53. float4 uv : TEXCOORD1;
  54. #if !defined(CUSTOMMETAPASS)
  55. DECLARE_LIGHTMAP_OR_SH(lightmapUV, vertexSH, 2);
  56. float3 normalWS : TEXCOORD3;
  57. #ifdef _NORMALMAP
  58. float4 tangentWS : TEXCOORD4; // xyz: tangent, w: tangent sign
  59. #endif
  60. float3 viewDirWS : TEXCOORD5;
  61. float4 fogFactorAndVertexLight : TEXCOORD6; // x: fogFactor, yzw: vertex light
  62. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  63. float4 shadowCoord : TEXCOORD7;
  64. #endif
  65. #endif
  66. #endif
  67. UNITY_VERTEX_INPUT_INSTANCE_ID
  68. UNITY_VERTEX_OUTPUT_STEREO
  69. };
  70. struct SurfaceDescription
  71. {
  72. half3 albedo;
  73. half alpha;
  74. half3 normalTS;
  75. half3 emission;
  76. half metallic;
  77. half3 specular;
  78. half smoothness;
  79. half occlusion;
  80. half fuzzMask;
  81. };
  82. #endif