ParticlesMaterial.xml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="ParticlesMaterial" inherits="Material" version="3.4">
  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. <methods>
  14. <method name="get_flag" qualifiers="const">
  15. <return type="bool">
  16. </return>
  17. <argument index="0" name="flag" type="int" enum="ParticlesMaterial.Flags">
  18. </argument>
  19. <description>
  20. Returns [code]true[/code] if the specified flag is enabled.
  21. </description>
  22. </method>
  23. <method name="get_param" qualifiers="const">
  24. <return type="float">
  25. </return>
  26. <argument index="0" name="param" type="int" enum="ParticlesMaterial.Parameter">
  27. </argument>
  28. <description>
  29. Returns the value of the specified parameter.
  30. </description>
  31. </method>
  32. <method name="get_param_randomness" qualifiers="const">
  33. <return type="float">
  34. </return>
  35. <argument index="0" name="param" type="int" enum="ParticlesMaterial.Parameter">
  36. </argument>
  37. <description>
  38. Returns the randomness ratio associated with the specified parameter.
  39. </description>
  40. </method>
  41. <method name="get_param_texture" qualifiers="const">
  42. <return type="Texture">
  43. </return>
  44. <argument index="0" name="param" type="int" enum="ParticlesMaterial.Parameter">
  45. </argument>
  46. <description>
  47. Returns the [Texture] used by the specified parameter.
  48. </description>
  49. </method>
  50. <method name="set_flag">
  51. <return type="void">
  52. </return>
  53. <argument index="0" name="flag" type="int" enum="ParticlesMaterial.Flags">
  54. </argument>
  55. <argument index="1" name="enable" type="bool">
  56. </argument>
  57. <description>
  58. If [code]true[/code], enables the specified flag. See [enum Flags] for options.
  59. </description>
  60. </method>
  61. <method name="set_param">
  62. <return type="void">
  63. </return>
  64. <argument index="0" name="param" type="int" enum="ParticlesMaterial.Parameter">
  65. </argument>
  66. <argument index="1" name="value" type="float">
  67. </argument>
  68. <description>
  69. Sets the specified [enum Parameter].
  70. </description>
  71. </method>
  72. <method name="set_param_randomness">
  73. <return type="void">
  74. </return>
  75. <argument index="0" name="param" type="int" enum="ParticlesMaterial.Parameter">
  76. </argument>
  77. <argument index="1" name="randomness" type="float">
  78. </argument>
  79. <description>
  80. Sets the randomness ratio for the specified [enum Parameter].
  81. </description>
  82. </method>
  83. <method name="set_param_texture">
  84. <return type="void">
  85. </return>
  86. <argument index="0" name="param" type="int" enum="ParticlesMaterial.Parameter">
  87. </argument>
  88. <argument index="1" name="texture" type="Texture">
  89. </argument>
  90. <description>
  91. Sets the [Texture] for the specified [enum Parameter].
  92. </description>
  93. </method>
  94. </methods>
  95. <members>
  96. <member name="angle" type="float" setter="set_param" getter="get_param" default="0.0">
  97. Initial rotation applied to each particle, in degrees.
  98. 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 [constant SpatialMaterial.BILLBOARD_PARTICLES].
  99. </member>
  100. <member name="angle_curve" type="Texture" setter="set_param_texture" getter="get_param_texture">
  101. Each particle's rotation will be animated along this [CurveTexture].
  102. </member>
  103. <member name="angle_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
  104. Rotation randomness ratio.
  105. </member>
  106. <member name="angular_velocity" type="float" setter="set_param" getter="get_param" default="0.0">
  107. Initial angular velocity applied to each particle. Sets the speed of rotation of the particle.
  108. 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 [constant SpatialMaterial.BILLBOARD_PARTICLES].
  109. </member>
  110. <member name="angular_velocity_curve" type="Texture" setter="set_param_texture" getter="get_param_texture">
  111. Each particle's angular velocity will vary along this [CurveTexture].
  112. </member>
  113. <member name="angular_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
  114. Angular velocity randomness ratio.
  115. </member>
  116. <member name="anim_offset" type="float" setter="set_param" getter="get_param" default="0.0">
  117. Particle animation offset.
  118. </member>
  119. <member name="anim_offset_curve" type="Texture" setter="set_param_texture" getter="get_param_texture">
  120. Each particle's animation offset will vary along this [CurveTexture].
  121. </member>
  122. <member name="anim_offset_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
  123. Animation offset randomness ratio.
  124. </member>
  125. <member name="anim_speed" type="float" setter="set_param" getter="get_param" default="0.0">
  126. Particle animation speed.
  127. </member>
  128. <member name="anim_speed_curve" type="Texture" setter="set_param_texture" getter="get_param_texture">
  129. Each particle's animation speed will vary along this [CurveTexture].
  130. </member>
  131. <member name="anim_speed_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
  132. Animation speed randomness ratio.
  133. </member>
  134. <member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 1, 1, 1, 1 )">
  135. 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].
  136. </member>
  137. <member name="color_ramp" type="Texture" setter="set_color_ramp" getter="get_color_ramp">
  138. Each particle's color will vary along this [GradientTexture].
  139. </member>
  140. <member name="damping" type="float" setter="set_param" getter="get_param" default="0.0">
  141. The rate at which particles lose velocity.
  142. </member>
  143. <member name="damping_curve" type="Texture" setter="set_param_texture" getter="get_param_texture">
  144. Damping will vary along this [CurveTexture].
  145. </member>
  146. <member name="damping_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
  147. Damping randomness ratio.
  148. </member>
  149. <member name="direction" type="Vector3" setter="set_direction" getter="get_direction" default="Vector3( 1, 0, 0 )">
  150. Unit vector specifying the particles' emission direction.
  151. </member>
  152. <member name="emission_box_extents" type="Vector3" setter="set_emission_box_extents" getter="get_emission_box_extents">
  153. The box's extents if [code]emission_shape[/code] is set to [constant EMISSION_SHAPE_BOX].
  154. </member>
  155. <member name="emission_color_texture" type="Texture" setter="set_emission_color_texture" getter="get_emission_color_texture">
  156. Particle color will be modulated by color determined by sampling this texture at the same point as the [member emission_point_texture].
  157. </member>
  158. <member name="emission_normal_texture" type="Texture" setter="set_emission_normal_texture" getter="get_emission_normal_texture">
  159. Particle velocity and rotation will be set by sampling this texture at the same point as the [member emission_point_texture]. Used only in [constant EMISSION_SHAPE_DIRECTED_POINTS]. Can be created automatically from mesh or node by selecting "Create Emission Points from Mesh/Node" under the "Particles" tool in the toolbar.
  160. </member>
  161. <member name="emission_point_count" type="int" setter="set_emission_point_count" getter="get_emission_point_count">
  162. The number of emission points if [code]emission_shape[/code] is set to [constant EMISSION_SHAPE_POINTS] or [constant EMISSION_SHAPE_DIRECTED_POINTS].
  163. </member>
  164. <member name="emission_point_texture" type="Texture" setter="set_emission_point_texture" getter="get_emission_point_texture">
  165. Particles will be emitted at positions determined by sampling this texture at a random position. Used with [constant EMISSION_SHAPE_POINTS] and [constant EMISSION_SHAPE_DIRECTED_POINTS]. Can be created automatically from mesh or node by selecting "Create Emission Points from Mesh/Node" under the "Particles" tool in the toolbar.
  166. </member>
  167. <member name="emission_ring_axis" type="Vector3" setter="set_emission_ring_axis" getter="get_emission_ring_axis" default="Vector3( 0, 0, 1 )">
  168. The axis of the ring when using the emitter [constant EMISSION_SHAPE_RING].
  169. </member>
  170. <member name="emission_ring_height" type="float" setter="set_emission_ring_height" getter="get_emission_ring_height">
  171. The height of the ring when using the emitter [constant EMISSION_SHAPE_RING].
  172. </member>
  173. <member name="emission_ring_inner_radius" type="float" setter="set_emission_ring_inner_radius" getter="get_emission_ring_inner_radius">
  174. The inner radius of the ring when using the emitter [constant EMISSION_SHAPE_RING].
  175. </member>
  176. <member name="emission_ring_radius" type="float" setter="set_emission_ring_radius" getter="get_emission_ring_radius">
  177. The radius of the ring when using the emitter [constant EMISSION_SHAPE_RING].
  178. </member>
  179. <member name="emission_shape" type="int" setter="set_emission_shape" getter="get_emission_shape" enum="ParticlesMaterial.EmissionShape" default="0">
  180. Particles will be emitted inside this region. Use [enum EmissionShape] constants for values.
  181. </member>
  182. <member name="emission_sphere_radius" type="float" setter="set_emission_sphere_radius" getter="get_emission_sphere_radius">
  183. The sphere's radius if [code]emission_shape[/code] is set to [constant EMISSION_SHAPE_SPHERE].
  184. </member>
  185. <member name="flag_align_y" type="bool" setter="set_flag" getter="get_flag" default="false">
  186. Align Y axis of particle with the direction of its velocity.
  187. </member>
  188. <member name="flag_disable_z" type="bool" setter="set_flag" getter="get_flag" default="false">
  189. If [code]true[/code], particles will not move on the z axis.
  190. </member>
  191. <member name="flag_rotate_y" type="bool" setter="set_flag" getter="get_flag" default="false">
  192. If [code]true[/code], particles rotate around Y axis by [member angle].
  193. </member>
  194. <member name="flatness" type="float" setter="set_flatness" getter="get_flatness" default="0.0">
  195. Amount of [member spread] along the Y axis.
  196. </member>
  197. <member name="gravity" type="Vector3" setter="set_gravity" getter="get_gravity" default="Vector3( 0, -9.8, 0 )">
  198. Gravity applied to every particle.
  199. </member>
  200. <member name="hue_variation" type="float" setter="set_param" getter="get_param" default="0.0">
  201. Initial hue variation applied to each particle.
  202. </member>
  203. <member name="hue_variation_curve" type="Texture" setter="set_param_texture" getter="get_param_texture">
  204. Each particle's hue will vary along this [CurveTexture].
  205. </member>
  206. <member name="hue_variation_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
  207. Hue variation randomness ratio.
  208. </member>
  209. <member name="initial_velocity" type="float" setter="set_param" getter="get_param" default="0.0">
  210. Initial velocity magnitude for each particle. Direction comes from [member spread] and the node's orientation.
  211. </member>
  212. <member name="initial_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
  213. Initial velocity randomness ratio.
  214. </member>
  215. <member name="lifetime_randomness" type="float" setter="set_lifetime_randomness" getter="get_lifetime_randomness" default="0.0">
  216. Particle lifetime randomness ratio.
  217. </member>
  218. <member name="linear_accel" type="float" setter="set_param" getter="get_param" default="0.0">
  219. Linear acceleration applied to each particle in the direction of motion.
  220. </member>
  221. <member name="linear_accel_curve" type="Texture" setter="set_param_texture" getter="get_param_texture">
  222. Each particle's linear acceleration will vary along this [CurveTexture].
  223. </member>
  224. <member name="linear_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
  225. Linear acceleration randomness ratio.
  226. </member>
  227. <member name="orbit_velocity" type="float" setter="set_param" getter="get_param">
  228. Orbital velocity applied to each particle. Makes the particles circle around origin. Specified in number of full rotations around origin per second.
  229. Only available when [member flag_disable_z] is [code]true[/code].
  230. </member>
  231. <member name="orbit_velocity_curve" type="Texture" setter="set_param_texture" getter="get_param_texture">
  232. Each particle's orbital velocity will vary along this [CurveTexture].
  233. </member>
  234. <member name="orbit_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness">
  235. Orbital velocity randomness ratio.
  236. </member>
  237. <member name="radial_accel" type="float" setter="set_param" getter="get_param" default="0.0">
  238. Radial acceleration applied to each particle. Makes particle accelerate away from origin.
  239. </member>
  240. <member name="radial_accel_curve" type="Texture" setter="set_param_texture" getter="get_param_texture">
  241. Each particle's radial acceleration will vary along this [CurveTexture].
  242. </member>
  243. <member name="radial_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
  244. Radial acceleration randomness ratio.
  245. </member>
  246. <member name="scale" type="float" setter="set_param" getter="get_param" default="1.0">
  247. Initial scale applied to each particle.
  248. </member>
  249. <member name="scale_curve" type="Texture" setter="set_param_texture" getter="get_param_texture">
  250. Each particle's scale will vary along this [CurveTexture].
  251. </member>
  252. <member name="scale_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
  253. Scale randomness ratio.
  254. </member>
  255. <member name="spread" type="float" setter="set_spread" getter="get_spread" default="45.0">
  256. Each particle's initial direction range from [code]+spread[/code] to [code]-spread[/code] degrees.
  257. </member>
  258. <member name="tangential_accel" type="float" setter="set_param" getter="get_param" default="0.0">
  259. Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion.
  260. </member>
  261. <member name="tangential_accel_curve" type="Texture" setter="set_param_texture" getter="get_param_texture">
  262. Each particle's tangential acceleration will vary along this [CurveTexture].
  263. </member>
  264. <member name="tangential_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0">
  265. Tangential acceleration randomness ratio.
  266. </member>
  267. <member name="trail_color_modifier" type="GradientTexture" setter="set_trail_color_modifier" getter="get_trail_color_modifier">
  268. Trail particles' color will vary along this [GradientTexture].
  269. </member>
  270. <member name="trail_divisor" type="int" setter="set_trail_divisor" getter="get_trail_divisor" default="1">
  271. Emitter will emit [code]amount[/code] divided by [code]trail_divisor[/code] particles. The remaining particles will be used as trail(s).
  272. </member>
  273. <member name="trail_size_modifier" type="CurveTexture" setter="set_trail_size_modifier" getter="get_trail_size_modifier">
  274. Trail particles' size will vary along this [CurveTexture].
  275. </member>
  276. </members>
  277. <constants>
  278. <constant name="PARAM_INITIAL_LINEAR_VELOCITY" value="0" enum="Parameter">
  279. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set initial velocity properties.
  280. </constant>
  281. <constant name="PARAM_ANGULAR_VELOCITY" value="1" enum="Parameter">
  282. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set angular velocity properties.
  283. </constant>
  284. <constant name="PARAM_ORBIT_VELOCITY" value="2" enum="Parameter">
  285. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set orbital velocity properties.
  286. </constant>
  287. <constant name="PARAM_LINEAR_ACCEL" value="3" enum="Parameter">
  288. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set linear acceleration properties.
  289. </constant>
  290. <constant name="PARAM_RADIAL_ACCEL" value="4" enum="Parameter">
  291. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set radial acceleration properties.
  292. </constant>
  293. <constant name="PARAM_TANGENTIAL_ACCEL" value="5" enum="Parameter">
  294. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set tangential acceleration properties.
  295. </constant>
  296. <constant name="PARAM_DAMPING" value="6" enum="Parameter">
  297. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set damping properties.
  298. </constant>
  299. <constant name="PARAM_ANGLE" value="7" enum="Parameter">
  300. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set angle properties.
  301. </constant>
  302. <constant name="PARAM_SCALE" value="8" enum="Parameter">
  303. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set scale properties.
  304. </constant>
  305. <constant name="PARAM_HUE_VARIATION" value="9" enum="Parameter">
  306. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set hue variation properties.
  307. </constant>
  308. <constant name="PARAM_ANIM_SPEED" value="10" enum="Parameter">
  309. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set animation speed properties.
  310. </constant>
  311. <constant name="PARAM_ANIM_OFFSET" value="11" enum="Parameter">
  312. Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set animation offset properties.
  313. </constant>
  314. <constant name="PARAM_MAX" value="12" enum="Parameter">
  315. Represents the size of the [enum Parameter] enum.
  316. </constant>
  317. <constant name="FLAG_ALIGN_Y_TO_VELOCITY" value="0" enum="Flags">
  318. Use with [method set_flag] to set [member flag_align_y].
  319. </constant>
  320. <constant name="FLAG_ROTATE_Y" value="1" enum="Flags">
  321. Use with [method set_flag] to set [member flag_rotate_y].
  322. </constant>
  323. <constant name="FLAG_DISABLE_Z" value="2" enum="Flags">
  324. Use with [method set_flag] to set [member flag_disable_z].
  325. </constant>
  326. <constant name="FLAG_MAX" value="3" enum="Flags">
  327. Represents the size of the [enum Flags] enum.
  328. </constant>
  329. <constant name="EMISSION_SHAPE_POINT" value="0" enum="EmissionShape">
  330. All particles will be emitted from a single point.
  331. </constant>
  332. <constant name="EMISSION_SHAPE_SPHERE" value="1" enum="EmissionShape">
  333. Particles will be emitted in the volume of a sphere.
  334. </constant>
  335. <constant name="EMISSION_SHAPE_BOX" value="2" enum="EmissionShape">
  336. Particles will be emitted in the volume of a box.
  337. </constant>
  338. <constant name="EMISSION_SHAPE_POINTS" value="3" enum="EmissionShape">
  339. 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].
  340. </constant>
  341. <constant name="EMISSION_SHAPE_DIRECTED_POINTS" value="4" enum="EmissionShape">
  342. 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].
  343. </constant>
  344. <constant name="EMISSION_SHAPE_RING" value="5" enum="EmissionShape">
  345. Particles will be emitted in a ring or cylinder.
  346. </constant>
  347. <constant name="EMISSION_SHAPE_MAX" value="6" enum="EmissionShape">
  348. Represents the size of the [enum EmissionShape] enum.
  349. </constant>
  350. </constants>
  351. </class>