Skip to content

Commit 20b9689

Browse files
committed
Update particle builtins description in Spatial shader
1 parent 085cd03 commit 20b9689

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

tutorials/shaders/shader_reference/spatial_shader.rst

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,17 @@ However, the value passed to the fragment shader still comes from ``VERTEX``.
234234
For instancing, the ``INSTANCE_CUSTOM`` variable contains the instance custom data. When using particles, this information
235235
is usually:
236236

237-
* **x**: Rotation angle in radians.
238-
* **y**: Phase during lifetime (``0.0`` to ``1.0``).
239-
* **z**: Animation frame.
237+
* **x**: Current rotation angle in radians.
238+
* **y**: Time the particle has been active in seconds.
239+
* **z**: Current animation frame.
240+
* **w**: Particle lifetime multiplier from lifetime randomness (lower is shorter).
241+
For example, if the **Lifetime Randomness** property is set to ``0.6``,
242+
this value will be between ``0.4`` and ``1.0``. If no lifetime randomness is used,
243+
this is always ``1.0``.
244+
245+
Additionally, ``USERDATA1`` is defined with the following value in the built-in :ref:`class_ParticleProcessMaterial`:
246+
247+
* **w**: Accumulated angle from angular velocity in radians, as applied by the angular velocity texture.
240248

241249
This allows you to easily adjust the shader to a particle system using default particle material. When writing a custom particle
242250
shader, this value can be used as desired.

0 commit comments

Comments
 (0)