Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[Official] Particle System [Shuriken] Improvements

Discussion in 'General Graphics' started by bibbinator, May 26, 2014.

  1. ifurkend

    ifurkend

    Joined:
    Sep 4, 2012
    Posts:
    349
  2. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    1,620
    Yes, there is.
     
    Archanor and karl_jones like this.
  3. ifurkend

    ifurkend

    Joined:
    Sep 4, 2012
    Posts:
    349
    Maybe Unity would default to linear for new project or hide gamma setting altogether, just like the rival engine? It is increasingly counterproductive to support gamma todays.
     
  4. gaxx

    gaxx

    Joined:
    Oct 14, 2012
    Posts:
    13
    Hey! Great additions recently with ribbons!

    I have a few ideas that I would like to share.

    1) Axis lock for ribbons, trails, and mesh renderer modes.

    For example - the ribbons are great tool for creating car tires trails but currently the ribbon is always facing the camera.
    There are multiple reasons why this is usefull - check out this presentation for example:



    2) Inherit color by mesh texture would be awesome too - I think we can now inherit by Vertex Color.

    3) I've always struggled with distribution of particles in every shape modes. Evenly distribution of particles in shapes like Sphere, Cylinder or Box. Currently they spawn randomly inside or on surface, often one on top of another. Would be great if they could somehow be evenly distributed like in Circle Shape mode "Burst Spread' but inside a volume.
    I know that I can use Mesh for a surface stuff but this is sometimes problematic. If I bump the emission higher than the vertex count it produces a lot of overdraw. Limiting particles to the number of verticies would be great.

    I hope this is not too fuzzy :)
     
    Last edited: Jan 26, 2018
    Archanor likes this.
  5. Moonjump

    Moonjump

    Joined:
    Apr 15, 2010
    Posts:
    2,396
    I'm replacing the legacy particle system with Shuriken as the old system is depreciated and I want to update to a new version of Unity. Performance differences have been a problem, but seemingly under control (and apparently will be much better once the switchover is complete and can update), but I am missing the Systematic option of the legacy system. This option places each new particle on the next vertex in vertex number order. Is there a similar option in Shuriken? I cannot find it so far.

    I use Systematic in 2 ways:

    1. I use the One Shot option (I assume Burst replaces One Shot?) with the same number of particles as there are vertices to create a shape I have built with a mesh, which then dissolves. Systematic means there is 1 particle on each vertex. Without it, randomness to the emission means some vertices get multiple particles, while others get none.

    2. Have a particle effect appear to travel along a complex path laid out by the vertices of a mesh. Each new particle appearing one vertex along, while the older ones fade out causes the travelling effect.
     
  6. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    4,178
    Have you tried the upgrader we made? https://forum.unity.com/threads/feedback-legacy-particle-system-updater.510880/
    It wont upgrade scripts but if you look at the code you should be able to see how the properties are mapped across.
     
    Moonjump likes this.
  7. Moonjump

    Moonjump

    Joined:
    Apr 15, 2010
    Posts:
    2,396
    Thank you, I hadn't seen that. Unfortunately Systematic is not mapped across. Continued exploration means I am pretty certain Systematic (or similar functionality) does not exist in Shuriken.

    The only way I have thought of replicating my first use case so far is to have a particle system for each individual particle and activate them all at the same time. Plus some variation for the second use case. Of course this is a horrible method.
     
  8. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    4,178
    Yes it seems that we dont have anything like Systematic, you are the first person to mention it. Can you explain a little how your effect works, maybe show a video or gif? We will consider an alternative way to do it or maybe even look into adding this feature.
     
  9. Moonjump

    Moonjump

    Joined:
    Apr 15, 2010
    Posts:
    2,396
    I'm busy with non-Unity work at the moment, so a video is not possible, but I will give a quick explanation.

    My game is a jigsaw/dominoes hybrid. To mark certain special moves, I create a large jigsaw piece outline made of around 200 small jigsaw piece shaped particles, which then disperse. I do similar things with other shapes, such as the outline of completed puzzles.

    Something else that I was doing was move confirmation. when a piece was placed, particles built up along the outline of the jigsaw piece. When the surround was completed, the move was confirmed (the player could tap to confirm or swipe to reject before completion). I have removed move confirmation, but was going to use a similar effect for the primary selection option on menus (buttons are often jigsaw piece shaped).
     
  10. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    1,620
    You're right - we don't have this in the current Particle System. Thanks for pointing it out - we're going to add it.
     
  11. Moonjump

    Moonjump

    Joined:
    Apr 15, 2010
    Posts:
    2,396
    Thank you. I look forward to it.
     
    dyupa, sevensails and karl_jones like this.
  12. sevensails

    sevensails

    Joined:
    Aug 22, 2013
    Posts:
    483
    +1 for this! Long before using Unity myself, my Custom Made Game Engine Particle System supported this and it would be nice to have this available on Unity! =)
     
  13. Moonjump

    Moonjump

    Joined:
    Apr 15, 2010
    Posts:
    2,396
    Do you know when Systematic will be added to Shuriken? I cannot see it in the release notes for 2018.1 or 2018.2. I have stayed on 5.6 because of this, but will need to update before releasing on iOS in a couple of months. I would jump straight to the beta if I knew it had it.
     
  14. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    1,620
    It's on track for 2018.3.
     
    Moonjump and karl_jones like this.
  15. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    4,178
    We actually showed it in use at our Unite Asia particles talk ;)
     
    Moonjump and richardkettlewell like this.
  16. dotsquid

    dotsquid

    Joined:
    Aug 11, 2016
    Posts:
    161
    Is it possible to make InheritVelocity module work with Custom simulation space?
    Consider a 2d game with an orthographic camera and parallax layers which follow the camera to mimic the parallax effect.
    In this case if we put a particle system inside one of parallax layers we can't use World simulation space because it won't look correct (the particle system will move in world space but stay static relatively to parallax layer). The only solution is to use Custom simulation space with parallax layer as relative transform.
     
    Last edited: May 25, 2018
  17. dotsquid

    dotsquid

    Joined:
    Aug 11, 2016
    Posts:
    161
    Any feedback?
    At first I thought that InheritVelocity does not work with Custom simulation space by design, but now I have a doubt because of this bug https://fogbugz.unity3d.com/default.asp?1046265_55al6968uo3r8a5v . Does it relate?

    UPD. Also I've noticed that bug report ( https://issuetracker.unity3d.com/is...et-to-zero-when-using-custom-simulation-space ) has completely wrong description and sense. Expected behaviour is green and red particles being emitted because they have non-zero Rate Over Distance.
     
    Last edited: Jun 7, 2018
  18. ifurkend

    ifurkend

    Joined:
    Sep 4, 2012
    Posts:
    349
    I am attempting ECS on Particle System before Job Systems because it seems slightly more attainable. I have an unimpressive but working ECS script. My question is how to avoid setting the module struct OnUpdate(). With the old OOP script I simply set it OnEnable() or Awake(). I know there is OnStart() for ECS, but I have trouble to make it work.

    Code (CSharp):
    1. using UnityEngine;
    2.  
    3. namespace Hybrid.Components {
    4.     public class Particle_ECS_data : MonoBehaviour {
    5.         public float _sizeScale = 2f;
    6.     }
    7. }
    Code (CSharp):
    1. using Hybrid.Components;
    2. using UnityEngine;
    3. using Unity.Entities;
    4.  
    5. namespace Hybrid.Systems {
    6.    public class Particle_ECS : ComponentSystem {
    7.        private struct Group {
    8.            public ParticleSystem _ps;
    9.            public Particle_ECS_data _data;
    10.        }
    11.        
    12.        override protected void OnUpdate() {
    13.            foreach (var e in GetEntities<Group>()) {
    14.                ParticleSystem.MainModule _ps_main = e._ps.main;
    15.                _ps_main.startSizeMultiplier = e._data._sizeScale;
    16.            }
    17.        }
    18.    }
    19. }
     
  19. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    1,620
    I’m not sure, we will look at the bug and figure out what’s going on. (FYI i sent it back to QA based on you saying they got the bug description wrong so they can re-review)
     
  20. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    1,620
    I’m not sure how ECS interacts with existing Unity stuff like Particle Systems. I recommend asking your question here: https://forum.unity.com/forums/entity-component-system-and-c-job-system.147/
     
  21. superpig

    superpig

    Quis aedificabit ipsos aedificatores? Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,337
    @ifurkend that question might be better suited to the ECS forum than this thread, but I think the recommended approach is to use a separate "initialize" component which you put on entities that need initialization, and then have a system which does the initialization and removes the component.
     
    richardkettlewell likes this.
  22. dotsquid

    dotsquid

    Joined:
    Aug 11, 2016
    Posts:
    161
    Hi again.
    Dominykas from QA marked this bug ( https://fogbugz.unity3d.com/default.asp?1046265_55al6968uo3r8a5v ) as "not a bug". You may check his arguments by following that link.
    However I believe that it is still a bug, because Rate over Distance must use velocity relative to Simulation Space and it does not matter which object is moving: the particle emitter or its Simulation Space transform.
    If it would help I can upload a unitypackage with a project for reproduction.
     
    Last edited: Jun 13, 2018
  23. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    1,620
    I will look at this myself, thanks for the report.
     
    karl_jones likes this.
  24. arzezniczak

    arzezniczak

    Joined:
    Feb 19, 2018
    Posts:
    14
    I've just reported a bug in particle system: https://fogbugz.unity3d.com/default.asp?1049033_qrj3lrlfklgjg7pn
    It looks like particle size and pivot are wrong with Rendering Mode set to Billboard Vertical or Horizontal.

    Here you can see size problem:


    And here you can see pivot problem:


    This functionality is crucial for my current task. I will appreaciate if anyone from development team take a look at it.
     
    Last edited: Jun 14, 2018
  25. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    1,620
    QA haven't processed your report yet, but a quick suggestion is to try using Billboard Render Mode and set the Render Alignment to World or Local instead. Pivot may behave more as you expect with this setup.
     
    arzezniczak and karl_jones like this.
  26. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    1,620
    Guessing you have soft particles enabled. Turn it off or reduce the fade out distance. The built in Standard Particle Shaders have nice controls for the fade distance. (2017.4 and newer)
     
    karl_jones and Archanor like this.
  27. musolo

    musolo

    Joined:
    Sep 12, 2014
    Posts:
    233
    Hi! It would be cool to be able to have in inspector the speed parameter in Texture Sheet Animation section.Currently if i have only 2 by 2 flame texture sheet it will look as if it is slow motion. and if i apply 10 by 10 texture sheet it appears to the viewer as if it plays mush faster. There is often a need to slow down or speed up the rate of going through tiles.
    Thanks!
     
  28. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    1,620
    Does the “cycles” parameter help with this? It allows the animation to play N times during the life of a particle, instead of only once.

    Alternatively, 2018.3 let’s you use a fixed FPS mode where frames play at the given speed regardless of particle lifetime.
     
    Archanor and karl_jones like this.
  29. musolo

    musolo

    Joined:
    Sep 12, 2014
    Posts:
    233
    Thanks! cicles parameter in T.S.A section did the trick.
    I`m making volley of fire arrows sent in an arch trajectiry towards target. to enable gpu instancing i`m using meshes in render section instead of billboards. It does the trick with them having right rotation turing the trajectory travel. But when they hit the ground they stop at the ground level as they shoud. But they go horizontal next moment they hit the ground.
    Shouldn`t they rather stay at approaching angle to the ground instead of going perfectly horizontal pozition?
    How do i make prticles keep theyr approashing angle after they hit earth`s collider ( roughly 45 degrees to ground plane)?
    Thanks!
     
  30. musolo

    musolo

    Joined:
    Sep 12, 2014
    Posts:
    233
    Hi! I have few hundred particle emiters for volleys of burning arrows. I used trails for fire and its quite performance heavy. I thought about making mesh with two materials one material for arrow and second for fire (animated sprite sheet via c# script)
    Arrow mesh with two materials in it looks good enough in runtime. But it looks like i`ll not be able to use resulted prefab with shuriken. It will take only mesh with one material on it. So the only alternatives would be :
    1 to make shader that takes two textures and apply them to corresponding material id`s and will animate fire texture (not sure if it will work with shuriken this way either)
    2 If it is not an option then to actually use projectiles instead of shuriken. Given projectiles will do only a collision to spawn small fire(shuriken particle) will it be more performant than using shuriken arrows with trails(4 quads short trail)?
    Thanks!
     
  31. Archanor

    Archanor

    Joined:
    Dec 2, 2013
    Posts:
    465
    @richardkettlewell I'm not completely up to date (I'm still in 2017.4), but I had a couple of ideas lately when working.

    1. Would it be possible for the Collission module to support different shape types such as a cube or use one or several custom meshes in a similar setup to the Renderer tab?

    2. Multi-particle system editing is a great time-saver, but I had some issues when graphs are involved. When selecting two particle systems with different graphs, you just get a blank space you can't edit.

    Unity_2019-08-19_17-33-09.png

    I think the only way to work them is if you edit them both from the start, or 'synchronize' them by using Preset graphs.

    So the idea is to be able to right-click a module and copy/paste over the info to the same type of module in another particle system. Could be pretty handy.
     
  32. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    1,620
    The only way to do this right now is to use the World collision mode, and use layers to define which objects the system can collide with. This gives you access to all the collision shapes supported in Unity.

    In this case, you have the 2 curves set to different modes. If you choose the dropdown arrow on the right, and set that, the 2 curves will then be in the same mode. This opens up the ability to copy/paste a curve onto multiple systems. Hope it makes sense!

    Thanks for the feedback!
     
    Archanor likes this.
  33. Archanor

    Archanor

    Joined:
    Dec 2, 2013
    Posts:
    465
    @richardkettlewell What I mean is being able to alter the collider of the actual particles (not what they collide with) from the standard sphere to a cube or custom mesh. The only option related to this is Radius Scale.

    I was imagining something like a one-shot particle system of cubes being thrown down the stairs where they'd tumble down and land realistically. I guess there would have to be an option for rigidbodies and different colliders. I don't know if this would be viable to implement? :)
     
  34. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    1,620
    Ah, sorry, i misunderstood! It would be a great feature but it's not something we envisage adding to the Particle System in the near future, as it would be difficult to achieve without a deeper integration with PhysX. Right now we use PhysX to detect collisions, but then perform our own simple+fast bounce logic which is based on spheres. Any other primitive type would require a lot more maths, or a large redesign of how the Particle System interacts with PhysX. Sorry :(

    With Unity's recent push towards ECS, the way we imagine solving this use case in the future is to use the new Physics package, which, when used with ECS, supports very large numbers of objects. Some more details can be found here: https://blogs.unity3d.com/2019/03/19/announcing-unity-and-havok-physics-for-dots/
     
    karl_jones, Archanor and Martin_H like this.
  35. riba78

    riba78

    Joined:
    Feb 16, 2018
    Posts:
    25
    In the blog post related to the Spaceship Demo project I've read this interesting point: Octagon Particle.
    Is it possible to have as new primitive for billboard particles?
    It should be a nice improvement both for everyone is not using HDRP and VFX Graph
     
  36. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    4,178
    You can use a mesh particle if you want an octagon particle.
     
  37. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,427
    I think he's asking for an Octagon billboard
     
  38. Archanor

    Archanor

    Joined:
    Dec 2, 2013
    Posts:
    465
    You can have mesh particles face the camera in the Renderer tab, this way you could make it any shape. It would pretty much behave like a normal Billboard particle.
     
    richardkettlewell likes this.
  39. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,427
    Oh that's new, since when???!!!!
     
  40. Archanor

    Archanor

    Joined:
    Dec 2, 2013
    Posts:
    465
    @Reanimate_L Not exactly sure. I'm working in 2017.4 LTS and it's available there :)

    Unity_2019-08-25_15-57-23.png
     
  41. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,427
    Oh wait that option also work for mesh render mode!!??? oh wow!!!!
     
    Archanor and richardkettlewell like this.
  42. riba78

    riba78

    Joined:
    Feb 16, 2018
    Posts:
    25
    thank you guys.
    I've never seen that we have "now" that option.... ok.. I'll do my Octagon Billboard :)

    Thank you very much and thank you Unity devs.
     
    richardkettlewell likes this.
  43. Archanor

    Archanor

    Joined:
    Dec 2, 2013
    Posts:
    465
    Something I get asked a lot from my asset store customers is "How can I make particles work in the UI Canvas?". They talk about using particles to make buttons glow or catch fire, or emit confetti over win screens on mobile games.

    Is there a recommended way to utilize particles for UI?

    Some workarounds I found mentioned camera layering/stacking or using a hacked or custom shader to have particles render in the UI Canvas.

    Maybe it could be an option in the Standard Particle Shader to have them render in the UI Canvas?
     
  44. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    4,178
    We have some scripting API which can be used to add particles to UI.
    The problem is that the UI generates its own mesh which is then used to render, so in order to be part of the UI the particles must become part of that UI Mesh, a shader would not do this. We provide a BakeMesh api which lets you get a Mesh version of the particle system which can then be fed into the UI.
    This is the best solution I am aware of that uses this api https://github.com/mob-sakai/ParticleEffectForUGUI

    We have done some work internally to find a solution, something that is still ongoing(No ETA im afraid).
     
unityunity