Brak opisu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ParticlesInput.hlsl 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. #ifndef UNIVERSAL_PARTICLES_INPUT_INCLUDED
  2. #define UNIVERSAL_PARTICLES_INPUT_INCLUDED
  3. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  4. struct AttributesParticle
  5. {
  6. float4 positionOS : POSITION;
  7. half4 color : COLOR;
  8. #if defined(_FLIPBOOKBLENDING_ON) && !defined(UNITY_PARTICLE_INSTANCING_ENABLED)
  9. float4 texcoords : TEXCOORD0;
  10. float texcoordBlend : TEXCOORD1;
  11. #else
  12. float2 texcoords : TEXCOORD0;
  13. #endif
  14. #if !defined(PARTICLES_EDITOR_META_PASS)
  15. float3 normalOS : NORMAL;
  16. float4 tangentOS : TANGENT;
  17. #endif
  18. UNITY_VERTEX_INPUT_INSTANCE_ID
  19. };
  20. struct VaryingsParticle
  21. {
  22. float4 clipPos : SV_POSITION;
  23. float2 texcoord : TEXCOORD0;
  24. half4 color : COLOR;
  25. #if defined(_FLIPBOOKBLENDING_ON)
  26. float3 texcoord2AndBlend : TEXCOORD5;
  27. #endif
  28. #if !defined(PARTICLES_EDITOR_META_PASS)
  29. float4 positionWS : TEXCOORD1;
  30. #ifdef _NORMALMAP
  31. half4 normalWS : TEXCOORD2; // xyz: normal, w: viewDir.x
  32. half4 tangentWS : TEXCOORD3; // xyz: tangent, w: viewDir.y
  33. half4 bitangentWS : TEXCOORD4; // xyz: bitangent, w: viewDir.z
  34. #else
  35. half3 normalWS : TEXCOORD2;
  36. half3 viewDirWS : TEXCOORD3;
  37. #endif
  38. #if defined(_SOFTPARTICLES_ON) || defined(_FADING_ON) || defined(_DISTORTION_ON)
  39. float4 projectedPosition: TEXCOORD6;
  40. #endif
  41. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  42. float4 shadowCoord : TEXCOORD7;
  43. #endif
  44. half3 vertexSH : TEXCOORD8; // SH
  45. #ifdef USE_APV_PROBE_OCCLUSION
  46. float4 probeOcclusion : TEXCOORD9;
  47. #endif
  48. #endif
  49. UNITY_VERTEX_INPUT_INSTANCE_ID
  50. UNITY_VERTEX_OUTPUT_STEREO
  51. };
  52. struct AttributesDepthOnlyParticle
  53. {
  54. float4 vertex : POSITION;
  55. #if defined(_ALPHATEST_ON)
  56. half4 color : COLOR;
  57. #if defined(_FLIPBOOKBLENDING_ON) && !defined(UNITY_PARTICLE_INSTANCING_ENABLED)
  58. float4 texcoords : TEXCOORD0;
  59. float texcoordBlend : TEXCOORD1;
  60. #else
  61. float2 texcoords : TEXCOORD0;
  62. #endif
  63. #endif
  64. UNITY_VERTEX_INPUT_INSTANCE_ID
  65. };
  66. struct VaryingsDepthOnlyParticle
  67. {
  68. float4 clipPos : SV_POSITION;
  69. #if defined(_ALPHATEST_ON)
  70. float2 texcoord : TEXCOORD0;
  71. half4 color : COLOR;
  72. #if defined(_FLIPBOOKBLENDING_ON)
  73. float3 texcoord2AndBlend : TEXCOORD5;
  74. #endif
  75. #endif
  76. UNITY_VERTEX_INPUT_INSTANCE_ID
  77. UNITY_VERTEX_OUTPUT_STEREO
  78. };
  79. struct AttributesDepthNormalsParticle
  80. {
  81. float4 vertex : POSITION;
  82. #if defined(_ALPHATEST_ON)
  83. half4 color : COLOR;
  84. #endif
  85. #if defined(_ALPHATEST_ON) || defined(_NORMALMAP)
  86. #if defined(_FLIPBOOKBLENDING_ON) && !defined(UNITY_PARTICLE_INSTANCING_ENABLED)
  87. float4 texcoords : TEXCOORD0;
  88. float texcoordBlend : TEXCOORD1;
  89. #else
  90. float2 texcoords : TEXCOORD0;
  91. #endif
  92. #endif
  93. float3 normal : NORMAL;
  94. float4 tangent : TANGENT;
  95. UNITY_VERTEX_INPUT_INSTANCE_ID
  96. };
  97. struct VaryingsDepthNormalsParticle
  98. {
  99. float4 clipPos : SV_POSITION;
  100. #if defined(_ALPHATEST_ON)
  101. half4 color : COLOR;
  102. #endif
  103. #if defined(_ALPHATEST_ON) || defined(_NORMALMAP)
  104. float2 texcoord : TEXCOORD0;
  105. #if defined(_FLIPBOOKBLENDING_ON)
  106. float3 texcoord2AndBlend : TEXCOORD5;
  107. #endif
  108. #endif
  109. #if defined(_NORMALMAP)
  110. float4 normalWS : TEXCOORD2; // xyz: normal, w: viewDir.x
  111. float4 tangentWS : TEXCOORD3; // xyz: tangent, w: viewDir.y
  112. float4 bitangentWS : TEXCOORD4; // xyz: bitangent, w: viewDir.z
  113. #else
  114. float3 normalWS : TEXCOORD2;
  115. float3 viewDirWS : TEXCOORD3;
  116. #endif
  117. UNITY_VERTEX_INPUT_INSTANCE_ID
  118. UNITY_VERTEX_OUTPUT_STEREO
  119. };
  120. #endif // UNIVERSAL_PARTICLES_INPUT_INCLUDED