Skip to content

Commit f6a1755

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

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

tutorials/shaders/shader_reference/spatial_shader.rst

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,16 @@ 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 lifetime randomness is set to ``0.6``, this value will be between
242+
``0.4`` and ``1.0``. If no lifetime randomness is used, this is always ``1.0``.
243+
244+
Additionally, ``USERDATA1`` is defined with the following value in the built-in :ref:`class_ParticleProcessMaterial`:
245+
246+
* **w**: Accumulated angle from angular velocity in radians, as applied by the angular velocity texture.
240247

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

0 commit comments

Comments
 (0)