Home Unity

Shuriken Particle Glow/Bloom

polycounter lvl 9
Offline / Send Message
Kroma! polycounter lvl 9
I have been searching for a way to get my particles to glow like you can in UDK. You would just turn the colour value up past 1 and it would glow brightly. But in Unity I haven't found a way to do this. Looking at some of the bundled effects like fire, they look like they employ this effect. I tried to find what values made it bright but it seems it was just due to lots of additive particles in a small area.

This is what I currently have, it's intended for shooting, so the particles are the bullets and the halo is just a glow from where the shots originate. It's using the spark texture and a Particles/Alpha Blended shader.

Any help would be much appreciated :)

Shoot_01_zps02f08df8.png~original

Replies

  • Kroma!
    Options
    Offline / Send Message
    Kroma! polycounter lvl 9
    I have messed about with it a bit more; now using a sub emitter with many of the same properties I have created a fake green glow around a white centre. I have also changed the texture to the default particle because of the softer glow.

    As you can see, however, there is a mismatch between where the particles appear. The sub emitter is set to appear on the birth of the parent particle. I would have thought that this meant they would appear at the origin and because the lifetimes are the same then they would fade out at the same time too. This was not the case and I have had to set the lifetime of the sub emitter to 1 whereas the parent is 2.

    Short of setting up 2 separate emitters to properly match up the timings, is there a better way I can match them up in the sub emitter settings?

    I should also mention that I am using Unity free and am trying not to spend money on buying stuff from the Asset Store.

    Thanks :)

    Shoot_02_zps341f9441.png~original
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    Why not build the glow into the white center as a single particle image?
  • Kroma!
    Options
    Offline / Send Message
    Kroma! polycounter lvl 9
    Ah that's because we want to access and change the colour of the glow so we would have to build 4 separate textures then.

    I think I have worked around it by using two separate emitters rather than a sub emitter. The top one is the sub emitter method; the bottom is the new double emitter method. This should mean we can access the colour nodes and change them.

    Thanks for the reply though :)

    Shoot_03_zps4ae32812.png~original
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    Could you not build in a color property to the particle shader so you have one grayscale particle and you can change the color via a multiply and a color picker in the shader?

    Whatever works for ya though. :)
  • Kroma!
    Options
    Offline / Send Message
    Kroma! polycounter lvl 9
    Would that work for having the white centre then? Because at the moment we could still access the green material and change the tint on it. So we are still using the grayscale default particle in Unity but then there are more materials to suit what we need.

    When it comes to testing it out for its intended purpose we may find that your solution works better. I'm not really a coder and it is our first Unity project so it's very much a learning process.

    Thanks again :)
  • Zoid
    Options
    Offline / Send Message
    Zoid polycounter lvl 14
    I would use a single emitter and use sizeOverTime + colorOverTime, just set to loop and have 'pre warm' checked to make sure it ramps up instantly (or set it's lifetime to like .05 and just have a rate of 100)

    as it grows the color over time gradient drives the change to the outside while the center is pure white , the middle is green the ends are green + transparent

    and you should be able to set modification to the ColorOverTime to drive outer 'glow' dynamically

    make sure the sorting has the white center in front during draw
    Oldest first IIRC means the smaller initial white circle will be draw last (on top)

    in either case you have what you want though
    two emitters using the same material batch = 1 draw call so there is nothing 'wrong' with 2

    just make sure you are using as few billboards as needed, over draw and CPU computations is certainly an issue for Mobile. if you start to get heavy you can really trash frame rates
  • Kroma!
    Options
    Offline / Send Message
    Kroma! polycounter lvl 9
    Thanks for commenting :)

    I tried your method and whilst it works in the way I want, it lacks the intensity of the 2 emitter method due to having to blend between the green and white to keep the white centre. See image: top is your method, bottom is the 2 emitter method. Any ideas on how to bump up the intensity?

    Shoot_04_zpse01829e9.png~original

    Also thanks for the technical insight. Do you know how I would go about telling Unity to draw the white in front (if I go with 2 emitters)? And it has just occurred to me that the 2 emitter system was using 2 materials so I have changed to the same one and am using Start Color instead of Tint on the material to get the green.

    Thanks again :)
  • 2cat
    Options
    Offline / Send Message
    2cat polycounter lvl 5
    Do you know how I would go about telling Unity to draw the white in front (if I go with 2 emitters)?

    Under the Renderer tab change the Sorting Fudge. Lower numbers get rendered in front of particles with higher numbers.
  • Kroma!
    Options
    Offline / Send Message
    Kroma! polycounter lvl 9
    Thanks for the info, I played about with the values but it didn't seem to have any effect. What kinds of values do I need? I tried loads between -50 to 0 to 500 but the white was always on top. The sort mode options didn't seem to do anything either. It doesn't seem like an issue at the moment; the white particles always appear on top whatever the distance. If this changes then I will revisit the sorting.

    Thanks :)
  • warby
    Options
    Offline / Send Message
    warby polycounter lvl 18
    take no offense by me asking this but: ... do you actually have a bloom postfilter attached to your main camera and are those shots from the scene or the game tab ?
  • Kroma!
    Options
    Offline / Send Message
    Kroma! polycounter lvl 9
    The camera settings are default, nothing attached to it. These are just screenshots of the game view. Are the filters a Pro only option as I can only use Free at the moment, hence the workarounds to get a decent bloom effect.
  • Zoid
    Options
    Offline / Send Message
    Zoid polycounter lvl 14
    try this out

    loop = true
    pre-warm = true
    Start_lifetime = 0.5
    Max = 10
    emission rate 20

    color over time
    color 1 = 255,255,255 (white) at position 40%
    color 2 = greenish at 60% position
    alpha starts full all the way to position 85% and it's 0 by the end (100% position)

    size is ~0.5 for the first half
    1.00 for the 2nd half (quick incline) __/¯¯

    sort mode = "Oldest_first" (so the new white is draw over the old green)

    2013-11-14_2250.png

    2013-11-14_2253.png
    what you think?

    you can get away with 6 max
    rate of 18
    0.33 duration
    though it will flicker just a bit on the outside and be a tad less "bright" and need ColorOverTime tweek to keep the brightness
    Kroma! wrote: »
    between -50 to 0
    If I have a large horizontal billboard 'crater' and it's sorting on top of some stretched billboard gravel/dust splash; setting the splash to fudge -10 and the crater to 10 is plenty... usually


    also a Glow like bloom feel will be superior in context if you use Blended additive and neither pure alpha nor additive
    http://www.polycount.com/forum/showthread.php?t=125927

    [you should duplicate the mobile>particle>alpha shader but call it 'addBlend' or something and changes its Blend to [I]One OneMinusSrcAlpha[/I], also you'll need a 32 bit texture of the particle (tga 32), you could use "use grey as alpha channel" but imo author the alpha channel yourself for far better control]
  • Kroma!
    Options
    Offline / Send Message
    Kroma! polycounter lvl 9
    Wow, thanks for the extensive response :)

    I tried the 6, 18, 0.33 method and it works nicely. The small amount of flickering isn't really an issue, in fact it looks better as it gives it some "energy" rather than looking very uniform.

    But I notice now that this has created a static particle. How would I get this to move as a shot from a gun, just fire instances of the whole particle system rather than letting the particles off? And would it still collide with objects like how my 2 emitter version did? See GIF.

    2 emitter version with sub emitters that spawn on collision:

    iN6km3b.gif

    Also thanks for the billboard/sorting info, it will probably come in handy at some point. :)
  • Zoid
    Options
    Offline / Send Message
    Zoid polycounter lvl 14
    Kroma! wrote: »
    How would I get this to move as a shot from a gun, just fire instances of the whole particle system rather than letting the particles off? And would it still collide with objects like how my 2 emitter version did? See GIF.

    iN6km3b.gif

    Also thanks for the billboard/sorting info, it will probably come in handy at some point. :)
    we handle projectiles with Simulated_space = Local, and often the Stretched_ Billboard (so they stretch with speed and orient to cam while aiming into a location) and if it needs to leave trail fire bits or smoke use another set to _World space grouped with it.

    we move it and use a sphere_collision component to do a hit check,
    when the check is true; projectile is turned off
    a "splash" emit effect is turned on in its place (oriented usually toward source location, hemisphere or cone shaped emiter)

    or you can give the emiter _World space,
    a "shape" such as a cone (0 angle), or .01 .01 .01 cube
    aim it in the direction you want
    adjust Start_Speed setting
    set an on_death sub emit that spawns the splash off.. the down side I think is particles can die for other reasons, maybe?

    a touch outside my skill set, implementation is not what I handle
  • Kroma!
    Options
    Offline / Send Message
    Kroma! polycounter lvl 9
    Alright big thanks once again for these options, my team and I will try them out hopefully tomorrow in game. :)
Sign In or Register to comment.