ParticlesMaterial.xml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="ParticlesMaterial" inherits="Material" category="Core" version="3.1">
  3. <brief_description>
  4. Particle properties for [Particles] and [Particles2D] nodes.
  5. </brief_description>
  6. <description>
  7. ParticlesMaterial defines particle properties and behavior. It is used in the [code]process_material[/code] of [Particles] and [Particles2D] emitter nodes.
  8. Some of this material's properties are applied to each particle when emitted, while others can have a [CurveTexture] applied to vary values over the lifetime of the particle.
  9. When a randomness ratio is applied to a property it is used to scale that property by a random amount. The random ratio is used to interpolate between [code]1.0[/code] and a random number less than one, the result is multiplied by the property to obtain the randomized property. For example a random ratio of [code]0.4[/code] would scale the original property between [code]0.4-1.0[/code] of its original value.
  10. </description>
  11. <tutorials>
  12. </tutorials>
  13. <demos>
  14. </demos>
  15. <methods>
  16. </methods>
  17. <members>
  18. <member name="angle" type="float" setter="set_param" getter="get_param">
  19. Initial rotation applied to each particle, in degrees.
  20. Only applied when [member flag_disable_z] or [member flag_rotate_y] are [code]true[/code] or the [SpatialMaterial] being used to draw the particle is using [code]BillboardMode.BILLBOARD_PARTICLES[/code].
  21. </member>
  22. <member name="angle_curve" type="Texture" setter="set_param_texture" getter="get_param_texture">
  23. Each particle's rotation will be animated along this [CurveTexture].
  24. </member>
  25. <member name="angle_random" type="float" setter="set_param_randomness" getter="get_param_randomness">
  26. Rotation randomness ratio. Default value: [code]0[/code].
  27. </member>
  28. <member name="angular_velocity" type="float" setter="set_param" getter="get_param">
  29. Initial angular velocity applied to each particle. Sets the speed of rotation of the particle.
  30. Only applied when [member flag_disable_z] or [member flag_rotate_y] are [code]true[/code] or the [SpatialMaterial] being used to draw the particle is using [code]BillboardMode.BILLBOARD_PARTICLES[/code].
  31. </member>
  32. <member name="angular_velocity_curve" type="Texture" setter="set_param_texture" getter="get_param_texture">
  33. Each particle's angular velocity will vary along this [CurveTexture].
  34. </member>
  35. <member name="angular_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness">
  36. Angular velocity randomness ratio. Default value: [code]0[/code].
  37. </member>
  38. <member name="anim_offset" type="float" setter="set_param" getter="get_param">
  39. Particle animation offset.
  40. </member>
  41. <member name="anim_offset_curve" type="Texture" setter="set_param_texture" getter="get_param_texture">
  42. Each particle's animation offset will vary along this [CurveTexture].
  43. </member>
  44. <member name="anim_offset_random" type="float" setter="set_param_randomness" getter="get_param_randomness">
  45. Animation offset randomness ratio. Default value: [code]0[/code].
  46. </member>
  47. <member name="anim_speed" type="float" setter="set_param" getter="get_param">
  48. Particle animation speed.
  49. </member>
  50. <member name="anim_speed_curve" type="Texture" setter="set_param_texture" getter="get_param_texture">
  51. Each particle's animation speed will vary along this [CurveTexture].
  52. </member>
  53. <member name="anim_speed_random" type="float" setter="set_param_randomness" getter="get_param_randomness">
  54. Animation speed randomness ratio. Default value: [code]0[/code].
  55. </member>
  56. <member name="color" type="Color" setter="set_color" getter="get_color">
  57. Each particle's initial color. If the [Particles2D]'s [code]texture[/code] is defined, it will be multiplied by this color. To have particle display color in a [SpatialMaterial] make sure to set [member SpatialMaterial.vertex_color_use_as_albedo] to [code]true[/code].
  58. </member>
  59. <member name="color_ramp" type="Texture" setter="set_color_ramp" getter="get_color_ramp">
  60. Each particle's color will vary along this [GradientTexture].
  61. </member>
  62. <member name="damping" type="float" setter="set_param" getter="get_param">
  63. The rate at which particles lose velocity.
  64. </member>
  65. <member name="damping_curve" type="Texture" setter="set_param_texture" getter="get_param_texture">
  66. Damping will vary along this [CurveTexture].
  67. </member>
  68. <member name="damping_random" type="float" setter="set_param_randomness" getter="get_param_randomness">
  69. Damping randomness ratio. Default value: [code]0[/code].
  70. </member>
  71. <member name="emission_box_extents" type="Vector3" setter="set_emission_box_extents" getter="get_emission_box_extents">
  72. The box's extents if [code]emission_shape[/code] is set to [code]EMISSION_SHAPE_BOX[/code].
  73. </member>
  74. <member name="emission_color_texture" type="Texture" setter="set_emission_color_texture" getter="get_emission_color_texture">
  75. Particle color will be modulated by color determined by sampling this texture at the same point as the [member emission_point_texture].
  76. </member>
  77. <member name="emission_normal_texture" type="Texture" setter="set_emission_normal_texture" getter="get_emission_normal_texture">
  78. Particle velocity and rotation will be set by sampling this texture at the same point as the [member emission_point_texture]. Used only in [code]EMISSION_SHAPE_DIRECTED[/code]. Can be created automatically from mesh or node by selecting "Create Emission Points from Mesh/Node" under the "Particles" tool in the toolbar.
  79. </member>
  80. <member name="emission_point_count" type="int" setter="set_emission_point_count" getter="get_emission_point_count">
  81. The number of emission points if [code]emission_shape[/code] is set to [code]EMISSION_SHAPE_POINTS[/code] or [code]EMISSION_SHAPE_DIRECTED_POINTS[/code].
  82. </member>
  83. <member name="emission_point_texture" type="Texture" setter="set_emission_point_texture" getter="get_emission_point_texture">
  84. Particles will be emitted at positions determined by sampling this texture at a random position. Used with [code]EMISSION_SHAPE_POINTS[/code] and [code]EMISSION_SHAPE_DIRECTED_POINTS[/code]. Can be created automatically from mesh or node by selecting "Create Emission Points from Mesh/Node" under the "Particles" tool in the toolbar.
  85. </member>
  86. <member name="emission_shape" type="int" setter="set_emission_shape" getter="get_emission_shape" enum="ParticlesMaterial.EmissionShape">
  87. Particles will be emitted inside this region. Use [code]EMISSION_SHAPE_*[/code] constants for values. Default value: [code]EMISSION_SHAPE_POINT[/code].
  88. </member>
  89. <member name="emission_sphere_radius" type="float" setter="set_emission_sphere_radius" getter="get_emission_sphere_radius">
  90. The sphere's radius if [code]emission_shape[/code] is set to [code]EMISSION_SHAPE_SPHERE[/code].
  91. </member>
  92. <member name="flag_align_y" type="bool" setter="set_flag" getter="get_flag">
  93. Align y-axis of particle with the direction of its velocity.
  94. </member>
  95. <member name="flag_disable_z" type="bool" setter="set_flag" getter="get_flag">
  96. If [code]true[/code], particles will not move on the z axis. Default value: [code]true[/code] for [Particles2D], [code]false[/code] for [Particles].
  97. </member>
  98. <member name="flag_rotate_y" type="bool" setter="set_flag" getter="get_flag">
  99. If [code]true[/code], particles rotate around y-axis by [member angle].
  100. </member>
  101. <member name="flatness" type="float" setter="set_flatness" getter="get_flatness">
  102. Amount of [member spread] in Y/Z plane. A value of [code]1[/code] restricts particles to X/Z plane. Default [code]0[/code].
  103. </member>
  104. <member name="gravity" type="Vector3" setter="set_gravity" getter="get_gravity">
  105. Gravity applied to every particle. Default value: [code](0, 98, 0)[/code].
  106. </member>
  107. <member name="hue_variation" type="float" setter="set_param" getter="get_param">
  108. Initial hue variation applied to each particle.
  109. </member>
  110. <member name="hue_variation_curve" type="Texture" setter="set_param_texture" getter="get_param_texture">
  111. Each particle's hue will vary along this [CurveTexture].
  112. </member>
  113. <member name="hue_variation_random" type="float" setter="set_param_randomness" getter="get_param_randomness">
  114. Hue variation randomness ratio. Default value: [code]0[/code].
  115. </member>
  116. <member name="initial_velocity" type="float" setter="set_param" getter="get_param">
  117. Initial velocity magnitude for each particle. Direction comes from [member spread].
  118. </member>
  119. <member name="initial_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness">
  120. Initial velocity randomness ratio. Default value: [code]0[/code].
  121. </member>
  122. <member name="linear_accel" type="float" setter="set_param" getter="get_param">
  123. Linear acceleration applied to each particle. Acceleration increases velocity magnitude each frame without affecting direction.
  124. </member>
  125. <member name="linear_accel_curve" type="Texture" setter="set_param_texture" getter="get_param_texture">
  126. Each particle's linear acceleration will vary along this [CurveTexture].
  127. </member>
  128. <member name="linear_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness">
  129. Linear acceleration randomness ratio. Default value: [code]0[/code].
  130. </member>
  131. <member name="orbit_velocity" type="float" setter="set_param" getter="get_param">
  132. Orbital velocity applied to each particle. Makes the particles circle around origin. Specified in number of full rotations around origin per second.
  133. Only available when [member flag_disable_z] is [code]true[/code].
  134. </member>
  135. <member name="orbit_velocity_curve" type="Texture" setter="set_param_texture" getter="get_param_texture">
  136. Each particle's orbital velocity will vary along this [CurveTexture].
  137. </member>
  138. <member name="orbit_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness">
  139. Orbital velocity randomness ratio. Default value: [code]0[/code].
  140. </member>
  141. <member name="radial_accel" type="float" setter="set_param" getter="get_param">
  142. Radial acceleration applied to each particle. Makes particle accelerate away from origin.
  143. </member>
  144. <member name="radial_accel_curve" type="Texture" setter="set_param_texture" getter="get_param_texture">
  145. Each particle's radial acceleration will vary along this [CurveTexture].
  146. </member>
  147. <member name="radial_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness">
  148. Radial acceleration randomness ratio. Default value: [code]0[/code].
  149. </member>
  150. <member name="scale" type="float" setter="set_param" getter="get_param">
  151. Initial scale applied to each particle.
  152. </member>
  153. <member name="scale_curve" type="Texture" setter="set_param_texture" getter="get_param_texture">
  154. Each particle's scale will vary along this [CurveTexture].
  155. </member>
  156. <member name="scale_random" type="float" setter="set_param_randomness" getter="get_param_randomness">
  157. Scale randomness ratio. Default value: [code]0[/code].
  158. </member>
  159. <member name="spread" type="float" setter="set_spread" getter="get_spread">
  160. Each particle's initial direction range from [code]+spread[/code] to [code]-spread[/code] degrees. Default value: [code]45[/code]. Applied to X/Z plane and Y/Z planes.
  161. </member>
  162. <member name="tangential_accel" type="float" setter="set_param" getter="get_param">
  163. Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion.
  164. </member>
  165. <member name="tangential_accel_curve" type="Texture" setter="set_param_texture" getter="get_param_texture">
  166. Each particle's tangential acceleration will vary along this [CurveTexture].
  167. </member>
  168. <member name="tangential_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness">
  169. Tangential acceleration randomness ratio. Default value: [code]0[/code].
  170. </member>
  171. <member name="trail_color_modifier" type="GradientTexture" setter="set_trail_color_modifier" getter="get_trail_color_modifier">
  172. Trail particles' color will vary along this [GradientTexture].
  173. </member>
  174. <member name="trail_divisor" type="int" setter="set_trail_divisor" getter="get_trail_divisor">
  175. Emitter will emit [code]amount[/code] divided by [code]trail_divisor[/code] particles. The remaining particles will be used as trail(s).
  176. </member>
  177. <member name="trail_size_modifier" type="CurveTexture" setter="set_trail_size_modifier" getter="get_trail_size_modifier">
  178. Trail particles' size will vary along this [CurveTexture].
  179. </member>
  180. </members>
  181. <constants>
  182. <constant name="PARAM_INITIAL_LINEAR_VELOCITY" value="0" enum="Parameter">
  183. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set initial velocity properties.
  184. </constant>
  185. <constant name="PARAM_ANGULAR_VELOCITY" value="1" enum="Parameter">
  186. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set angular velocity properties.
  187. </constant>
  188. <constant name="PARAM_ORBIT_VELOCITY" value="2" enum="Parameter">
  189. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set orbital_velocity properties.
  190. </constant>
  191. <constant name="PARAM_LINEAR_ACCEL" value="3" enum="Parameter">
  192. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set linear acceleration properties.
  193. </constant>
  194. <constant name="PARAM_RADIAL_ACCEL" value="4" enum="Parameter">
  195. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set radial acceleration properties.
  196. </constant>
  197. <constant name="PARAM_TANGENTIAL_ACCEL" value="5" enum="Parameter">
  198. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set tangential acceleration properties.
  199. </constant>
  200. <constant name="PARAM_DAMPING" value="6" enum="Parameter">
  201. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set damping properties.
  202. </constant>
  203. <constant name="PARAM_ANGLE" value="7" enum="Parameter">
  204. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set angle properties.
  205. </constant>
  206. <constant name="PARAM_SCALE" value="8" enum="Parameter">
  207. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set scale properties.
  208. </constant>
  209. <constant name="PARAM_HUE_VARIATION" value="9" enum="Parameter">
  210. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set hue_variation properties.
  211. </constant>
  212. <constant name="PARAM_ANIM_SPEED" value="10" enum="Parameter">
  213. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set animation speed properties.
  214. </constant>
  215. <constant name="PARAM_ANIM_OFFSET" value="11" enum="Parameter">
  216. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set animation offset properties.
  217. </constant>
  218. <constant name="PARAM_MAX" value="12" enum="Parameter">
  219. </constant>
  220. <constant name="FLAG_ALIGN_Y_TO_VELOCITY" value="0" enum="Flags">
  221. Use with [method set_flag] to set [member flag_align_y].
  222. </constant>
  223. <constant name="FLAG_ROTATE_Y" value="1" enum="Flags">
  224. Use with [method set_flag] to set [member flag_rotate_y]
  225. </constant>
  226. <constant name="FLAG_MAX" value="3" enum="Flags">
  227. </constant>
  228. <constant name="EMISSION_SHAPE_POINT" value="0" enum="EmissionShape">
  229. All particles will be emitted from a single point.
  230. </constant>
  231. <constant name="EMISSION_SHAPE_SPHERE" value="1" enum="EmissionShape">
  232. Particles will be emitted in the volume of a sphere.
  233. </constant>
  234. <constant name="EMISSION_SHAPE_BOX" value="2" enum="EmissionShape">
  235. Particles will be emitted in the volume of a box.
  236. </constant>
  237. <constant name="EMISSION_SHAPE_POINTS" value="3" enum="EmissionShape">
  238. Particles will be emitted at a position determined by sampling a random point on the [member emission_point_texture]. Particle color will be modulated by [member emission_color_texture].
  239. </constant>
  240. <constant name="EMISSION_SHAPE_DIRECTED_POINTS" value="4" enum="EmissionShape">
  241. Particles will be emitted at a position determined by sampling a random point on the [member emission_point_texture]. Particle velocity and rotation will be set based on [member emission_normal_texture]. Particle color will be modulated by [member emission_color_texture].
  242. </constant>
  243. </constants>
  244. </class>