Search Unity

[Official] Particle System [Shuriken] Improvements

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

  1. michalpiatek_uw

    michalpiatek_uw

    Joined:
    Feb 26, 2021
    Posts:
    31
    I mean, if Shuriken is on hold I guess Over Lifetime / Over Duration is something that cooould be somehow addressed in VFX graph (allow users to pick an icon or something for a property? Who knows!). Tooltip will do the trick tho!

    Glad you like the Curve Random param idea! I used that solution a lot on another game I worked on in a custom engine and it worked beautifully.
     
    richardkettlewell likes this.
  2. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    1,861
    I've prototyped this feature, let us know what you think of it: https://forum.unity.com/threads/mesh-weighting-feature.1088545/
     
    Archanor and karl_jones like this.
  3. Archanor

    Archanor

    Joined:
    Dec 2, 2013
    Posts:
    534
  4. musolo

    musolo

    Joined:
    Sep 12, 2014
    Posts:
    238
    Hi guys! I have a unity box primitive with rigid body on it and shild shuriken particle. Cube is being launched by adding force to it`s rigid body. it behaves predictibly but child shuriken particle does not follow along with the cube. it falls off the launcher and goes straight down while box is flying away in intended direction. i googled the problem but no luck so far.
    Any advice would be much appreciated.
    Thanks!
     
  5. Archanor

    Archanor

    Joined:
    Dec 2, 2013
    Posts:
    534
    @musolo You might want to make a new thread for this with included screenshots of the particle system settings and explain what you're trying to do. The particle system's Simulation Space might need to be set to Local depending on the effect you want.
     
  6. musolo

    musolo

    Joined:
    Sep 12, 2014
    Posts:
    238
    In which section should i make this new thread? Didn`t find particles related category
    Thanks!
     
  7. musolo

    musolo

    Joined:
    Sep 12, 2014
    Posts:
    238
    What about emitting prefabs? In which version of Unity Shuriken have this option?
     
  8. michalpiatek_uw

    michalpiatek_uw

    Joined:
    Feb 26, 2021
    Posts:
    31
    What's the suggested workflow for creating Shuriken effects alongside Animated objects (Animator)? I have no idea how I can preview both side-by-side in the editor. I tried timeline but Shuriken controls seem to be very poor (emit per distance doesn't work when Timeline is playing and effect is selected, whole effect is restarting if Control Track is longer than effect's Duration, Duration in general seems to be ignored (?), Timeline doesn't take Start Delay into account at times)?

    Edit1: I tried using this package from official Unity examples but it overrides Duration of particle systems setting it to the length of the track clip.

    This won't work for me as I am using Duration to define how long are my starting param curves (Start speed, start size, defines the duration of particle emission). Whenever Duration changes it messes all my effects.
    https://github.com/keijiro/TimelineParticleControl

    Edit2: I managed to get this working with some c# plumbing, although I have to say, I was hoping such a simple and fundamental feature would come with Timeline out of the box.
     
    Last edited: Apr 14, 2021
  9. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    351
    But "Visual Effect Graph" doesn't work with standard pipeline. It worked in some versions of unity(not officially), but now it turned off.
     
  10. michalpiatek_uw

    michalpiatek_uw

    Joined:
    Feb 26, 2021
    Posts:
    31
    I've got a question on this one. My understanding is that VFX Graph will replace Shuriken although VFX Graph roadmap is only mentioning High End Mobile Devices support. What does it mean for the future of particles and mobile devices? Will I be able to use VFX Graph in the future on all mobile devices in the future? If so why is that not on the roadmap? Compute support on mobile is not something that will be widely available anytime soon.

    Are you planning to bring full CPU simulation mode for the VFX Graph?

    Cheers!

    Also, this is the roadmap I was looking at https://portal.productboard.com/uni...ing-visual-effects/tabs/9-visual-effect-graph
     
  11. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    1,861
    Yes, this is accurate, although when that may be, and what "replace" really means, are very open questions.

    Yes, is the simple answer :)

    Only the VFX Graph team can answer that. I recommend asking them about it in their forum so they can say why it's not on there, and what their timelines currently are for it: https://forum.unity.com/forums/visual-effect-graph.428/ (and yes you have the correct link for their roadmap)

    To add a bit more detail to this topic, I don't see feature parity happening for some years yet. Unity 2021 is almost done at the time of writing this, and I've not seen any plans to add a CPU path for VFX in Unity 2022. As you pointed out, it's not even on their roadmap.

    Also, and I cannot stress this enough, we will not be removing Shuriken while there is significant usage among our users for it. It remains an important technology for all our users on the Builtin Renderer, and the majority of our customers using URP.
     
  12. michalpiatek_uw

    michalpiatek_uw

    Joined:
    Feb 26, 2021
    Posts:
    31
    Would it be possible to have Copy/Paste on individual submodules? It's a looooot of work copy/pasting individual settings one by one!
    shuriken_copy_paste_module.jpg

    Also, context menu for gradient Color always opens on the left side of the window. It should open below the cursor. Here's a super duper image to illustrate:
    shuriken_gradient_color_copy_context_menu.jpg

    I right-clicked where the black X is but context menu opens up 2000 miles away. Ain't fun!
     
  13. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    5,563
    Funny you should mention this. I know @richardkettlewell created a change the other day to add this very feature ;)
     
  14. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    1,861
    Could you submit a bug report for this?
     
  15. michalpiatek_uw

    michalpiatek_uw

    Joined:
    Feb 26, 2021
    Posts:
    31
    Done and dusted. Case 1334328
     
    richardkettlewell and karl_jones like this.
  16. FunkyMartin

    FunkyMartin

    Joined:
    May 26, 2017
    Posts:
    1
    I've been trying to find a way to get consistent, distance based UV mapping on particle trails within shuriken?
    I've created my desired behavior in UE4 as an example.
    ribbon_trail_niagara_works.gif
    Here I'm able to make the smoke texture linger and tile completely independent of the parent location and segment density, without any stretching, dragging, or needing to apply a scrolling animation to the effect to counteract movement.

    None of Shuriken's trail texture modes behave like this. The closest one is Repeat Per Segment on the far right in the images below, but that has problems of it's own where the individual segments visibly squash as they despawn.
    unity particle trail texture modes.gif
    There's also no direct control over the texture tiling outside of setting the Minimum Vertex Distance, so that means you can't have a smooth trail with a long tiling texture on it, attempting to tile the material less than once per segment causes the whole thing to get dragged around by the endpoint
    unity particle trail texture modes tile 0.04.gif
    Would it be possible to add distance based UV mapping to Shuriken's particle trails? It'd be extremely helpful to have for any kind of continuous ribbon trail effect, like smoke trails.
     
  17. michalpiatek_uw

    michalpiatek_uw

    Joined:
    Feb 26, 2021
    Posts:
    31
    I have exact same issues but one thing I will add here is that in theory you can set tiling in the material, in practice this results in dozens of materials sitting in the project as you almost never want to have the same tiling setting across different effects. It's like particle size. Imagine having to set particle size in the material.
     
  18. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    1,861
    I've prototyped this feature here, but so far only on the TrailRenderer component.
    Please let us know if it fits your needs, and we will add it to the particle trails too before we release it.

    https://forum.unity.com/threads/world-space-trail-textures.1107389/

    Thanks!
     
    Archanor and Moonjump like this.
  19. michalpiatek_uw

    michalpiatek_uw

    Joined:
    Feb 26, 2021
    Posts:
    31
    I reported this bug and it got closed as won't fix saying it would break effects.
    https://issuetracker.unity3d.com/is...t-to-cone-and-cones-angle-is-above-70-degrees

    I get why it could break old effects but wouldn't a solution be to:
    1. Fix the distribution so it's even at any emit angle
    2. For all old effects convert them so that Radius Thickness is set to 0 for high Angles to mimic old uneven distribution
    3. This would be done at update time when upgrading the project
    It probably is more complex than I think it is but wanted to ask anyway.

    Other alternative would be to have a new shape called something like Uniform Cone. It would have uniform particle spread at all emit angles. Right now there is not a single shape which has adjustable angle and even particle distribution :( Cone works fine at 0 to around 60* angle, hemisphere it only full 90*, sphere is full 180.

    Actually now that I think about it, it's kind of weird that we have cone which goes from 0 to 90, then hemi which is 90 only and sphere which is 180. It should be possible to have a cone which goes from 0 to 180 and covers all those angles. It makes more sense from workflow point of view. Just thoughts!
     
  20. Archanor

    Archanor

    Joined:
    Dec 2, 2013
    Posts:
    534
    Small suggestion here..

    Could Limit Velocity over Lifetime's Drag option support negative values?

    upload_2021-5-30_17-31-25.png upload_2021-5-30_17-42-37.png

    I'm making a directional explosion that also emits a number of smoke particles with a Start Size between 1 and 3. In this case it would make more sense to see bigger smoke particles at the top and smaller at the bottom. So by setting a negative 2 value the bigger smoke particles would be pushed further to look like a cone shape.

    I know there are other ways to get a cone-shaped smoke effect (sub-emitters and Emission over Distance), but this seemed like a simpler way to do it at the time.
     
  21. Archanor

    Archanor

    Joined:
    Dec 2, 2013
    Posts:
    534
    I just want to mention some of my most annoying and common problems with particles and asset publishing:

    1. Effects with Soft Particles enabled in URP are just plain invisible in builds (but not in the editor), and I have to answer so many emails about this problem every week, even if I write about it in every possible documentation, forum thread and support websites. I don't believe the same problem happened in in the Built-in Render Pipeline.

    2. Particle systems that use Mesh renderers (possibly with the 'Particles/Lit' shader) and have Enable Mesh GPU Instancing in mobile and WebGL builds will have invisible particles and instead emit strange, blank mesh particles in 0,0,0 in the scene. It took me some time to figure out why this was happening. Maybe there needs to be a warning or something here as this feature is on by default.

    3. This is more of a feature request tbh. Something that would be really useful is a Roll feature in the Renderer when using Stretched Billboards. Right now it supports textures that go left to right, but in some cases you have spritesheets going bottom to top.

    @richardkettlewell Lastly I'm just curious if you're any closer to finishing a Standard Particle shader for shuriken in HDRP?
     
  22. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    1,861
    Thanks for the feedback :)

    1. sounds like a bug? Is there a bug report for this? Please send one if not

    2. definitely a bug - platforms that don’t support gpu instancing should fall back to the cpu path - please send a bug report

    3. so an option to rotate the texture 90 degrees?

    There is no work happening on a particles shader for HDRP, sorry, we just have the add-on set of ShaderGraphs. You can install them via the package manager after selecting the HDRP package.
     
  23. Archanor

    Archanor

    Joined:
    Dec 2, 2013
    Posts:
    534
    1. I just searched and it looks like this problem, but for newer versions of URP. Usually happens when Depth Texture is not enabled in the Camera/SRP settings for the build. I'll see if I can make a new project and report it.

    2. Will do

    3. Yep! Combined with the Flip XYZ I believe you can then make it face any direction.

    Alternatively, adding an extra "Face Camera" option for the Mesh Render Mode that uses the Velocity Render Alignment would let you make a sort of Stretched Billboards (if you just use a quad as the mesh), as you can set the 3D Start Rotation to anything.

    If you keep building on this idea, having Speed Scale as an option for Meshes would be pretty sick.

    upload_2021-6-13_16-3-7.png
     
    richardkettlewell likes this.
  24. michalpiatek_uw

    michalpiatek_uw

    Joined:
    Feb 26, 2021
    Posts:
    31
    How can I play a sound effect each time a particle dies or gets spawned at the location of its birth/death?

    I am tracing current particle count to detect particle death/birth but in cases where particle count is stable (equal particles die and get spawned each frame) it's impossible to trace that and spawn SFX every time and I don't know how to get the location of a particle.

    Ideally I'd love to subscribe to an event which is fired off whenever that happens or have access to some sort of a structure which gives me all the info I need for a singular particle system and/or a whole tree of particle systems making a singular VFX.

    The reason I need location of spawned/killed particle is for a complex use case where particles are projectiles but there are more use cases I have which are much harder to explain.
     
  25. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    1,861
    We often discussed an event system for the particle system - it would be perfect for use cases like this. But unfortunately we never did it before vfx graph became the focus.

    There is an example at the bottom of here that shows how to detect particle births (hopefully robustly) https://docs.unity3d.com/ScriptReference/ParticleSystem.SetCustomParticleData.html

    Perhaps it can solve this for you..
     
    michalpiatek_uw and karl_jones like this.
  26. michalpiatek_uw

    michalpiatek_uw

    Joined:
    Feb 26, 2021
    Posts:
    31
    Huh, I somehow missed this part of the API. I'll try and see where this gets me, looks promising tho! Thanks.
     
    karl_jones and richardkettlewell like this.
  27. michalpiatek_uw

    michalpiatek_uw

    Joined:
    Feb 26, 2021
    Posts:
    31
    I have noticed that in the editor playback of particles is much choppier than in game, as if it had a much lower tick rate per second compared to game mode.

    What I mean by that is there are some properties which are updated at a fixed time step in the editor (size over lifetime, all custom vertex data curves). I only noticed this when using a mesh particle. So say my PC renders 60FPS but particle size would only be updated at 25fps rate. Another example - I use Custom Data curve to offset texture coordinates and it also only gets updated once every few frames.
    It becomes increasingly worse when I am using low Playback Speed or low Simulation Speed. Whenever I'm setting Playback Speed to something like 0.2 you can literally see that particles would get updated like once every second or even less often with lower values.

    Again, this only happens in the editor and is really hard to work with. Everything is smooth as butter in the game.
     
  28. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    1,861
    We update the particles at a fixed timestep in Edit mode so that we can do the super-slow-mo interpolation when you scrub the playback time. I suppose the update steps can be noticeable in some situations. Is that what you mean?
     
  29. michalpiatek_uw

    michalpiatek_uw

    Joined:
    Feb 26, 2021
    Posts:
    31
    Correct, this is what I am experiencing. I've sent you a PM with a link to a video showing the issue.
    I have an itch it might only be the case with complex curves and when curves are simpler (auto interpolation on all keys) it seems to be mostly gone but I really didn't have much time to investigate this in detail
     
  30. michalpiatek_uw

    michalpiatek_uw

    Joined:
    Feb 26, 2021
    Posts:
    31
    Timeline question again. Is there any way I can make Rate Per Distance work in the editor while playing / scrubbing through the timeline? I have a custom Particle System track&mixer and I am using ParticleSystem.Simulate function to play the effect and sync it with the time marker. This works flawlessly for any emission type but the Rate Per Distance.

    Particle System is not emitting any particles at all. It seems to be working only if I attach a RigidBody to parent gameobject, set it to Kinematic with Interpolation turned on and have that game object selected. If gameObject with RB is not selected, particle system won't emit any particles. I also tried to change the velocity source from RigidBody to Transform but it doesn't work either.
     
  31. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    1,861
    I'd say if it's not working, submit a bug and I'll see if I can make it work. It's probably just something that's been overlooked when implementing the Timeline/Shuriken integration.
     
    michalpiatek_uw likes this.
  32. blacksmil3

    blacksmil3

    Joined:
    Oct 10, 2021
    Posts:
    1
    Is there any way to use the same noise-pattern (seed?) between two particle systems? Could be useful for syncing the movement of systems.
     
  33. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    1,861
    I think if you set the auto random seed to false and set the same seed it will sync the noise fields
     
unityunity