Search Unity

Pyroclastic Explosion [RELEASED] [FREE]

Discussion in 'Assets and Asset Store' started by porglezomp, Aug 13, 2013.

  1. porglezomp

    porglezomp

    Joined:
    Aug 21, 2012
    Posts:
    40
    Pyroclastic Explosions [FREE]

    The Pyroclastic Explosions package contains a material for rendering a beautiful raymarched explosion, a ready-to-run pyroclastic puff prefab that you can simply drag into your scene, and a custom material editor with per-material quality settings.

    — Demo (Webplayer) —
    — View on the Asset Store —
    — Asset Store for 3.5.7 —

    $Screen Shot 2013-08-04 at 3.55.41 PM.png

    Fixes:
    There have been some issues with compiling on Windows. Some simple changes should help the problem. Anyone having further issues should ask here or PM me.

    Version 1.2: Now can control alpha, noise size, and noise scroll speed.
    Version 1.3: Now works correctly with prefabs, better editor
    Added version for 3.5.7
     
    Last edited: Apr 18, 2014
  2. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Thanks so much for providing this for free :)
     
  3. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Amazing! Thanks for sharing!! But could I ask if you could recompile the scene for Unity 3.5.7 for better compatibility? Also what shader model does this one use? Will it work for mobile? (OpenGL ES 2.0?)
     
  4. sefou

    sefou

    Joined:
    Aug 30, 2011
    Posts:
    287
    Cool. Thanks. ;)
     
  5. porglezomp

    porglezomp

    Joined:
    Aug 21, 2012
    Posts:
    40
    I'm thinking about recompiling it for 3.5.7, but it will require some heavy modification. I'm currently using #multi_compile and a custom editor so people can have multiple quality levels and settings. Unfortunately, these features aren't even completely supported in Unity 4.0, and to cover all the settings, I'd need... 30 different shaders.
     
  6. porglezomp

    porglezomp

    Joined:
    Aug 21, 2012
    Posts:
    40
    So, I've managed to get the scattering off version ported to 3.5.7, with almost no changes. I've made 3 versions of the shader for different quality settings, since multi-compiling doesn't seem to exist at all. The ones with scattering however look a bit... Interesting. They're pure noise.
     
  7. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Awesome, looking forward to it on Asset Store :)
     
  8. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    works great with unity3d indie after applying all the changes in discussed in asset store reviews
     
  9. Mikael-Persson

    Mikael-Persson

    Joined:
    Jul 14, 2011
    Posts:
    29
    Hello and thanks for sharing!
    I'm trying to get this to work but I am running into issues.
    If your web demo works should there be any reason why this wouldn't work inside of unity?

    Right now when I import it I get pink Explosion and PyroclasticPuff spheres, then when I choose the Explosion shader it says:
    No subshaders can run on this graphics card

    Your web demo works fine and my computer is fairly recent so I am not sure what's going on. If you or anyone else could point me in the right direction I would be ever so grateful.
     
  10. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574

    BTW, what does scattering do? From the webplayer version, it seems all scattering does is to make the dark area darker.

    Also, still looking forward to the Unity 3.5.7 compatible version on Asset Store! :D
     
  11. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Oh wow pretty cool stuff and thank you for sharing it man, Btw i found a bug with your shader when hdr option is enabled in camera

    $pyroclasticBug.JPG
     
  12. Mikael-Persson

    Mikael-Persson

    Joined:
    Jul 14, 2011
    Posts:
    29
    Thank you for todays update! Now my issue is gone and everything seems to work fine.

    I'm curious, what does the Mesh Filter do? I couldn't see that much of a difference when I switched to other meshes.
     
  13. porglezomp

    porglezomp

    Joined:
    Aug 21, 2012
    Posts:
    40
    I'm glad it helped! All the mesh filter does is define the area where you begin the marching from. The sphere should work for most things.

    I'm going to have a hard time debugging this, since I don't have Unity Pro myself.

    The scattering makes heat behind thin smoke show through somewhat, it just makes there more variation in the dark smoke areas. The dark areas should be darker when scattering is disabled. What do you think, is it acceptable to only offer the non-scattering version for 3.5.7? I'm still having a hard time finding the issue with the shader. (Although I haven't been focusing as much on this, with the Ludum Dare coming up and all.)
     
  14. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Ah, you are absolutely right. I had it mixed up. When Scatter is off it is indeed that there is more contrast.


    Also I will be happy to get non-scattering version for 3.5.7. No hurry :)
     
  15. porglezomp

    porglezomp

    Joined:
    Aug 21, 2012
    Posts:
    40
    If you think it would be fine to have the first 3.5.7 release not support scattering, then I just need to setup a few #ifdefs and everything should be ready to go.
     
  16. Play_Edu

    Play_Edu

    Joined:
    Jun 10, 2012
    Posts:
    722
    Awesome stuff can it work with mobile device.thank for sharing .
     
  17. porglezomp

    porglezomp

    Joined:
    Aug 21, 2012
    Posts:
    40
    It might work on mobile devices, but I doubt you'll able to get any reasonable framerate. It's using very heavy calculations, and mobile devices are often fillrate bound.
     
  18. Filippo94

    Filippo94

    Joined:
    Jun 14, 2013
    Posts:
    12
    Sorry if I resume this thread, but found only now this gorgeous shader! For me works ok, my PC has some problem with this type of mass-calculations...

    Only a hint: I had similar problems with Unity Trial, it was that the values of the color (mainly the alpha channel) needed to be normalized/clamped to One. You don't see differences with non HDR cam because of the automatic clamp of the color, but with HDR on this problems become important.

    I think that just clamp Alpha channel should work. I'm not that good with shaders for putting my hands in your's :).

    Really good work, and a thousand of Thanks for publishing this free :D.
     
  19. smb02dunnal

    smb02dunnal

    Joined:
    May 5, 2012
    Posts:
    439
    Hi there, just seen your demo, and I've got to say it's really good, even better looking than mine.

    Just reading through your comments, and looking at your code, I think you could make it work on a mobile with a bit of tinkering. :)

    Nice work!
     
  20. EvilFox

    EvilFox

    Joined:
    Jul 23, 2013
    Posts:
    83
    Cool. Thank you.

    $sun.PNG

    Can do that the object did not disappear when the camera is inside it?
     
  21. porglezomp

    porglezomp

    Joined:
    Aug 21, 2012
    Posts:
    40
    Thanks for the idea of clamping the alpha, I'll try that. I need to get back to this (I've had school, etc. getting in the way.) I finally (derp) figured out how to subscribe to this thread, so now I'll be responding to you guys faster.

    I think that'd take a LOT of tinkering. I suppose it's worth a try though!
     
  22. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Hey porglezomp, any news on the 3.5.7 version? :)
     
  23. porglezomp

    porglezomp

    Joined:
    Aug 21, 2012
    Posts:
    40
    I still only have the shader with no scattering working, and I can't figure out how to publish different versions for 3.5.7 and 4.1. I need to do that because the 4.1 shader contains some features that don't exist earlier, and I can't get any #defines to fix it.
     
  24. Ace500

    Ace500

    Joined:
    Nov 7, 2013
    Posts:
    1
    Hey, porglezomp, I love this effect, and I was intending to use it for an explosion. As it aged, I intended to turn the heat and alpha down as the radius increased, but I can't figure out how to adjust the alpha at all. Is it possible?
     
  25. Vapid-Linus

    Vapid-Linus

    Joined:
    Aug 6, 2013
    Posts:
    64
  26. Filippo94

    Filippo94

    Joined:
    Jun 14, 2013
    Posts:
    12
    Is there a way to scale the noise? Because if it is too big the noise will be too... well, too noisy :rolleyes:.
    Thanks for your help and for your work :)
     
  27. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,529
    This is a great tool, but I'm having a hard time actually getting it into a more functional state.

    If I make a new explosion in the scene, change up the settings, etc.. and store it as a prefab then it doesn't work at runtime when I spawn the prefab. The only way it works is if I spawn the original prefab in the pack and change the settings at runtime. What am I missing here?

    Also, like a above I can't find a way to scale the noise. It doesn't appear to have anything to do with the actual noise map. Rate of change and noise size seems to be buried in the shader somewhere. I dug through and changed just about everything and watched the changes one by one but couldn't find anything that actually made a difference. Any insight into how the shader works, or some more layman type terms in the script comments would help.

    Thanks!
     
  28. ivanbolcina

    ivanbolcina

    Joined:
    Oct 27, 2013
    Posts:
    41
    Hi.
    I am having trouble with explosion, something to do with Z buffer and billboard trees on terrain. The fireball is always drawn on top of trees, even if trees are clearly in front of fireball and should be blocking view.

    BR, ivan
     
  29. porglezomp

    porglezomp

    Joined:
    Aug 21, 2012
    Posts:
    40
    Hi guys, sorry for neglecting you all. I've submitted an update that adds control for scale of the noise, the alpha, and the scroll speed on the noise, and fixing a little artifact that shows up if it scales too large. I also clamped alpha into the 0 to 1 range, fixing a bug from quite a while ago.

    @I am da bawss, I'm going to submit a version for 3.5.7 later today. No matter what I tried, I couldn't get scattering to work there, sorry.

    @LaneFox, I'm looking into making it work better with prefabs. Currently, I have to do some tricks to split them into their own shaders so that they can each render (they each need their own position variable). That should go into the 1.3 update, which I will probably have this week, since it's spring break for me.

    Thanks for all of you who were patient, I'm really sorry that I haven't been responding to your requests, I'll try to be better about it now.
     
  30. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,529
    Hey no sweat! Happy to see you're interested in updating it.

    I have plenty of other things to keep busy with and can get back to this when its updated ;)
     
  31. porglezomp

    porglezomp

    Joined:
    Aug 21, 2012
    Posts:
    40
    They've accepted version 1.2, it should be up very soon!

    Edit: It's up now!
     
    Last edited: Apr 9, 2014
  32. porglezomp

    porglezomp

    Joined:
    Aug 21, 2012
    Posts:
    40
  33. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Just downloaded 3.5.7 version, and OMG, it is beautiful !!
    Works like magic! Even without scattering it looks beautiful.
    Thanks so much for sharing porglezomp! You are now my favorite person! :)
     
  34. porglezomp

    porglezomp

    Joined:
    Aug 21, 2012
    Posts:
    40
    @I am da bawss: I'm glad you like it!

    The 1.3 version is out now, prefabs work correctly, and there are some editor improvements.
     
    Last edited: Apr 18, 2014
  35. pavlist

    pavlist

    Joined:
    Apr 19, 2014
    Posts:
    5
    Hi, this shader is really awesome, I love this effect
    I was trying 3.5.7 version with android devices, problem is that most devices are still able to work only with OpenGL ES 2.0 and this shader require 3.0...
    Do you think you could make simplified version of this shader running with 2.0? I would even buy it :)
    I was trying to do it myself, but I am not so skilled at making shaders, and I don't even know if it is possible...
    Anyway you made great work :)
     
  36. Tony_Beretta

    Tony_Beretta

    Joined:
    Aug 6, 2012
    Posts:
    17
    Amazing shader, congratulations! :cool:

    Is there a way to orient the noise scrolling?
    Rotate the prefab have no effect and it seems to scroll always down left.
    And it would be useful also the possibility to scale the "puff" on each axis.

    Tanks and excuse me for my poor English. :oops:
     
  37. mitchtheriault

    mitchtheriault

    Joined:
    Aug 4, 2013
    Posts:
    27
    Thank you!! This is a really cool looking effect for free!
     
  38. Keith Bradner

    Keith Bradner

    Joined:
    Nov 25, 2012
    Posts:
    2
    Hey, this is a super rad shader, thanks for making it! I am trying to use it as kind of a plasma type effect and running into some issues. If the object is moving it seems to change more often. Is there any way to disable that?
     
  39. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,355
    Amazing asset, thanks :)
     
  40. levmckinney

    levmckinney

    Joined:
    Aug 2, 2014
    Posts:
    3
    so I'm new to this.:confused: how do I actually make it explode because what I have right is a really really pretty ripely sphere.:)

    one more thing when the explosion is moving at high speed the effect is ruined dose any one know how to fix this?
     
    Last edited: Aug 5, 2014
  41. elpuerco63

    elpuerco63

    Joined:
    Jun 26, 2014
    Posts:
    271
    Great asset and for free too! Thanks!

    I do have a problem though....It works a treat on my Mac and iPad but when porting to Android on my Nexus4 all I see is a pink ball and now fire?

    Any ideas?

    Thanks
     
  42. jarvinda

    jarvinda

    Joined:
    Jan 2, 2015
    Posts:
    4
    Great asset, but I am experiencing the same issue as elpuerco63 where I only see a pink ball when exporting to Android.

    I tried including the shader in the Resources folder and also have included it in the GraphicsSetting->Always included shaders, but no luck.

    Did anyone get to the bottom of this? Thanks in advance.
     
  43. MarkN

    MarkN

    Joined:
    Sep 24, 2013
    Posts:
    10
    Hi there.

    This was working perfectly for me, and looked great, but upgrading to Unity 5 has broken it. Now I'm getting the magenta sphere thing.

    The following error is reported in the shader:

    variable 'o' is used without having been completely intialized d3d9 line 96.

    I couldn't see anything obvious wrong, but then I've not worked with shaders. It feels like it's probably something trivial, so if you've got time to look at it that would be very much appreciated.
     
  44. Lasseastrup3

    Lasseastrup3

    Joined:
    Oct 16, 2013
    Posts:
    16
    If you get the pink sphere bug in Unity 5, do the following
    Open the Explosion shader, go to line 90 and insert the following line after "v2f o;"
    Code (CSharp):
    1. UNITY_INITIALIZE_OUTPUT(v2f, o);
     
    xammurapi88 likes this.
  45. levpasha

    levpasha

    Joined:
    Jul 4, 2016
    Posts:
    1
    Hi porglezomp!

    Great job, thx! I have one problem. I can't scale it! I create 2d game, and when i scale sphere to (2,2,2) or smaller - fire is gone away. Code in shader is chineese to me... :( Безымянный.png