Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Possible bug with ParticleSystem & sprite tight packing

Discussion in '2D' started by kumade, Jun 29, 2020.

  1. kumade

    kumade

    Joined:
    Nov 3, 2016
    Posts:
    52
    Hi everyone. I had the following issue that bugged me a lot but seems like I've found the solution recently. To reproduce it:
    1) Create new scene
    2) Add new particle system to it
    3) Add new material & choose shader Mobile/Particles/Alpha Blended
    4) Choose something as main texture (I have 64x64 png with white circle in the center, corners are transparent)
    5) Choose this material in the Rendering section of the particle system
    6) Create new atlas and add the particle texture to it
    7) DO NOT CHECK tight packing for the atlas
    8) Now you can try to emit some particles while in editing mode. Then select the particle material to see it in the inspector
    9) Launch the scene and behold how the material gets corrupted meaning it becomes completely black in the inspector preview and no particles are visible in the scene

    You can reselect texture in the material or restart editor to have the material show the particle again but anyway once you launch the game for the first time in the editor - the material gets corrupted again.

    To fix this - check Tight Packing for the atlas. At least only this thing worked for me and I guess it's definitely something wrong here.

    If anyone is interested in fixing the bug I could provide more details.

    EDIT: the tight packing flag doesn't always work :( It worked for me (could be just luck) then stopped, the results are not persistent. The only way I managed it to start showing particles and not having the corrupted material on scene start is to remove particle sprite from the atlas and have it as a separate image.
     
    Last edited: Jun 29, 2020
  2. kumade

    kumade

    Joined:
    Nov 3, 2016
    Posts:
    52
    No one is interested in the bug or it's already known? Or is it intended behavior?
     
  3. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,222
    kumade and richardkettlewell like this.
  4. kumade

    kumade

    Joined:
    Nov 3, 2016
    Posts:
    52
    Thank you Karl. I was looking for the bug reporting form and weren't able to find the link anywhere (menu, footer etc, lots of links but none of them says Bug Reports I guess :))
     
    karl_jones likes this.
  5. mahmoudsaberamin

    mahmoudsaberamin

    Joined:
    May 25, 2017
    Posts:
    11
    same bug here.
    the bug is explained well by Kumade.
    as a temp fix: change the material shader into particles alpha blended instead of mobile particles alpha blended and it works normal.