mob-sakai / ParticleEffectForUGUI

Render particle effect in UnityUI(uGUI). Maskable, sortable, and no extra Camera/RenderTexture/Canvas.
MIT License
4.41k stars 625 forks source link

Max particle size is limited to camera's orthographic size halved in Screen Space - Camera #291

Closed MaxMaletin closed 10 months ago

MaxMaletin commented 10 months ago

Reproduced with version 4.5.2 in unity 2021.3.11f1 and with version 4.6.0-preview.1 in unity 2021.3.34f1.

Steps:

  1. Set canvas render mode to screen space - camera, selected camera to orthographic and camera size to something small, let's say 5
  2. Create a simple particle system with size over lifetime curve. Curve's max value multiplied by initial particle size should be higher than camera's orthographic size halved.
  3. Create an empty object inside of canvas, make particle system a child of the object. Add UIParticle component. Set material to UI/Default.

Expected behaviour: Particles constantly change their size during their lifetime according to the curve. Their size is not limited.

Observed behaviour: Size of particles increases over time until maximum is reached, then they stay at maximum size until the curve multiplied by initial size dips below camera's orthographic size halved.

image

mob-sakai commented 10 months ago

Thank you for your reporting!

mob-sakai commented 10 months ago

Could you please attach a minimal project (included Assets, Packages and ProjectSettings directories) that reproduces the issue?

repos

MaxMaletin commented 10 months ago

MaxParticleSizeRepro.zip

mob-sakai commented 10 months ago

The issue can be resolved through two solutions:

Solution 1: (ParticleSystem) Increase the 'Max Particle Size' in the Render module.

image

Solution 2: (UIParticle) Set 'AutoScalingMode' to 'UIParticle'.

image
mob-sakai commented 10 months ago

By the way, I noticed that unintended scaling occurs when AutoScalingMode=UIParticle and ScalingMode=Local. It's a bug. 😇