Search Unity

Puffy Smoke - Particles with a volumetric look

Discussion in 'Assets and Asset Store' started by Alesk, Sep 15, 2013.

  1. Alesk

    Alesk

    Joined:
    Jul 15, 2010
    Posts:
    340
    Hi, I'm proud to finally present my smoke effect to you :)

    $screenshot02.jpg

    Puffy Smoke is a particle system with a special render setup which displays a faked volumetric smoke on classic billboard particles, using a directional light as reference.
    Its primary purpose is to emit smoke trails behind moving objects, but it can be used to also make clouds or any other smoke effect.

    The smoke texture details are animated, so it doesn't looks like a row of static and identical textures, all particles looks different.
    Also, to get a more realistic feeling, the particle lifetime can be randomized. This way, the trails doesn't looks like a ribbon attached to the moving objects.
    To prevent gaps in the particles trails with fast moving objects, the particles are created at a fixed (and customizable) interval, in order to always get a consistant smoke.
    For a nice volumetric effect, the particles are also reacting to the specified directional light orientation, intensity and color, in real time.
    The shadowed side of the smoke is also reacting to the ambient color or the camera background color, and you can also specify a custom shadow color.

    Multi-threading is used to improve performances, and you get one extra draw call every 16000 particles (so only 1 draw call for less than 16000 particles)
    NOTE : Change since version 1.11 => Now a new mesh is generated every 4096 particles (so one more draw call each time), to take advantage of the multi-threading sooner, in some parts of the meshes update process.

    NOTE : version 1.12 : Now you can tweak the number of particles per mesh with the "Mesh face count" parameter.

    Limitations :
    - Only one directional light can affect the smoke.
    - This smoke is not self shadowing and doesn't project shadows on other meshes
    - Since Shuriken doesn't provide enough particles data, this effect cannot be plugged on it properly

    Try it here : Web demo
    This demo shows debug informations about the time taken by each step in the smoke generation process.

    Get it : on the Asset Store for only $15 ;)


    ------------------------------------------------------------------
    History :

    30/01/2016 - Version 1.13:

    - THIS WILL BE THE LAST ITERATION OF THIS VERSION. THE NEXT ONE WILL BE A COMPLETE REWRITE, WITH UNITY 5.3.x

    - Switch to Unity 4.3.0
    - New unified multi-compile shader for smoke and clouds, with more options
    - Unity Threading Helper replaced by ThreadPool class : same speed performances, less (no more?) GC hick-ups \o/
    - Switching off Unlimited particle now displays a Max particles count value. This number of particles will be preallocated in memory.
    - Bug fix : when disabling threads, a wrong number of particles where used when too many of them were present
    - The "Use Threads" checkbox is back on the Puffy_Emitter script, since it may be useful to be able to disable it on some mobile devices.
    - Tweak on the maximum Mesh Face count value to prevent max vertices allocation error, this parameter has also been renamed as "Particles per mesh"
    - Some corrections in the Cloud Shader : the sharpness parameter wasn't properly applied
    - Presets added in the editor menu "GameObject/Create Other/Puffy Smoke", note that you'll have to manually set the Light and Material to be used by the Puffy Renderer
    - Disabling a Puffy_Emitter script or its GameObject will now hide all related particles from the Puffy_Renderer script
    - Some memory optimizations
    - Readme file updates to reflect all changes.

    * Puffy_Renderer script *
    New features :
    - New parameter "Ambient intensity" to control how much the ambient color affect the particles
    - New parameter "LOD start distance" defines the start point for the Auto LOD option. So the LOD effect will happend between this point and the "Max render distance" value
    - Threaded optimization added on the mesh build function
    - Small performance improvements on the Frustum Check.
    - Puffy_Renderer script : "Sub mesh count" parameter added, to tweak the internal split of mesh data in order to optimize the amount of data sent to the gpu when a big face count is defined and few particles are visible. (higher value = more sub meshes = more memory comsuption)
    - Puffy_Renderer script : "Warm up" and "Warm up mesh count" added, to pre-build meshes and define how many are needed at start (good for mobile).

    Changes and bug fixes :
    - Cores Setup restricted to values Medium/High/Maximum, since lower values may lead to crash when dealing with a huge count of particles.
    - Screensize near clipping max value raised to 4
    - The Ambient color parameter state was affecting all renderers at once, it's now properly working individually on each one.


    * Puffy_Emitter script *
    New features :
    - Puffy_Emitter script : when "Assign to first renderer" is off, a "Renderer" input is displayed to pick the Puffy_Renderer to use with this emitter
    - Puffy_Emitter script : if no renderer is assigned to the emitter, gizmos wire spheres will be displayed for each particle
    - Puffy_Emitter script : Warm up added, to pre-fill the particles array

    Changes and bug fixes :
    - The "Direction" vector is now normalized before being applied to the particles motion
    - "Auto assign to renderer" renamed to "Assign to first renderer", and "Auto assign to" input removed
    - Internal changes to support multiple ShapeSpawners or MultiSpawners at the same time
    - Gradient End Time parameter moved to the Puffy_Gradient script
    - Bug fix in the particles recycling process (wasn't really noticeable, but needed to be fixed)
    - Particles are now stored in a List instead of an Array, allowing more internal flexibility and no real performance hit
    - The "chunk size" parameter is no more needed and has been removed


    * Puffy_Cloud script *
    New feature : OnDestroy method added to remove particles when the cloud gameobject is deleted


    * Puffy_MultiSpawner script *
    Bug fix : the Max Gap setting processing (taken from the emitter) for fast moving objects was not working properly


    - Shaders :
    Bug fixes :
    - Scattering effect was not computed properly, and this parameter is renamed to "Light Scattering" to be more relevant.
    - Fog is now properly handled

    New features :
    - Multiple lights support ! :)
    - Perlin Cloud demo script + 3D Perlin Noise class


    27/02/2014 - Version 1.12:

    - First iteration of mobile support (iOS Android) \o/
    IMPORTANT : depending on your mobile hardware (problem found on Android devices) you may have to disable the "Use Threads" option to improve performances.
    I'm trying to figure out what's the problem here...

    - Many shaders optimizations
    - Fake volumetric textures modified to be square images
    - Default internal ambient color set to black

    - Materials clean up, now you have 3 materials with different qualities :
    * "PuffySmoke Low" : no details, only the base volumetric effect. This shader is recommended for mobile gpu !
    * "PuffySmoke Medium" : 1 texture allowed for details
    * "PuffySmoke High" : 2 textures allowed for details, the first is displayed at the particle birth, and gradually fade to the second until the particle death.

    Note : All shaders are working on mobile gpu, but those with details textures may have poor performances

    Changes in the Puffy_Render Script :

    - Auto LOD option, exclude some particles from rendering based on distance to camera :
    * every 4th particle with distance > MaxRenderDistance/4
    * and every 3rd particle with distance > MaxRenderDistance/3
    * and every 2d particle with distance > MaxRenderDistance/2

    - NearClipping + fading to fix fillrate issues on low gpu :
    * Screensize Near Clipping : value from 0 to 2, is the maximum % of screen space the particle is allowed to fill before starting to fade out (a value of 0 will hide all particles)
    * Near clipping fade range : from 0 to 1, is the range allowed to let the fade occur (also expressed in % of screen space), a value of 0 will pop out particles while 1 will fade them gradually


    - ForceOnePass removed and replaced by PassMode, now you can specify how the processing is spread over frames :
    * Auto : let the script decided, using the Update threshold value
    * One : will force everything to be done in one frame
    * Multiple : will force every step to be done on multiples frames (3)

    - Render checkbox no more needed (disable the script instead)
    - Inspector clean up

    - New price ;)

    04/12/2013 - Version 1.11:

    - Bug fix and code optimization in the particle emitter for the particles recycling
    - Some tweaks in the particles renderer, to improve performances on low hardware
    - Particles can now be immortal (set lifeTime to -1)
    - The particles age is no longer stored in the color alpha channel, so now the alpha can be modified within the color gradient
    - Particles can now have a Luminosity value, the homing missiles demo is updated with this new parameter
    - Position variation added to the particle emitter, this allows a random position offset on particles spawning
    - Multi threads added for meshes data generation and part of the meshes updates
    - New clouds demo added, with a dedicated shader
    - Project exported from Unity 4.0.0f7, since it's the minimal version to get it to work

    28/10/2013 - Versions 1.08 to 1.10:

    - Rewrite of the particle emitter process to get a particle per seconds rate, working properly with any TimeScale value
    - Code simplification and new emitter classes to extend (mesh or multi emitter).
    - "Trail mode" removed (no longer needed), and behavior replaced by the "Max gap" value
    - New demo scenes.
    - New noise textures
    - New shaders

    12/10/2013 - Version 1.07

    - Added "Auto Assign" option on the emitter script, to let it find a renderer
    - Added "Assign to renderer name" on the emitter script, to specifiy which renderer must be used if multiple are available.
    If the name is left empty, the first renderer found will be used.

    15/09/2013 - Version 1.06

    - Speed improvements : almost x2 on the benchmark scene with 50k particles
    - MaxRenderDistance added to the Puffy_Renderer script
    - Tweak on the shader to cast raw shadows on other objects (no self shadowing).
    - Added the intermediateRatio parameter to the SpawnRow function in the Puffy_Emitter class

    07/09/2013 - Version 1.05

    - Speed improvements on the meshes rebuilding and updates (+50% speed for this part)
    - Tweaks in the shader on the details animation parameter
    - New material + new texture for a first attempt at making a cartoon smoke look (not convincing yet)
    - New parameters on the homing missile script (craziness and some random offsets tweaks)

    03/09/2013 - Version 1.04

    - Speed improvements : overall refresh rate multiplied by around 3
    - Some changes in the smoke color of the missiles demo (end color = start color, instead of white)
    - Launch count added to the missile launcher script
    - Some corrections in the readme file

    27/08/2013 - Version 1.03

    - Tint color as been removed from the shader
    - Changes on the shader and lighting options : the smoke now reacts to the light color and intensity, and to the scene ambient light color
    - Two new parameters in Puffy_Renderer : "Use Ambient color" and "Camera Background Color as Ambient Color"

    26/08/2013 - Version 1.02

    - Cleanup in the package (old test files were added)


    26/08/2013 - Version 1.01

    - Homing missile demo updated with cleaner code


    21/08/2013 - Version 1.0

    - First release.
     
    Last edited: Feb 3, 2016
    Westland likes this.
  2. ITIProd

    ITIProd

    Joined:
    Nov 18, 2012
    Posts:
    14
    Interested in this effect and considering the purchase. Two questions though:

    You say this is not a shuriken effect, so with respect to clouds or other static smoke effects, can you keep the smoke from animating (I would assume your cloud would look roiling/bubbling if it was stationary and animating without dissipating)?

    Two, can you pause the effect (or is it dependent on Update(), etc). I have a pause function in the project I'm working on, so I would need to freeze all particles on command (hopefully without manually iterating through each billboard) while a missile is in mid-flight without actually setting the global timestep to zero. How easy is this to do (simple command: smoke.Pause(), or some coding necessary)?
     
  3. Alesk

    Alesk

    Joined:
    Jul 15, 2010
    Posts:
    340
    Hi,

    This package includes 2 scripts : one to emit particles and another to render them.
    The emitter script has a "freezed" boolean property which allows to do what you want, you can even test it in the web player demo : hit P key to pause/unpause the smoke animation, you'll still be able to move around and see the effect properly, since the renderer is not paused.

    Let me know if you need any extra tweaks ;)

    EDIT : you also have a static bool "globalFreeze" to freeze all emitters at once ;)
    The emitter script can emit particles one by one, where and when you want. So you can create a custom function to define the shape of your clouds, and add particles with a function like this :

    Code (csharp):
    1. SpawnParticle(Vector3 start_position, Vector3 start_direction, float start_speed, float start_lifetime, float start_size, float end_size, Color start_color, Color end_color)
     
    Last edited: Sep 15, 2013
  4. Play_Edu

    Play_Edu

    Joined:
    Jun 10, 2012
    Posts:
    722
  5. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    Ive created a missile AI a while back and added the unity particle emitter which ended up being a performance killer. This looks perfect for my missiles and any smoke effects in general. Going to give this a try.
     
  6. ITIProd

    ITIProd

    Joined:
    Nov 18, 2012
    Posts:
    14
    Picked up this package. Could use some documentation. From glancing at the examples, it seems like there's a single renderer I need to put somewhere (like on a gamecontroller), that I have to register my emitters with? While the demos give me an example to work with, it would be nice to know exactly what interfaces I have available... Is any documentation forthcoming?

    Otherwise, this looks to do exactly what I want. I do like the ability to freeze everything with one boolean.
     
    Last edited: Sep 17, 2013
  7. Alesk

    Alesk

    Joined:
    Jul 15, 2010
    Posts:
    340
    For now my effect only reacts to a single directionnal light source... I'm trying to find some solution to take more lights in account, but this is not for soon.
    iOS or Android support is difficult to do for me since I don't have a mac to compile and test on iOS, nor an Android device to test it, I'll try with some emulators...

    Thanks ^_^

    Yes, exactly.

    Yup, I'll work on this in the days to come, a more detailed documentation should be online next week.

    Some quick stuff :

    In the Puffy_Emitter class, interesting function are :

    SpawnParticle() to create a new particle, all parameters are self explanatory

    SpawnRow() to create a row of particles between two given point in space, using a step value to define the distance between each particles. For now only the last particle created will get the specified lifetime and size, inbetween particles will get onlyf half the life time and half the size, for performance purpose, but this may become optionnal in the next update.

    Random variations defined in the emitter parameters are always applied to any new particle, only at its creation time, any change to the emitter parameters after a particle is created will not affect it.

    The "freezed" boolean parameter is used to toggle the particles animation.

    Good :)

    Of course, I'm open to any suggestion to improve or add functions you may need ;)
     
  8. Alesk

    Alesk

    Joined:
    Jul 15, 2010
    Posts:
    340
    Hi,

    Here is an updated version of the readme file with more informations about scripting :

    http://www.alesk.fr/PuffySmoke/PuffySmoke.pdf

    This is for the last version which is not sent to the asset store yet (my windows system is not working properly since one week, and I can't upload it yet :( )
    And for some more fun, I have to undergo surgery tomorrow and would not be able to be online until next week...

    I've tried to put the most important informations in the pdf, if you think something important for you is missing, tell me and I'll add it when I'll be back.

    Sorry for this delay :(
     
  9. Alesk

    Alesk

    Joined:
    Jul 15, 2010
    Posts:
    340
    Hi,

    Back to life (and code) again ;)
    After some inquiries from the nicest people ever, who already bought this asset, I'm rewritting some part of the particles spawning to get something more consistant according to timescale changes, and also to get more options about the emitter shape : the current version only allows emission from one point, I'm working on something more sophisticated, like emission from meshes vertices.

    Still some issues with the timescale stuff to fix, and I'll be ready to send an update to the asset store :)
     
    Last edited: Oct 21, 2013
  10. Alesk

    Alesk

    Joined:
    Jul 15, 2010
    Posts:
    340
    Me again,

    After a long struggling and headaches with timings issues, I'm glad to announce that now the smoke particles are perfectly reacting to timeScale variations :)

    I'm confident to send the new update to the asset store this week, I think you'll like the changes... more informations soon :)
     
  11. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    Wonderful, can't wait to try it out.
     
  12. Alesk

    Alesk

    Joined:
    Jul 15, 2010
    Posts:
    340
    For those interested, you'll find a new demo here :

    http://www.alesk.fr/PuffySmoke/lastversion.html

    5 Scenes to test :

    1) simple emitter, randomly orbitting
    2) mesh emitter using vertices as particle source + vertices colors as particles colors
    3) big array of particles for a little stress test
    4) homing missiles, for a bigger stress test... if you launch a lot of missiles ;)
    5) Fart guy ^_^

    Note : the white sphere at the bottom of the screen is here as a light direction reference.

    I'm finishing somes tests and writing updated docs now.
     
    Last edited: Oct 21, 2013
  13. TheNorthridge

    TheNorthridge

    Joined:
    Jan 4, 2012
    Posts:
    193
    Really love this smoke :)

    My project involves Djinn/Genies, So ive been on the lookout for some very pretty smoke :)

    By any chance, could I suggest a 5th demo? Would it be possible to have a 3rd Person Controller, we smoke on the end? Just to see how the smoke trails behind naturally before I modifies it for my own means.
     
  14. Alesk

    Alesk

    Joined:
    Jul 15, 2010
    Posts:
    340
    ok, fifth demo added

    enjoy ;)
     
  15. TheNorthridge

    TheNorthridge

    Joined:
    Jan 4, 2012
    Posts:
    193
    Thanks :)

    Yep ill have to somehow modifies it, so that the smoke flows "down" rather than up.

    Any ideas?

    Also, I cant stop laughing XD
     
  16. Alesk

    Alesk

    Joined:
    Jul 15, 2010
    Posts:
    340
    The emitter can be easily edited to let you define the flow direction as you wish, by default it's following the emitter orientation + an optionnal offset direction vector
    here is a screen grab of the current parameters of the 5th demo :
    $emitter_parameters.png
     
    Last edited: Oct 21, 2013
  17. TheNorthridge

    TheNorthridge

    Joined:
    Jan 4, 2012
    Posts:
    193
    Thanks :)

    Do you have the smoke emitter attached to a bone? It appears you do, for when he walks, the smoke moves with the movement with his butt.

    This might be really useful for me, because that means I can animate the smoke moving through reverberation of a specialized bone :)

    Ill see how this works out, and send you results :D
     
  18. Alesk

    Alesk

    Joined:
    Jul 15, 2010
    Posts:
    340
    yup, it's attached to a bone

    I first have to send this update to the asset store before you can try it ;)
    I still have work to do on the documentation...
     
  19. Alesk

    Alesk

    Joined:
    Jul 15, 2010
    Posts:
    340
    Update submitted to the asset store... waiting for approval :)
     
  20. Alesk

    Alesk

    Joined:
    Jul 15, 2010
    Posts:
    340
    Update accepted and available on the asset store :)

    Let me know if you have any question or suggestion with this new version !
     
  21. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,521
    Fantastic! Works great, totally pain free instancing.
     
  22. Alesk

    Alesk

    Joined:
    Jul 15, 2010
    Posts:
    340
    Great !
    I can't wait to see what you could be doing with it ;)
     
  23. Alesk

    Alesk

    Joined:
    Jul 15, 2010
    Posts:
    340
    New update coming soon !

    In the meantime, I would be happy to get some feedback from my current users, I some of you have some time to drop me a line, thanks ! ;)
     
  24. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,521
    I've been running into performance dumps and they seem to be centered around creation/destruction of the emitter instance. It doesn't appear to be affected by the quality controls but rather something to do with the renderer organizing everything. I put the emitter in a prefab, there is no pooling yet, the player fires the prefab and the renderer picks up the new emitters on the fly and it seems to be dumping when it has to do this.

    I've been away for a few weeks and had put this on the backburner for a while but I noticed you're looking for feedback so here is a bit. I planned to look into it further when I revisited the missile system.
     
  25. Alesk

    Alesk

    Joined:
    Jul 15, 2010
    Posts:
    340
    Thanks a lot for the feedback :)

    Maybe you should try to keep the emitter as a separated and permanent game object, and use particle spawners for your missiles, as I did in my homing missiles demo, you should have a deeper look at it.
    By doing this, you don't have to create/remove the main emitter anymore, and it's better to keep it in place (even disabled) to prevent GC lags, until you are sure to not need it anymore.

    Could you please send me a private message with a small package to reproduce this problem ? (I'll try to do it on my side too)

    By the way, the new update is on its way to the asset store :)

    Version 1.11:

    - Bug fix and code optimization in the particle emitter for the particles recycling
    - Some tweaks in the particles renderer, to improve performances on low hardware
    - Particles can now be immortal (set lifeTime to -1)
    - The particles age is no longer stored in the color alpha channel, so now the alpha can be modified within the color gradient
    - Particles can now have a Luminosity value, the homing missiles demo is updated with this new parameter
    - Position variation added to the particle emitter, this allows a random position offset on particles spawning
    - Multi threads added for meshes data generation and part of the meshes updates
    - New clouds demo added, with a dedicated shader
    - Project exported from Unity 4.0.0f7, since it's the minimal version to get it to work

    Now a new mesh is generated each 4096 particles (so one more draw call each time), to take advantage of the multi-threading sooner, in some parts of the meshes update process.
    So you'll get a few more drawcalls, but the meshes will be generated faster...

    The web player demo is up to date with some new sample scenes, here : http://www.alesk.fr/PuffySmoke/
    Note : In the last demo, I've removed the 3D character and replaced it by a capsule to get a lighter package.

    Luminosity example :
    $luminosity.jpg

    Cloud example with immortal particles :
    $puffy_cloud.jpg
    The clouds are still a work in progress, so they are pretty basic. I've some more ideas to improve them in the next updates ;)
     
    Last edited: Dec 4, 2013
  26. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Great looking Asset. Nice Work.

    Would love to buy... but need it on IOS. Any news on this. ?

    Cheers.
     
  27. Alesk

    Alesk

    Joined:
    Jul 15, 2010
    Posts:
    340
    Hi,

    I still don't have any solution to test it on iOS... :(
     
  28. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Well done. Thanks Alesk. :D


    Edit :

    L'Asset Store indique une version 1.10 du 4 novembre 2013. Et non 1.11?!
     
    Last edited: Dec 4, 2013
  29. Alesk

    Alesk

    Joined:
    Jul 15, 2010
    Posts:
    340
    Sorry for the misunderstanding : it's still pending for review by the unity team, it should be available in a few days

    EDIT : it's up on the asset store ;)
     
    Last edited: Dec 6, 2013
  30. kpod

    kpod

    Joined:
    Apr 30, 2012
    Posts:
    15
    Outstanding! This will really help out in creating dust trails for vehicles. Excited about the continued work on this plugin and can't wait to show what we're cooking up with your plugin :)
     
  31. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Please make it work on Mobile. There are many mobile users and having a mobile version will Definitely Increase Sales.

    Cheers.
     
  32. Alesk

    Alesk

    Joined:
    Jul 15, 2010
    Posts:
    340
    I know... but since I don't have a Mac and no Apple developper account, it will be difficult for me :/
    So, if some Mac user could help me, please send me a private message.

    EDIT : help found, thanks :)
     
    Last edited: Dec 15, 2013
  33. Alesk

    Alesk

    Joined:
    Jul 15, 2010
    Posts:
    340
    Hi,

    I need a new volunteer to help me to do some tests on iOS... I only need someone to compile and run the project on an iOS device, no scripting or shaders skills required (but if you got some, I'm interested too ;) )

    Send me a private message if you have some minutes to help me !

    Thanks
     
  34. IanStanbridge

    IanStanbridge

    Joined:
    Aug 26, 2013
    Posts:
    334
    Wouldn't it be easier to test it on Android than IOS if you want to check it is compatible with mobile ? You could just buy a cheap £30 android tablet and use the free version of unity to test it yourself. Both IOS and Android use opengl es2 so should be comparable. Also if you want to test it on opengles3 as well it is alot easier to do with android, obviously you would need a better tablet that supported opengles3 if you wantted to do that though you might also be able to find an android emulator for pc that could let you do it. If you need any tests done on android I don't mind testing it out on my nexus 5 if you want.
     
  35. Alesk

    Alesk

    Joined:
    Jul 15, 2010
    Posts:
    340
    Yes, but are you sure that the hardware will react the same way on an Android device and an Apple/iOS one ? Anyway, I'll try your suggestion, thanks ;)
     
  36. IanStanbridge

    IanStanbridge

    Joined:
    Aug 26, 2013
    Posts:
    334
    Yes they should behave the same way pretty much as they are both certified opengles2 compliant. As long as you send them an opengles2 shader the hardware should do the rest. The only differences there might be is in how they handle texture compression. Android as default uses standard opengles texture compression while I believe IOS uses powervr texture compression. If you'r really worried you could make sure you get an android tablet with a powervr gpu in it because then you could tell unity to use powervr on android too if you wanted to see how it would look exactly. You might want to stay away from any tablet with a tegra 3 chip in it though as I believe they are not fully compatible with opengles and so display some things differently and don't support shadows in unity correctly.

    Other than that as long as you only use unity standard classes and don't call any external dlls or platform specific features and android and ios should handle identically. The only difference between the 2 platforms is how they handle memory management and deal with caching and pooling. On the desktop unity tries to cache everything in memory if there is any free so when you first instantiate an object or call a class it is being loaded from ram rather than storage. IOS appears to try and cache a few things if it has memory but not all the time and android never caches anything unless explicitly asked to. Thats why its a good idea to use pools or specifically pre cache objects that need to be instantiated during runtime on mobile because then they will perform the same on all platforms.
     
  37. Alesk

    Alesk

    Joined:
    Jul 15, 2010
    Posts:
    340
    ok, thanks for these details...

    In the meantime, I've tried to build an android version, and got the "Android SDK does not include any platforms!" error message... with of course a platform in my sdk folder...
    Why is this kind of stuff never straightforward, NEVER... :(
     
  38. IanStanbridge

    IanStanbridge

    Joined:
    Aug 26, 2013
    Posts:
    334
    If you want to make it easy and have the storage space simply install the free android sdk from google and then tell the sdk manager to download all the platforms. It takes a while to install though as the script will actually go and ftp the files from all the different companies servers and some of those companies have pretty bad servers. Google provide instructions how to do this You will then probably get the great message that you don't have a bundle identifier in unity. Just go into the project settings and enter anything in there as unity doesn't check that it is valid bundle identifier, just make sure it is in the correct format and not the unity default on. As long as you have enabled your android device to be enabled for development and to allow apk installs from 3rd parties it should then just deploy automatically. If you tell the sdk manager to install all the platforms I think it also might install some pc emulators for android which you might be able to test with. I think it might be a hassle to get unity to deploy to them and obviously you won't get a feel for the performance of an actual device so I think it would probably be easier for you to deploy to an actual device. If you tell unity just to build rather than to build and deploy though you might be able to use them.
     
  39. Alesk

    Alesk

    Joined:
    Jul 15, 2010
    Posts:
    340
  40. Alesk

    Alesk

    Joined:
    Jul 15, 2010
    Posts:
    340
    Last edited: Jan 29, 2014
  41. Alesk

    Alesk

    Joined:
    Jul 15, 2010
    Posts:
    340
    Good news :

    Mobile support (iOS Android) is progressing, the shader (my biggest issue) seem to be working now :)
    I have to optimize it to improve performances, and maybe the scripting side too.

    Anyway, the next update should be available before the end of february.
     
  42. IanStanbridge

    IanStanbridge

    Joined:
    Aug 26, 2013
    Posts:
    334
    Sounds great, just in time for ps vita development
     
  43. Alesk

    Alesk

    Joined:
    Jul 15, 2010
    Posts:
    340
    I don't have the opportunity to test it on PS Vita, so I can't guarantee that it will properly run on it ...
     
  44. Alesk

    Alesk

    Joined:
    Jul 15, 2010
    Posts:
    340
    The new package has just been submitted, so it should be available on the Asset store during next week.

    The price is now set to 15$ ;)

    Details can be seen in the first post, version 1.12

    EDIT : Package available now on the asset store :)
     
    Last edited: Mar 1, 2014
  45. Alesk

    Alesk

    Joined:
    Jul 15, 2010
    Posts:
    340
    Hi,

    This is a message for my dear customers who have worked with this package :

    I'd like to get some overall feedback of your experience with Puffy Smoke. What would you like to get in the next updates ? What should be changed ? What should I optimize further ? Have you specific requests ?
     
  46. IanStanbridge

    IanStanbridge

    Joined:
    Aug 26, 2013
    Posts:
    334
    My suggestions would be to move your example scenes to a separate puffy scene folder so that they don't get lost in the scenes list if lots of assets are imported. I would also suggest you create a pdf of documentation and place it in the puffy folder as well. At the moment with the way your folders are laid out it can be difficult to see which assets are specifically related to your asset when others are imported. If someone is stuck on how to use puffy smoke for example they are going to type puffy into the search box to try and find documentation for it but not find any.

    It might also be worth creating an editor menu that allows a user to add basic puffy smoke objects to the scene to make it easier for beginners to use.

    In terms of new features it would be great if you could add better cloud building tools. You could for example make something that could create a mesh shaped cloud. the user would supply the mesh and then your script could convert the mesh into voxels and then make each voxel point a cloud to produce the cloudy mesh. You could also perhaps have a LOD system for these cloud objects because they wouldn't need to be as detailed when in the distance.

    You could also include a couple of preset cloud objects and perhaps include a fractal cloud generator that could produce random variations of these clouds. With these tools then users could quickly and easily add varied clouds into their scene.

    Also to improve rendering performance on lower end devices such as mobiles you could add the option to have the clouds rendered by a specific camera and then have a controller that would dynamically lower the resolution of that camera to improve fill rate performance if the frame rate dropped below a certain amount. Bear in mind that as clouds are meant to be soft anyway they often don't need to be rendered at the full screen resolution anyway.

    You could also add a smoke effect more suitable for gun fire or smoke rising from a camp fire for example rather than smoke just designed to be used in trails.
     
  47. Alesk

    Alesk

    Joined:
    Jul 15, 2010
    Posts:
    340
    Hi,

    Right, I'll reorganize this, and provide a better documentation soon, it was scheduled anyway ;)

    Good point, added to my todo list ! :)

    Thats precisely what I'm working on now ;)
    By the way, a basic LOD system is already present in the 1.12 update.

    This should work for distant clouds only. A fly through may not be convincing with this technique since the objects rendered by the main camera will not fade inside the clouds rendered in the low res camera, right ? Or am I missing something ?

    I'm not sure it will work for a gun fire, the camp fire case would be a better example, I'll add that too :)

    Thanks a lot for your feedback :)
     
    Last edited: Mar 22, 2014
  48. IanStanbridge

    IanStanbridge

    Joined:
    Aug 26, 2013
    Posts:
    334
    I think you can combine 2 cameras and still have the results properly depth sorted in Unity. Just tell both cameras to be rendered at the same depth so that unity knows it will have to combine their sort ordering properly. I think there are options in the camera you can change to deal with how it does depth sorting and clearing . I think the trick is that you make sure that the clouds are in a specific layer and tell that layer to only be rendered by the low res camera.

    I'm not sure if this requires unity pro though as it might be using render textures to do the sorting internally.

    The reason I suggested it is that lots of new phones are getting very high resolution screens. Some manufacturers are saying they may even make then 4K. Because of fill rate limits on phones if they do this the performance of particle effects will plummet on phones unless they are told to render at a lower resolution. I got the idea from the Post FX studio plugin which does a similar thing to make post process effects more efficient on mobile.
     
  49. Alesk

    Alesk

    Joined:
    Jul 15, 2010
    Posts:
    340
    ok, thanks for the explanation... I'll try to do something like that
     
  50. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,521
    What I notice is that even though they aren't being rendered they are getting assigned and into the array on the renderer list but that list is unmaintained. Why is the cleanup stuff on the missile launcher script? It should definitely be on the renderer list instead. I have no use for the launcher script and its confusing me why the renderer doesn't cleanup after itself at all which leads to perf issues after a couple of minutes (or seconds, depending on how many missiles you are spawning). The missile launcher script seems like something that would just be an example of how to help implement it, but is probably totally unnecessary.

    For scaling and optimization it might be best to just setup either one or two possible ways to use the asset:

    1) By emitter type/group... Spawning out of a prefab is how I would assume people are going to use this so perhaps a tiny missile script that you assign to the prefab and just say "its smoke type 3, or 5 or BlueSmoke" or whatever, then you put multiple emitters on the same object as the renderer and define them by name, then just define on the prefab which emitter you want it to use.

    2) By emitters on the prefab... Put emitters on the prefabs, spawn them at runtime, auto assign, cleanup and recycle on the renderer. This seems like the preferred method to me, but cleanup doesn't appear to cater to it.

    Can we also get a way to define multiple cameras? (Oculus Rift)
     
    Last edited: Mar 23, 2014