Skip to content

Add Stretched Billboard render mode support to UIParticleSystem - #544

Open
Labu1 wants to merge 1 commit into
Unity-UI-Extensions:releasefrom
Labu1:repodestek/issue-423
Open

Labu1 wants to merge 1 commit into
Unity-UI-Extensions:releasefrom
Labu1:repodestek/issue-423

Conversation

@Labu1

@Labu1 Labu1 commented Dec 3, 2026

Copy link
Copy Markdown

Unity UI Extensions - Pull Request

Overview

Adds support for the Stretched Billboard render mode to UIParticleSystem. Previously the component ignored the ParticleSystemRenderer render mode and always drew regular billboards. The only way to get a stretched look was the _useLengthScale option, which ignored Speed Scale and had an axis bug.

Changes

  • When ParticleSystemRenderer.renderMode == ParticleSystemRenderMode.Stretch, each particle quad faces the particle's direction of travel. Its length follows Unity's formula, size * lengthScale + speed * velocityScale, and its width stays the particle size.
  • The direction comes from Particle.totalVelocity, so the Velocity over Lifetime and Force modules are included. For world simulation space the velocity is converted into the component's local space, the same space as the vertex positions, and it gets the same Shape scaling as positions. This is done in a new private helper, GetParticleVelocity.
  • The existing _useLengthScale option goes through the same code. This fixes a bug where a particle moving exactly along +X (rotation == 0) was stretched along Y instead of along its velocity.
  • use3dRotation is skipped for particles that face their velocity, as in Unity's stretched mode.
  • Reading pRenderer.lengthScale is now null-safe.
  • Other render modes (Billboard etc.) render exactly as before.

Not covered: Camera Speed Scale, Freeform Stretching, and the Mesh / Horizontal / Vertical Billboard modes. These could be follow-ups.

Breaking Changes

  • None expected. The only visible difference outside Stretched Billboard mode is the _useLengthScale fix for particles moving exactly along +X.

Related Submodule Changes

  • N/A

Testing status

  • No tests have been added.

No automated test command was detected, so tests were not run.

Manual testing status

Suggested check: put a UIParticleSystem on a Canvas, set the Particle System Renderer to Stretched Billboard, and change Speed Scale and Length Scale with Local and World simulation space. Particles should stretch along their direction of travel, and the stretch should grow with speed.


This PR was prepared with AI assistance (Claude) and reviewed by me before submitting.

When the ParticleSystemRenderer render mode is Stretched Billboard,
UIParticleSystem now aligns each particle quad with the particle's
total velocity and stretches it the same way Unity does:
length = size * lengthScale + speed * velocityScale, width = size.

The velocity is converted to the same space as the vertex positions
(world simulation space is transformed to local), so stretching is
correct regardless of simulation space. The existing "use length
scale" option now shares this path, which also fixes the case where a
particle moving exactly along +X was stretched vertically instead of
along its velocity. The renderer access is now null-safe.

Fixes Unity-UI-Extensions#423.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UIParticleSystem stretched billboard support

1 participant