Skip to content

Add uniform random scale to ParticleVector2Parameter#1130

Merged
AristurtleDev merged 2 commits into
developfrom
feature/uniform-scale-for-particles
Mar 25, 2026
Merged

Add uniform random scale to ParticleVector2Parameter#1130
AristurtleDev merged 2 commits into
developfrom
feature/uniform-scale-for-particles

Conversation

@AristurtleDev

Copy link
Copy Markdown
Collaborator

Description

Adds a Uniform flag to ParticleVector2Parameter that, when set with Kind = Random, samples a single float and applies it to both X and Y axes. This guarantees per particle aspect ratio preservation when using random scale on a particle emitter. Without this flag, X and Y are sampled independently, meaning each particle can receive a non square scale even when the min/max range is symmetric.

Related Issues/Tickets

Changes Made

  • ParticleVector2Parameter: added public bool Uniform field (default false); updated the Value getter to sample a single value from the X range and return Vector2(s, s) when Uniform is true and Kind is Random.
  • ParticleEffectSerializer: reads the Uniform XML attribute with a default of false; writes it only when true, preserving backward compatibility with existing .ember files.
  • ParticleEffectReader / ParticleEffectWriter: same read/write changes for the content pipeline (.xnb) variants.

Checklist

  • I have verified that there are no existing pull requests that would overlap with this pull request.
  • I have verified that I am following the guidelines as outlined in this project's contribution policy
  • I have verified that this pull request adheres to this project's code of conduct.
  • I have written a descriptive title for this pull request.
  • I have provided appropriate test coverage were applicable.

@AristurtleDev AristurtleDev self-assigned this Mar 25, 2026
@AristurtleDev
AristurtleDev merged commit 25d9e31 into develop Mar 25, 2026
1 check passed
@AristurtleDev
AristurtleDev deleted the feature/uniform-scale-for-particles branch March 25, 2026 18:34
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.

1 participant