Lux URP Grass Inputs.hlsl 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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 "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  11. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl"
  12. // Material Inputs
  13. CBUFFER_START(UnityPerMaterial)
  14. half4 _BaseColor;
  15. float4 _BaseMap_ST;
  16. half _Cutoff;
  17. half _Smoothness;
  18. half4 _SpecColor;
  19. half _Occlusion;
  20. half4 _WindMultiplier;
  21. float2 _DistanceFade;
  22. half _BumpScale;
  23. //half _DisplacementStrength;
  24. half _DisplacementSampleSize;
  25. half _DisplacementStrength;
  26. half _DisplacementStrengthVertical;
  27. half _NormalDisplacement;
  28. CBUFFER_END
  29. // Additional textures
  30. TEXTURE2D(_LuxLWRPWindRT); SAMPLER(sampler_LuxLWRPWindRT);
  31. // Global Inputs
  32. half4 _LuxLWRPWindDirSize;
  33. half4 _LuxLWRPWindStrengthMultipliers;
  34. float4 _LuxLWRPSinTime;
  35. // Displacement
  36. TEXTURE2D(_Lux_DisplacementRT); SAMPLER(sampler_Lux_DisplacementRT);
  37. float4 _Lux_DisplacementPosition;
  38. // Structs
  39. struct VertexInput
  40. {
  41. float3 positionOS : POSITION;
  42. float3 normalOS : NORMAL;
  43. float4 tangentOS : TANGENT;
  44. float2 texcoord : TEXCOORD0;
  45. float2 lightmapUV : TEXCOORD1;
  46. half4 color : COLOR;
  47. UNITY_VERTEX_INPUT_INSTANCE_ID
  48. };
  49. struct VertexOutput
  50. {
  51. float4 positionCS : SV_POSITION;
  52. float2 uv : TEXCOORD0;
  53. half2 fadeOcclusion : TEXCOORD9;
  54. #if !defined(UNITY_PASS_SHADOWCASTER) && !defined(DEPTHONLYPASS)
  55. float3 normalWS : TEXCOORD3;
  56. #endif
  57. #if !defined(UNITY_PASS_SHADOWCASTER) && !defined(DEPTHONLYPASS) && !defined(DEPTHNORMALONLYPASS)
  58. DECLARE_LIGHTMAP_OR_SH(lightmapUV, vertexSH, 1);
  59. //#if defined(REQUIRES_WORLD_SPACE_POS_INTERPOLATOR)
  60. float3 positionWS : TEXCOORD2;
  61. //#endif
  62. #ifdef _NORMALMAP
  63. float4 tangentWS : TEXCOORD4;
  64. #endif
  65. float3 viewDirWS : TEXCOORD5;
  66. half4 fogFactorAndVertexLight : TEXCOORD6;
  67. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  68. float4 shadowCoord : TEXCOORD7;
  69. #endif
  70. #endif
  71. UNITY_VERTEX_INPUT_INSTANCE_ID
  72. UNITY_VERTEX_OUTPUT_STEREO
  73. };
  74. struct SurfaceDescription
  75. {
  76. float3 albedo;
  77. float alpha;
  78. float3 normalTS;
  79. float3 emission;
  80. float metallic;
  81. float3 specular;
  82. float smoothness;
  83. float occlusion;
  84. //float translucency;
  85. };
  86. #endif