Search Unity

Mushroom Cloud, proper way of doing?

Discussion in 'General Graphics' started by N1warhead, Nov 10, 2016.

  1. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    Hey guys, curious as to how if you had to implement a Mushroom Cloud (Nuke) explosion for a game, what is the way you'd go about doing it?

    Right now I'm using Particles, and I'm just not satisfied with it (Could just be my lack of Particle experience).. Like if you look at some nuke explosions, you can pretty much see Normal Maps on the dust, some dynamic tesselation that deforms the body of the nuke, etc.

    I've tried using a mesh that does just that (dynamicly moving verts in and out) like mentioned about, but then it comes to being the mesh looks to forced and not legit.

    I mean don't take me wrong, my nuke doesn't really look bad, it just doesn't look real/proper either.
    Here's a short video of what I've done with my nuke. (yes I am aware it needs a massive particle overhaul).



    So maybe I am missing some important step (or perhaps) I am just being to picky and it looks in fact fine. I just personally feel like it's not good enough, and could be better and done entirely different than using particles. (At least the main base explosion)..

    I'd really like to understand how they did the explosions from the Butterfly effect demo movie they made, but I don't understand the first thing about Raymarching and such.

    Yes I know how real explosives work (I went to school about explosives). I just can't think of a way in game to do it. So I'm just curious if you were to make one, what would you use to make it at least look semi-believable. Or does mine in fact look fine outside of a few aesthetic changes I could do to it.
     
  2. RockoDyne

    RockoDyne

    Joined:
    Apr 10, 2014
    Posts:
    2,234
    You need to study the anatomy of a mushroom cloud more. Just about every motion is wrong. Either the cloud should be moving upward, or it's a vortex ring and stays put. Mushroom clouds are giant masses of convection currents and don't diffuse out like that. Also, nukes don't need to explode that low to the ground and tend to be pretty high (commonly about the mid point of the cloud, give or take).

    Otherwise it's just that the particles need work... so basically everything, I guess.
     
  3. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,175
    Just thought I'd point out that any sufficiently powerful explosion is capable of creating the mushroom cloud. Wikipedia has a brief explanation of the physics behind it. Don't know if that will be any help to you or not though.

    https://en.wikipedia.org/wiki/Mushroom_cloud
     
  4. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,569
    You need semi-transparent particles that glow within their cracks. If you're doing with particles. Right now you're obviously trying to put additive particles there, it is not gonna cut it, even if there's billion of them.

    You need alpha-blended transparent particles (could be premultiplied) like fog, but with glow. Meaning "One, OneMinusSrcAlpha" or "SrcAlpha OneMinusSrcAlpha". To make them glow, you'll need to shoot up their colro values past 1.0 range and render them onto floating point buffer then slap post process onto them. The nuke is mostly smoke. Not fire. Particles would originate from from the center of mushroom's "stalk" half of them will fall down, another one will rise up, forming cloud. They should be very big, smoke-like and they should rotate.
     
    DerrickMoore likes this.
  5. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    @RockoDyne : Yeah I know how they explode, I just haven't gotten to the point if where it should explode, just trying to work on the particles.

    @Ryiah : But this is my problem, I don't fully understand how to make the particles do just that. Every explosion tutorial I've found is for common things, E.G. Grenades, Dynamite and such. Which only show the main Primary explosive.

    I can't find any tutorial or process on making particles work like a Mushroom cloud. I know physically how Mushroom Clouds work, just the process of making the Particle System do just that is where my issues are at. Like should it be 10 particle systems, or 1 particle system, maybe 2- 3. Right now the one in that video is like 8 particle systems. An dhonestly not satisfied with it.... The second I start messing with some of the controls to adjust them, I feel like it rather limits what I can and can't do.

    (OR),

    if there's an entirely different way of going about it that can do it without particles in a way that makes sense.

    @neginfinity : You are absolutely right I was using Additive, I'll look into making a shader to handle all that stuff you mentioned. Yeah I know most explosives don't really show any fire or anything, that's generally a Hollywood movie trick with more fuel than actual explosive, I mean I might have went to school on explosives, blew cars up an such, but most explosives you don't see anything but expanding rapid fast gasses. But never personally blew up a nuke haha. But every nuke photo I see is generally like this https://www.planetdeadly.com/wp-content/uploads/massive-nuclear-explosion.jpg Which more like fire than smoke to me. (Unless that's smoke with bright light in it) that gives the appearance of red.
     
  6. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    4,436
  7. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,569
    You aren't making a photo, you know?



    Here's some more footage. (ignore the announcer)




    Basically, while the mushroom cloud glows for a while, the key to "nuke" appearance is dust below which doesn't glow and forms mushroom's "stlalk". Also, mushroom cloud fades out with time.

    I'm positive I could make this effect in UE4 fairly quickly, or in unity if it provides proper postprocessing effects.

    IT won't look like a nuke without swirlng lit clouds.
     
  8. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    9,052
    There is an asset in the store called detonator pack. If I recall it has a decent looking mushroom cloud.

    I would use a combo of meshes with animated textures and particles. Then use either lights or flare / overlays for the light effects.
     
  9. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Non artist thoughts, take with a grain of salt.

    Some of it has to do with your perspective. You seem to be viewing the cloud from much too close. Some better camera angles might help.

    Explosions go through several well defined stages. You might want to investigate those.
    • A flash of light, caused by the actual energy of the explosion, travelling outwards at the speed of light in roughly all directions
    • The initial shock wave, travelling out at the speed of sound radially
    • The fires storm that starts off as a ball, but spreads itself into a cloud
    • The dark mushroom that hangs around for a while
    • The radioactive fallout afterwards
    In all your effect appears much to fast. You want to slowly go through these stages, letting the player experience the horror and power of the destruction as it occurs. And then you want things to linger on for a while. You don't want it to all disapear and be done. As with all art, its not just about getting the physical appearance right, its about transferring the feel.

    This may also help for reference

     
    JamesArndt, MV10, Ryiah and 1 other person like this.
  10. MV10

    MV10

    Joined:
    Nov 6, 2015
    Posts:
    1,889
    Although I agree with what you wrote, if I remember correctly, Fallout 3 pulled off good-looking but quick mushroom clouds when you'd blow up a car engine.

    When I realized that, I ran around shooting every car engine I could find. :)
     
    Kiwasi likes this.
  11. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    4,436

    Did you continue working on this? I'm currently wondering if I should experiment with mesh-based smoke/explosions, or if that would be a waste of time.
     
  12. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    I finally gave up, so now I'm trying to make volumetric particles like fumeFX for 3ds max... If it doesn't even slighty look realistic i don't want it. Its not going to be easy, but then ill have what im looking for. And im sure what allot of devs would like... Unless you can find some tutorial on Unity that can make and actual decent mushroom cloud that dont look super fake. I can't find any actual tutorials whatsoever. Im speaking more in terms of the actual textures.
     
  13. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    4,436
    When it comes to texture tutorials I think you'll need to exclude "unity" from your search parameters. I'm sure there are several tutorials on mushroom clouds for Blender, Max, Houdini and others. I just stumbled over this one which may or may not spark some idea for you:


    Keep us updated on your progress, explosions are always an interesting topic!
     
    N1warhead and MV10 like this.
  14. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,569
    Alright, I jury-rigged a shader and gave it a try.

    Here's the rough idea:
    nuke.png

    Reference:



    Here's how it works:

    • Blend SrcAlpha InvSrcAlpha
    • HDR on.
    • Bloom + Eye Adaptation/Tonemapping
    • Simulated lighting on particles - skylight + glow light.
    Basically, If there are no shadows, it doesn't look like a mushroom cloud. Meaning it is always affected by skylight and all particles must be lit. If they aren't lit, it looks bad.

    Glow (in a real nuke) originates from within top of the cloud and from within step of the "mushroom". Meaning you can just simulate a point light being there (i.e. manually calculate lighting from within the shader) and make sure brightness is massive. With very high brightness value, "glow" will shoot through massive amount of smoke, and tonemapper + bloom will take care of the rest.

    By the way, the whole thing looks like It might require custom particle system to be done properly. Unity doesn't expose enough particle data to the shader...

    In order to be done PROPERLY, it would probably need some sort of approximated volumetric rendering, so the particles will be shaded.
     
    Kiwasi and Martin_H like this.
  15. MV10

    MV10

    Joined:
    Nov 6, 2015
    Posts:
    1,889
    I felt this was a solved problem with that Fallout 4 analysis...
     
  16. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,569
    Well, there's usually more than one way to do something, and this is something I wanted to tinker with.
     
    Martin_H likes this.
  17. MV10

    MV10

    Joined:
    Nov 6, 2015
    Posts:
    1,889
    Yeah, I didn't mean it the way it probably sounded :)
     
  18. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,569
    Speaking of which, after tinkering with unity's cinematic effects it was disappointing to find out that they don't provide postprocess-based lensflare, like Unreal Engine. This one can be annoying, but can make scenes more convincing, easily.
     
  19. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    4,436
    It's one of the best I've seen so far, but no one has implemented it to that quality in Unity yet (afaik), and I'm also hoping that even better looking effects can be achieved.


    @jack-riddell maybe this would be a nice showcase for one of your assets?

    Why not use the halo-based lensflares that unity has? I've never got really good results out of post effect based lenseflares like in Scion. In UE4 games I sometimes find them annoying as well.


    Working on explosions is always a good way to procrastinate:






    Personally I'm not really after "nuke", I need big explosions somewhere from rocket- to bomb-sized. I've found quite a lot of reference material on youtube, but it always leaves me depressed watching that kind of stuff. We live in a weird time where you can just go online and watch 1080p hd videos - with often scary high production values - of people killing other people with things that go boom. All ready to be consumed from the comfort of our homes, to subsequently imitate in our games about people blowing up people...
     
    Kiwasi likes this.
  20. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,569
    Because they're not as good.
    UE4 generates lensflare based on brightness of objects in scene. Meaning a shiny spot on a sword can generate a lensflare, for example.
     
  21. jack-riddell

    jack-riddell

    Joined:
    Feb 11, 2014
    Posts:
    326
    Those fire effects look amazing what software are you using?
     
    Martin_H likes this.
  22. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    4,436
    Yes, but I meant just for the core of the nuke explosion.


    Thanks! I'm still using Blender. I think the trick might be the emitter mesh I've chosen, it is the suzanne monkey head with a displacement modifier (using standard cloud texture) to create a very irregular shape. Some of the explosions (top 2 I think) use three monkey head emitter meshes each. And I've animated the flow source values from surface 3, volume 1 to 0 & 0 over 9 frames. The Initial velocity based on surface normal is cranked to 30, so that there is more force in the simulation and it looks like an explosion instead of a slowly burning fire. I still need to do some keyframe animation on the material to make sure at frame 32 everything is (almost) invisible again. Domain: 32 divisions, time scale 0.7, high resolution divisions: 2, with wavelet noise at strength 3. The resolution artifacts are actually still pretty noticable at those settings, but the final size per rendered frame is almost small enough to hide it and I think the explosions animate quick enough to not make it noticable in the final context. Baking time per explosion is only a couple of minutes. I'm really impatient when it comes to baking and rendering.



    Big explosions often throw up dirt that forms large pointy trails at first, and then dissolves into dust clouds. Anyone got a good idea how to properly reproduce that effect? I find it a lot harder to come up with a decent solution for that than for some other aspects of large explosions. I'd like to not prerender it as a whole, because that would look bad while rotating the camera.

    Also how stable is 5.5 beta currently? The particle system got lots of cool upgrades I think.


    And another topic that I rarely see discussed here: the gamedesign implications of explosions. If you make them realistic, an explosion blocks a large area of visible space for a relatively long time. Games usually cut that aspect unrealistically short, because you'll usually want the roles of AOE damage and LOS blocking to be performed by different types of equipment, e.g. frag grenades and smoke grenades. In the game Insurgency I occasionally (ab)use frag grenades to block LOS for 3 seconds so that I can quickly relocate and either get from cover to cover safely, or get out of cover, and when the smoke settles I'm already aiming at the enemy that had me pinned down before, sometimes allowing me to turn the situation in my favor.

    What do you think is the best compromise between realism and sensible gamedesign when it comes to explosions?
     
  23. MV10

    MV10

    Joined:
    Nov 6, 2015
    Posts:
    1,889
    "Sensible" is the compromise between realism and gamedesign...
     
    Martin_H likes this.
  24. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    4,436
    Anyone still working on this?



    On its own this looks more useful than it is. It's alpha blended and will have weird sorting issues with other alpha blended particle effects. Fully opaque it looks wrong too.

    The new post fx bloom is really helping sell all things fire-related though.
     
  25. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,569
    NOt me.

    Unity only sorts particles within one particle system. AFter breifly tinkering with the nuke explosion in the past I decided that this one needs either a fully scripted particle system (that fully control particle movement) or a completely custom one (that performs sorting manually).
     
  26. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    One of the earliest examples of 3D explosions would be Quake 2, where you had little polygon mushroom clouds... so it's a small step from that to rendering it to a texture and using a 3D texture to modify it, blend it, etc...

    Depends on the needs. If the explosion doesn't need to be particularly volumetric then storing motion vectors and using flipbooks is the answer, and Unity intend to have native support here at some point.
     
    Martin_H likes this.
  27. cyanspark

    cyanspark

    Joined:
    Mar 12, 2022
    Posts:
    57