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

Shuriken, the new particle system

Discussion in 'Developer Preview Archive' started by Artimese, Dec 25, 2011.

?

How is the new system?

  1. Its great as it is, nothing needs to be changed.

    195 vote(s)
    56.0%
  2. Its too complicated to use, it must be simplified!

    108 vote(s)
    31.0%
  3. Its too hard to learn, I will not use this new system.

    45 vote(s)
    12.9%
  1. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    Sorry, but this is the response I got when I asked:
    I didn't really ask if it works for iOS, I asked if its good for iOS...thanks for the response. I guess I'll wait for batching to be added before I divulge into this...
     
    Last edited: Mar 8, 2012
  2. Django

    Django

    Joined:
    Nov 25, 2008
    Posts:
    120
    My bad then ! Sorry I understood the question wrong !
     
    Last edited: Mar 8, 2012
  3. J_P_

    J_P_

    Joined:
    Jan 9, 2010
    Posts:
    1,027
    So I have a particle prefab and want it to collide, but because the prefab lives in the project view I can't select scene object references — do I have to set the Planes transforms in script? I'm not seeing anything in the docs http://unity3d.com/support/documentation/ScriptReference/ParticleSystem.html

    Surely it's possible to instantiate a particle system that can collide with something..

    edit: I guess I could have a dummy set up in the scene and just duplicate that, but that seems like a dirty workaround

    another question: how can I tell it to stop rotating particles upon collision?
     
    Last edited: Mar 8, 2012
  4. J_P_

    J_P_

    Joined:
    Jan 9, 2010
    Posts:
    1,027
    I really don't like the collision capabilities of Shuriken...

    I want the particles to first burst, then fall to rest on the ground and stop rotating.

    As far as I know, I can't tell it to stop rotating when it collides. So instead, I kill that particle and use a sub system. Problem here is that I can't give it a rotation on each axis, so they all are laying flat on the ground the same.

    Another problem is that the collision detection seems unreliable. I still have some particles that just pass right through and continue on. and of course, being limited to planar collision detection is annoying, too. Especially because we have to reference a transform and can't modify it through script. Why not just let us provide a float?
     
  5. XeviaN360

    XeviaN360

    Joined:
    Jun 3, 2010
    Posts:
    181
    Hi, i'm writing a shader to be used with shuriken. The _Color parameter doesn't works according to "Color over Lifetime" parameter. What is the name of the variable to be used in shaders for sample this color?

    Thanks.
     
  6. WBDN

    WBDN

    Joined:
    Dec 23, 2011
    Posts:
    109
  7. ThomHurks

    ThomHurks

    Joined:
    Jul 27, 2010
    Posts:
    22
    Is it actually possible to have multiple sub emitters? I think it should be possible, but I can't figure out how to do this! Can anyone provide help?
     
  8. WBDN

    WBDN

    Joined:
    Dec 23, 2011
    Posts:
    109
    Not in 3.5.
     
  9. ThomHurks

    ThomHurks

    Joined:
    Jul 27, 2010
    Posts:
    22
    So this will be in an upcoming release? What would be the solution for now then? To clarify, our use case is an emitted fireball (from an explosion) that leaves behind smoke, cinders and some debris as it flies through the air. Right now we can't do this as you can only have one sub-emitter on the particle, unless there is some workaround?
     
    Last edited: Mar 14, 2012
  10. WBDN

    WBDN

    Joined:
    Dec 23, 2011
    Posts:
    109
    Yes, currently we plan to support 2 sub emitters per type in an upcoming release (disclaimer: this is not a promise).

    Possible workaround:
    1. On the parent emitter, go into debug inspector and set random seed to a non-zero value, like 5 (or set it from script).
    2. Duplicate the parent emitter (that does emission)
    3. Change sub emitter on one of them.
    4. Make one of the parent emitters child of the other to make sure they play at the same time.
    5. Disable the renderer on one of them (so parent isn't drawn twice).

    Setting the random seed to the same value on both emitters means they will simulate exactly the same, and emit identically, but with different sub emitters.

    Hope that helps!
     
    Last edited: Mar 14, 2012
  11. ThomHurks

    ThomHurks

    Joined:
    Jul 27, 2010
    Posts:
    22
    It does, thank you!
     
  12. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    OH GAWD. That is an essential fix!!! When can we expect a bug fix like that to be ready for download? :D
    Seriously, I really do hope Unity Technology have a more periodic release schedule like UDK's monthly schedule where critical bugs are fixed and monthly builds are released along with new features!
     
  13. alleycatsphinx

    alleycatsphinx

    Joined:
    Jan 25, 2012
    Posts:
    57
    For supporting anything I've needed beyond the existing system (multiple sub emitters, procedural motion, attraction, etc...) I've been instantiating a game object and attaching particles via script.

    This works pretty great, but I'm having trouble with the error: "UpdateParticle system should not happen on disabled GO"

    I'm calling .SetActiveRecursively(true);, but I must be missing something else...
     
  14. WBDN

    WBDN

    Joined:
    Dec 23, 2011
    Posts:
    109
    You're never ever supposed to get that error. Can you submit a bug that reproduces it? Then I can also find out why.
     
  15. XeviaN360

    XeviaN360

    Joined:
    Jun 3, 2010
    Posts:
    181
    Oh, i see, thank you William!
    I'll try to ask another rtfm question: why isn't the MaxParticles parameter exposed? I'd like to scale the quality of particle systems via script (according to Quality Settings) but i can only scale "emissionRate" parameter, for example. This is not the same as could be changing MaxParticles value. I know, i could change emissionRate and particles life.... hmm... a little tricky...

    Thanks again
     
  16. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    I've been messing around with the new system for a couple weeks and I really like it a lot. it has a bit of a learning curve as did the original system, but it is obviously way more powerful and worth a little bit of time investment to figure it out. I do have one question though... I can't seem to be able to resize the particle sytem via Javascript. the 'ParticleCount' function is read only... do you have to destroy the whole system in order to resize the particles array... ?
     
  17. dw

    dw

    Joined:
    Feb 2, 2012
    Posts:
    10
    Poll is biased. I would like an option "its still not complicated enough" =P

    Here is my 2 cents.
    $shuri_random_glitch.jpg
    Seems as random isn't really random - in that image larger particles prefer negative X direction. Or is it me and there is a way to control this thing?

    Velocity over Lifetime setup:
    X from 6 to -6
    Y from 4 to -4
    Z from 4 to 2
    Transform, rot : -90, 0, 0

    I'd really be nice to have bugfixes for those nasty crashes as soon as possible.
     
  18. Itaros

    Itaros

    Joined:
    Mar 20, 2012
    Posts:
    9
    The new system is oversimplified. The Legacy was much more powerful, I think. But graphs feature is good. And small misunderstanding: Low Start Delay seems to be rounding to zero. If I set it to 0.10 it means that I need a delay at least 1 update cycle, not being it rounded to 0. 0.10 means that it must be delayed. Instead I can set it to zero, isn't? :)))

    And there is no real randomization. It lacks real flexibility
     
  19. kromenak

    kromenak

    Joined:
    Feb 9, 2011
    Posts:
    270
    Just wanted to pop in to say that I think the new system is very cool, but it lacks control from the programming side. It would be awesome to have more control, say for changing aspects of a system through script based on some variable values. Right now, I'm interpolating a few elements of a particle system based on such things.

    Additionally, it would be cool to support interpolation between particle systems. For example, I have a heavy and light rain particle system; interpolating between the settings in the two on a 0-100% scale would be useful, I think. I could make something like this myself, but again, not enough exposure in scripts!
     
  20. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    I'm using Shuriken to generate great looking missile contrails, but...

    When I pool the destroyed missiles and reuse them I get a relocation trail joining the destroyed position of the missile with the launch position.



    I'm using distance based emission to ensure the trails look good.

    But even on destruction when I...
    1. Stop the particle system.
    2. Clear it.
    3. Disable looping.
    4. Then disable the missile.

    Reused missiles are then taken from the pool re-located, re-enabled and their thruster particles systems are reset.

    Am I missing something that will prevent these trails from appearing?
     
    Last edited: Mar 23, 2012
  21. WBDN

    WBDN

    Joined:
    Dec 23, 2011
    Posts:
    109
    1. Randomness issue has been taken care of and will be in future version.
    2. What nasty crash? Is there a bug report on that? If not, please submit one so we can fix it.
     
  22. WBDN

    WBDN

    Joined:
    Dec 23, 2011
    Posts:
    109
    Have you tried disabling emission?

    ParticleSystem.enableEmission
    When set to false, the particle system will not emit particles
     
  23. dw

    dw

    Joined:
    Feb 2, 2012
    Posts:
    10
    Sorry for confusing you. Its been reported already, I was referring to "destroy/dealloc crash - particlesystem - ios".
     
  24. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    Thanks for that but no still getting trails from the move.

    Wierd, I'm using the OnDisable() method to shut down the particle system and only restarting it when it is actually launched from the turret.
     
  25. WBDN

    WBDN

    Joined:
    Dec 23, 2011
    Posts:
    109
    Okay. Can you file a bug with a simple repro?

    Thanks.
     
  26. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    Shuriken particle emission bug filed: 453045
     
    Last edited: Mar 23, 2012
  27. sibhod

    sibhod

    Joined:
    Apr 13, 2009
    Posts:
    20
    I've having serious issues with Shuriken and the web player. I had been testing with the 3.5.0b6 webplayer, and everything was working fine, but when I view the game on a computer with more recent webplayer versions( 3.5.0f6, 3.5 RC1 ) the particles are very small and don't animate how they do in 3.5.0b6 webplayer or the in-app player.

    edit: I finally managed to fix the problem by reinstalling Unity and my webplayer. phew
     
    Last edited: Mar 29, 2012
  28. Bezzy

    Bezzy

    Joined:
    Apr 1, 2009
    Posts:
    75
    Having a lot of fun with the new system. Noticing a few issues here and there, but nothing fundamentally wrong.

    With Start Rotation, we're given access to a single float - for flat quads this is probably fine, but I'm working with meshes, and i would require a little more control over the randomization of a full quaternion. I guess it's hard to fit tat on a ui.

    When emitting using a mesh, there seems to be no way to manipulate the transform of the mesh itself, except for moving and scaling the transform of the GO itself. I guess that's alright, but it could be very handy to have a sub-scale and rotation.

    I've also been trying to make a radial explosion (think of the remastered Death Star explosion, but made of particles, and not just one large quad expanding), whereby each particle explodes out in a random direction (just in X,Z, no velocity in Y), with a fixed velocity in that direction. I can't seem to get this effect to work because of the velocity over time curve - it effectively gives me a random spread of velocities across the two directions, meaning that most particles will hang around in the middle of the disc.

    Any suggestions how to achieve this effect using this system?
     
  29. WBDN

    WBDN

    Joined:
    Dec 23, 2011
    Posts:
    109
    Cone emitter with angle = 90.0 and radius = 0.0 will give you this.
     
  30. Patapouffe

    Patapouffe

    Joined:
    Apr 3, 2010
    Posts:
    88
    The system is really nice ! Good job!

    If I had to ask for one thing however, it would be to have more control over rotation of meshes (x,y,z) instead of having just one rotation value. I'm also working on an explosion like Bezzy but having trouble rotating the mesh particles like I want them to. Works fine with quads but not for a mesh. That feature would be really helpful !
     
  31. RElam

    RElam

    Joined:
    Nov 16, 2009
    Posts:
    375
    I also noticed that the Random Row option is not so random, it seems to disperse based on random lifespan if set. So I've got an explosion made of particles, and multiple billboards representing it, but it looks kinda rough because the last particles to fade out seem to be using the same row.

    Also, what about tangents so we can do normal mapping. They did not seem to be set correctly either in any of my tests.
     
    Last edited: Mar 27, 2012
  32. mcroswell

    mcroswell

    Joined:
    Jan 6, 2010
    Posts:
    79
    The Poll
    What a strange poll! Our only choices are 1) great, 2) complicated or 3) hard to learn (the last two are really the same option).

    What about: Does it expose enough functionality? Is it flexible? Are the exposed variables name well? Are they well documented? Is the behavior as you'd expect? Does it have serious flaws? If so, what are they?

    One Major Problem
    The problem with the new Shuriken system is that it does not expose enough of the inner working for programmatic manipulation.

    For example, there is no way to get at the "Velocity over Lifetime" values in code. Or any of the other "modules", or am I missing something?


    By the way: Whoever did the fireworks scene that came with the ShurikenExamples did some awesome work. Really nice!
     
  33. lilymontoute

    lilymontoute

    Joined:
    Feb 8, 2011
    Posts:
    1,181
    I second this issue - I'd love for some way to get access to particle modules, at the very least something like GetModule(string name).GetProperty(string name) if for some reason it's hard to expose it directly.
     
  34. mcroswell

    mcroswell

    Joined:
    Jan 6, 2010
    Posts:
    79
    If I recall, one way to get this error is to go into the ShurikenExamples and disable a sub-emitter.

    Actually, this is not correct, I forgot: if you disable, say the SmokeEmitter in the Fireworks scene, it will crash Unity.
     
  35. WBDN

    WBDN

    Joined:
    Dec 23, 2011
    Posts:
    109
    Since there seems to be a lot of noise about randomness in here I would just like to say that this is a known issue. There are a lot of properties that are random in the same way, i.e. there is strong correlation between randomness in different parts of the system.

    I have fixed this, and it will be available in a future release of Unity.
     
  36. ratamorph

    ratamorph

    Joined:
    Sep 2, 2007
    Posts:
    458
    Where is this lock to transform setting I keep reading about? I can't see it, sound to me like it would do something very similar to simulate in local space, was the option renamed or what's the difference and where is the option?

    Also I'm experiencing some strange jittering with the particles when I parent them to the camera and the camera is moving quickly. These effects are set to simulate in local space and inherit 0 of the velocity.
     
  37. taumel

    taumel

    Joined:
    Jun 9, 2005
    Posts:
    5,292
    Btw. would it be possible getting the pause exposed in the particle settings as well?
     
  38. LucidMovement

    LucidMovement

    Joined:
    Jun 11, 2009
    Posts:
    14
    Are there any changes in the pipe that will improve the CPU performance on iOS? The old system seems to be much more perf friendly on iOS than this one.
     
  39. Django

    Django

    Joined:
    Nov 25, 2008
    Posts:
    120
    Hey Lucid,

    Have you done a comparison of performance of both systems on iOS ? I'd be interested in the results. What devices did you test it on ?

    The new system is actually multithreaded so thats a nice improvement right there. Also Batching DC of emitters will come in a future update so that's one I really look forward to.
     
  40. WBDN

    WBDN

    Joined:
    Dec 23, 2011
    Posts:
    109
    This is the same thing as simulation space. It was called lock to transform during the beta period but was renamed.

    Can you bug it please?
     
  41. J_P_

    J_P_

    Joined:
    Jan 9, 2010
    Posts:
    1,027
    This is my main complaint. I guess for typical games, it's common to just set up an effect and fire it when you need it -- in my case, I'm often wanting to add procedural variety and I'm finding the new system to be restrictive.

    One example of me having to come up with a silly workaround (because the color over time module isn't accessible): http://forum.unity3d.com/threads/12...nspector-variable-I-can-access-through-script

    I ended up having something close to what I wanted, but it's not even close to being ideal.
     
  42. taumel

    taumel

    Joined:
    Jun 9, 2005
    Posts:
    5,292
    Why does an initialisation with longer lifetimes takes longer/hogs the CPU?
     
    Last edited: Mar 29, 2012
  43. manutoo

    manutoo

    Joined:
    Jul 13, 2010
    Posts:
    522
    I'd like to be able to change the mesh emitter at runtime through script.
     
  44. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    Do you have the prewarm checkbox enabled? This makes sure that even on the first frame the particle system is fully initialized.
    Turn off the checkbox if it's not the behaviour you want.
     
  45. manutoo

    manutoo

    Joined:
    Jul 13, 2010
    Posts:
    522
    No, I'd like to set the emitter mesh at runtime, so I can use the same Particle System on different meshes. Something like this :
    Code (csharp):
    1. public Mesh SomeMesh;
    2. [...]
    3. ParticleSystem Ps = GetComponent<ParticleSystem>();
    4. Ps.mesh = SomeMesh;
    Now, it seems that if I want to use the same particle system with different kind of mesh emitters, I have to duplicate it in the editor and create 1 prefab for each mesh I want.

    I hope I'm more clear this time... :)
     
  46. LucidMovement

    LucidMovement

    Joined:
    Jun 11, 2009
    Posts:
    14
    We have. I can't publish the data yet, waiting on approval. The gist of it is that the old system is much friendlier to the iPad2 than the new one is, specifically on the CPU. On PC the new one is better in nearly all respects. Haven't run my android test yet. I'll post more when I am able.
     
  47. unormal

    unormal

    Joined:
    Jan 10, 2012
    Posts:
    65
    I'd love to have a variety of coordinate systems possible. For instance, I'd love to have radial particles, it would make various effects much simpler to implement.

    It'd also be nice to be able to vary each axis by a function over time (for instance SIN, etc).

    Is there some way to have radial particles that I'm missing?
     
  48. Patapouffe

    Patapouffe

    Joined:
    Apr 3, 2010
    Posts:
    88
    What do you mean by radial particles ?
     
  49. unormal

    unormal

    Joined:
    Jan 10, 2012
    Posts:
    65
    Well, for instance if I wanted to create a 'vortex' of particles, for instance a little tornado of leaves.

    It is actually quite complex to specify this behavior in terms of cartesian X, Y, Z, at least without being able to paramaterize the coordinates as a function of some trigonometric functions; and even then it is more complex than necessary. Perhaps there is a way to accomplish this easily in shiruken, but I haven't found it in the little exploration I've done.

    If you are allowed to specify and vary the position of particles in polar, instead of cartesian, coordinates (angle and distance), it is quite simple to create a vortex of particles with a few linear components. I've used this quite successfully in particle systems I've built before to make complex behaviors easier to define.
     
  50. Rook3D

    Rook3D

    Joined:
    Sep 27, 2011
    Posts:
    19
    I'm probably missing something, but I can't seem to be able to just control 'Speed over time'.

    I'm looking for a curve for just speed. I know there's velocity, but I don't want to affect direction.

    The dampening from 'Limit Velocity' seems to happen all at once, just after emission.

    Does this exist within the current functionality?