-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Update particle builtins description in Spatial shader #11879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -234,9 +234,16 @@ However, the value passed to the fragment shader still comes from ``VERTEX``. | |
| For instancing, the ``INSTANCE_CUSTOM`` variable contains the instance custom data. When using particles, this information | ||
| is usually: | ||
|
|
||
| * **x**: Rotation angle in radians. | ||
| * **y**: Phase during lifetime (``0.0`` to ``1.0``). | ||
| * **z**: Animation frame. | ||
| * **x**: Current rotation angle in radians. | ||
| * **y**: Time the particle has been active in seconds. | ||
| * **z**: Current animation frame. | ||
| * **w**: Particle lifetime in seconds. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is incorrect. I don't know how to easily phrase it, but it contains the randomness of the lifetime. So for example a certain particle may have 0.9 in CUSTOM.w, meaning the particle lives for 90% of the specified lifetime. So when this particle dies, CUSTOM.y will contain 0.9. Dividing Y by W gives the correct result. I count on you all to figure out a phrasing for this, i have no idea how to make it intuitive. |
||
|
|
||
| To get the lifetime phase (ranging from ``0.0`` to ``1.0``), use ``CUSTOM.y / CUSTOM.w``. | ||
|
|
||
| Additionally, ``USERDATA1`` is defined with the following value in the built-in :ref:`class_ParticleProcessMaterial`: | ||
|
|
||
| * **w**: Accumulated angle from angular velocity in radians, as applied by the angular velocity texture. | ||
|
|
||
| This allows you to easily adjust the shader to a particle system using default particle material. When writing a custom particle | ||
| shader, this value can be used as desired. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.