Lux URP Grass Inputs.hlsl 3.1 KB

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