Skip to content

Update particle builtins description in Spatial shader#11879

Open
Calinou wants to merge 1 commit intogodotengine:masterfrom
Calinou:spatial-shader-particle-builtins
Open

Update particle builtins description in Spatial shader#11879
Calinou wants to merge 1 commit intogodotengine:masterfrom
Calinou:spatial-shader-particle-builtins

Conversation

@Calinou
Copy link
Copy Markdown
Member

@Calinou Calinou commented Mar 26, 2026

If we want to merge this now, I can remove the USERDATA1 note and split it to its own PR.

PS: USERDATA1-6 aren't documented anywhere in the manual. What would be the best place to introduce it? These are only available in particle shaders.

@Calinou Calinou requested review from a team as code owners March 26, 2026 23:28
@Calinou Calinou added bug area:manual Issues and PRs related to the Manual/Tutorials section of the documentation waiting on pr merge PRs that can't be merged until an engine PR is merged first labels Mar 26, 2026
Comment thread tutorials/shaders/shader_reference/spatial_shader.rst
@paddy-exe
Copy link
Copy Markdown
Contributor

PS: USERDATA1-6 aren't documented anywhere in the manual. What would be the best place to introduce it? These are only available in particle shaders.

I would argue in the particle shader page as a separate section with a barebone example on how to read/write the values.

@Calinou Calinou force-pushed the spatial-shader-particle-builtins branch from ef795b6 to 9ba6fb1 Compare April 4, 2026 16:38
* **x**: Current rotation angle in radians.
* **y**: Time the particle has been active in seconds.
* **z**: Current animation frame.
* **w**: Particle lifetime in seconds.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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.

@skyace65 skyace65 added topic:shaders and removed waiting on pr merge PRs that can't be merged until an engine PR is merged first labels Apr 18, 2026
@skyace65
Copy link
Copy Markdown
Contributor

@Calinou Poke. Please see QbieShay's review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:manual Issues and PRs related to the Manual/Tutorials section of the documentation bug topic:shaders

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants