Search Unity

PopcornFX - Optimized Particle Effects Plugin

Discussion in 'Assets and Asset Store' started by PopcornFX, Feb 13, 2015.

  1. ironbelly

    ironbelly

    Joined:
    Dec 26, 2011
    Posts:
    597
    Are there any real world performance comparisons between identical heavy effect running through Shuriken versus Popcorn? I'd be curious to see how the performance differs when you start getting into heavy performance heavy effects.

    thanks
     
  2. mittense

    mittense

    Joined:
    Jul 25, 2013
    Posts:
    168
    I can only give anecdotal evidence, but the closest you get to advanced particle control in unity is slower than you're likely to get with Particle Playground unless you devote some decent time to a dedicated solution... And Particle Playground is noticeably less performant than Popcorn FX's solution.
     
  3. blejd

    blejd

    Joined:
    Sep 27, 2014
    Posts:
    10
    Is there any reason why image effects (edge detection for example) cause PopcornFX to render particles without using ZBuffer?
     
  4. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    @ironbelly : We have a performance comparison app available for iOS and Android, we are looking into adapting it for desktop.

    @blejd : Care to elaborate on that? We never had such an issue before and I can't seem to reproduce it.
     
  5. blejd

    blejd

    Joined:
    Sep 27, 2014
    Posts:
    10
    I created new project to test that issue and everything was working fine (as you said earlier), so I narrow the problem to one of our custom shaders for glass rendering and remove "Queue"="Transparent" from Tags of subshader.
     
  6. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    @blejd : Ok, thanks for the report. So did that fix it? We'll look into it.
    Also, you'll be glad to hear the sound layers are now implemented and will be available in the next update. :)
     
  7. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Hello! I have a couple more questions about this interesting asset.

    1. do you have a performance comparison with shuriken? What do you do that makes it perform better?
    2. I haven't seen any sign of PS4 compatibility and that's our number one priority for now.

    Thanks :)
     
  8. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    @hippocoder : 1. Yes, on mobile only at this time. I edited the original post with the links :

    As for why we perform better, well we don't know how shuriken is done so I'm not sure how we compare, but we're implemented natively, which allows fine tuning of platform-specific low-level optimizations (think memory efficiency, SIMD and multi-threading).
    Also, we batch all compatible particles together to reduce the number of draw calls. Things like that. :)

    2. We are currently looking into it. We do have a port of the PopcornFX runtime libraries for PS4 but we're not sure about the Unity-side of things. Apparently native plugins are supported on PS4 now so there's hope, but whether it's possible to natively render stuff still isn't quite clear.
     
  9. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Well I love what you guys are doing (not interested in mobile though) - and will certainly keep an eye on things. Noticed on trello you're having a look at GPU particles - does that mean compute shader?
     
  10. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    Thanks! We're putting a version of this app together for desktop, at the moment. I'll update when it's ready.
    Yes, it does mean compute shaders. :)
     
    Last edited: Apr 28, 2015
  11. blejd

    blejd

    Joined:
    Sep 27, 2014
    Posts:
    10
    It's working now. Strange thing is that I tested an old version of the shader (which was causing the issue) and everything was fine then (maybe Unity didn't recompile or refresh something, it's hard to say).

    EDIT: I tested it again and now it's not working with the old shader. Really strange :D

    EDIT 2: Tomorrow I will send you a small scene (new project with only PopcornFX imported) with a box and a flame thrower behind it. You will see that flames are rendered in front of the box (check Standard Transparent Unity shader).
     
    Last edited: Apr 29, 2015
  12. blejd

    blejd

    Joined:
    Sep 27, 2014
    Posts:
    10
    Here is an image of the test scene. Four cubes next to each other with Standard Shader material (in sequence: Opaque, Cutout, Fade, Transparent). As you can see flames (which are behind cubes) are rendered correctly only on the first two.
     

    Attached Files:

  13. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I was also wondering if lit particles are possible or shadowed particles?
     
  14. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    There's only one image attached to your message.
    What you're saying makes sense, though. I'm not familiar with Fade but Transparent shaders don't write in the Z-buffer because what's behind it still needs to be rendered in the solid pass.
    We can't interact with those well because of the native plugin interface. We still need to look into the new command buffers but basically, there's no way that I'm aware of so far that would allow us to render between the solid and blending pass.

    @hippocoder : Lit particles and shadowed particles are not possible right now. They were impossible to achieve in an even remotely efficient way in Unity 4.X because of the native plugin interface limitations, but it may change once we look into the command buffers.
     
  15. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Sounds like great news. Keeping a close eye on this thread for further news ie ps4 support, general lighting/shadowing :)
     
  16. blejd

    blejd

    Joined:
    Sep 27, 2014
    Posts:
    10
    I was talking about cubes, not images :D
     
  17. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    @blejd : Ah yes, I read too fast, my bad. I understand what I'm looking at, now. ^^
    So, yeah. What I said still stands.
    What's happening in the picture is the first 2 cubes do write in the Z-Buffer, so the particles are masked when we get to draw them. The 2 last ones don't, so that Unity can render what's behind and blend afterwards, but the blending already occurred when we get to draw our particles, so the depth test succeeds when it should not.
     
  18. Gus3D

    Gus3D

    Joined:
    Dec 1, 2014
    Posts:
    27
    First time I'm seeing this. Looked exactly like what I needed, watched a few videos, was about to hit purchase and then I found out the editor is Windows only. Looks like I just can't get rid of Shuriken. :(
     
  19. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    Sorry to hear that. You may want to keep an eye on our updates, though.
    We currently have a new multi-platform editor in the works, but it's still in its very early stage and will require several months of development before it can reach a production-ready state.

    I can't give you a time estimate just yet, but you're not alone in that case so I'm confident we will bump the priority of this task soon.

    I'll update the first post to make all that clearer, thanks.
     
  20. Batzer4042

    Batzer4042

    Joined:
    Apr 30, 2014
    Posts:
    4
    Hello booyah,

    I just purchased the iOS and Desktop Plugin. Everything works fine on desktop, but i've stuck with an problem on iOS.
    I tried to get rid of the .png problem by following the faq (moving the "libPK-Plugin_CodecImage_PNG_r" up to the top of the list), but there is a linker error following.:

    "ld: warning: directory not found for option '-L"/Projects/Builds/PopcornFX/Libraries"'
    ld: warning: directory not found for option '-L"/Projects/Builds/PopcornFX/Libraries/Plugins/iOS"'
    ld: library not found for -liPhone-lib
    clang: error: linker command failed with exit code 1 (use -v to see invocation)"

    Linking is finde when not moving the "libPK-Plugin_CodecImage_PNG_r" in the list.

    Xcode 6.2
    Unity 5.0.0f4

    Do you have any ideas?
     
  21. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    @Batzer4042 : Hi, well, that's a new one.
    Did you somehow delete libiPhone-lib.a from the list? Is it still in there?

    This library is Unity's, not ours. It should be automatically copied in your Xcode project. Can you find the file libiPhone-lib.a in the Libraries folder in your Xcode solution?
     
  22. mittense

    mittense

    Joined:
    Jul 25, 2013
    Posts:
    168
    Do you think y'all could update the Trello roadmap to get an idea of what's coming next from the editor/runtime?
     
  23. Batzer4042

    Batzer4042

    Joined:
    Apr 30, 2014
    Posts:
    4
    @booyah:
    I figured it out, you gave the right hint. After moving the libiPhone-lib.a one Position in the List all went fine and no errors while linking occurred. Strange behavior nevertheless.
     
    ArtyBoomshaka likes this.
  24. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    mittense likes this.
  25. mittense

    mittense

    Joined:
    Jul 25, 2013
    Posts:
    168
    yay
     
  26. kalamona

    kalamona

    Joined:
    Aug 16, 2011
    Posts:
    727
    Hey,
    I just began to learn what is this Popcorn stuff, I downloaded the editor and some examples (GDC 2015), and... uhh... among the demos, I found one of my effects, that was done in Shuriken. o_O

    Popcorn:
    WtfPopcornUsesMyEffect.jpg

    my effect from the Shuriken Magic package (background is lighter, but otherwise the same):
    WtfPopcornUsesMyEffect2.jpg

    Even the texture names are the same. I also found an other copied effect, but that is less noticeable. And my package is from 2013 or so, so far before the 2015 GDC.

    Now I don't plan to do anything besides writing here (actually it is a bit heartwarming that my mediocre effects are among such great ones), but why? How? I mean, my impression was that the usual pipeline is making the effect in the Popcorn desktop editor, then importing it into unity with the help of the unity popcorn integration tool (sorry details are a bit hazy to me, I just began learning this today), but it can be done on the opposite way too? Or it was recreated in Popcorn?

    Also what does this do among the popcorn examples? I mean it isn't that good. Used as a negative example, like "you can create effects better than this", or something? :)

    cheers,
    Kalamona
     
  27. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    Hi @kalamona ,
    Well, thanks for checking out PopcornFX!

    We originally used your effects for the needs of our mobile benchmark application (here and there).
    To show the possible performance gain, we re-made your effects with Popcorn. Not to display as a negative example at all, but rather to have a common ground to compare Shuriken and PopcornFX.

    Turns out the re-made effects got added in our GDC15 pack in case we wanted to show them in the editor while we were at GDC this year.

    There was no harm intended from our part, we used your effects because of their popularity on the store.

    Otherwise, yes. The usual pipeline is indeed what you described.

    Cheers,
     
  28. kalamona

    kalamona

    Joined:
    Aug 16, 2011
    Posts:
    727
    Heh, thanks for explaining. Popcorn seems wonderful by the way, I really like that you try to make an unified "effect engine" so that effect artists don't have to re-learn everything when changing engines.
     
  29. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    @kalamona : Would you like us to remove the remade effects from our public GDC15 pack, then?
    Also, thanks for the kind words. :)
     
  30. kalamona

    kalamona

    Joined:
    Aug 16, 2011
    Posts:
    727
    Nah, don't bother. I was just surprised and puzzled, how and why and all that :)
     
  31. sukoshi

    sukoshi

    Joined:
    Dec 4, 2012
    Posts:
    5
    @PopcornFX.
    Don't works for me..:(

    I have just buy the plugin for Unity Android,iOS
    I am using Unity 4.6.3p4 and using PopcornFX_Samples for test. It displayed no effect.
    In editor, has error:

    DllNotFoundException: HH-UnityPlugin
    PKFxManager.Startup ()
    PKFxFXEditor.OnEnable ()

    I have also seen this post http://wiki.popcornfx.com/index.php/Unity but no help.
    Help me plz, i need fix it now.
    Sorry for my English
     
  32. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    Hi @sukoshi,
    I'm guessing you're trying to play in editor mode on your desktop machine.
    You need the desktop plugin for that. The iOS and Android plugins only provide the platform-specific libraries.

    If you don't plan on releasing on any Desktop platform, please contact us on support@popcornfx.com and we'll see how we can provide you with development-only libraries.

    Cheers,
     
  33. sukoshi

    sukoshi

    Joined:
    Dec 4, 2012
    Posts:
    5
    Hi @booyah
    Thank you for replying so quickly.
    As you suggested, I contacted to support@popcornfx.com and got development-only libraries.

    Thank god, It work like a charm on Android.
    But it still not work on iOS.
    Ex on sample_menu, it displayed black screen.
    And so strange in Sample_Teleporter


    There was some error log on Xcode:
    Could not add /private/var/mobile/Containers/Bundle/Application/84F144D6-5AD0-48E7-BEF3-2B3105C820C4/xxxxxxx.app/Data/Raw/PackFx for watching because no file watcher.

    [ERR1][GE_SHAPES]> shape descriptor: failed loading mesh resource "Meshes/Telepod.pkmm"
    [ERR1][GE_SHAPES]> failed creating shape

    [WARN][HH_PARTICLES]> Unsupported renderer found : "no more renderer" ! INCOMPLETE RENDERER
    [ERR1][HH_PARTICLES]> Particle Renderer : runtime object creation failed for renderer

    Thank you for supporting !!!
     
  34. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    @sukoshi : Well, that's a new one. It seems the distortion setup failed. Can you take a look at your iOS player settings and tell me what is set for the "Scripting Backend" and "Graphics API" settings?
     
  35. sukoshi

    sukoshi

    Joined:
    Dec 4, 2012
    Posts:
    5
    @booyah
    This is my setting.

    Is there something wrong?
     
  36. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    @sukoshi
    No, that looks fine.
    Ok, that's most likely a case of Unity's arm64 libpng doing weird things with our texture loading code.
    You can fix this easily in you XCode project.

    In the project's "Build Phases", under "Link Binary With Libraries", locate the item "libPK-Plugin_CodecImage_PNG_r.a" and move it all the way up in the list.
     
    sukoshi likes this.
  37. sukoshi

    sukoshi

    Joined:
    Dec 4, 2012
    Posts:
    5
    yeahhhhhhhhhhhh !!!!
    It worked !!!!
    Thank you so much !
     
  38. sukoshi

    sukoshi

    Joined:
    Dec 4, 2012
    Posts:
    5
    @booyah
    It work almost fine but in Sample_Teleporter has a bit strange

    And i found some error log:

    Can you explain to me ?
     
  39. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    @sukoshi : Erm.. Did you change anything in the Player Settings or in the effect itself?

    Something must have happened to the effect or the binaries between your "It worked!!!" and those errors...
     
  40. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    Hi all,

    Just a quick message to notify that we updated our free so-called Discovery Pack.
    It now includes a free version of the Desktop Plugin, limited to effects signed by us (only the effects in this pack as of now).

    So now you can try out the actual effects before you decide whether you want to buy the full plugin or not!
    I'll update the first post.

    Also, we have an update of the iOS benchmark app coming up, the performance were crippled (yet still better than Shuriken) because of some multi-threading mismanagement.

    The v2.5 of the desktop and mobile plugins is coming too, I'll post an update with the changelog when it's validated on the asset store.

    Cheers,
     
    mittense likes this.
  41. mittense

    mittense

    Joined:
    Jul 25, 2013
    Posts:
    168
    Like button.
     
    ArtyBoomshaka likes this.
  42. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    Also I forgot to add, in addition to our online documentation and this thread, we just launched our own answerhub!
    It's primarily intended for editor-related questions and it's monitored by the PopcornFX devs, but feel free to ask and answer questions there.

    Cheers,
     
  43. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    Update time (paging @mittense )!
    2.5 is finally here, available on the store!

    So, what's new?

    Fixes:
    - Fixed a crash when deleting hot-reloaded effects.
    - Fixed a crash when calling StopEffect in OnDisable.
    - Fixed a crash when getting in and out of a scene with effects using spacial layers.
    - Fixed race-condition issues that would cause seemingly random crashes and errors.
    - Fixed a bug where localspace effects and attributes were 1 frame behind.
    - Fixed iOS multi-threading performance.

    Features :
    - Added an Alive() method to the PKFxFX component that returns true as long as an effect is spawning particles.
    It's considered safe to destroy the GameObject holding the PKFxFX component when this returns false, but don't poll this every frame, as native calls have a bit of overhead.
    - Added the possibility to enable the killing of individual effects.
    - Added a main conf file for settings (holds the "log in file" and "effects killing" settings so far).
    - Added support of PopcornFX's sound layers (see here) (paging @blejd).
    - Added support for audio waveform sampling.
    In addition to the spectrum sampling, already implemented and showcased in the Jukeball sample.
    - Added support for audio sampling (waveform and spectrum) for iOS.
    This wasn't available for iOS, it now is.
    - Added PKFxManager.UnloadEffect(string path);
    To actually unload an effect and the associated resources (shaders, textures, meshes and so on...), see here.

    In the upcoming days, I'll be updating the online docs with the new features, so keep an eye out for that.

    Cheers,
     
    mittense likes this.
  44. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Hi,

    I'm working on a 'desert-sand-planet-windows-desktop-project'. What i need exactly do to this? :


     
  45. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    ZJP likes this.
  46. mittense

    mittense

    Joined:
    Jul 25, 2013
    Posts:
    168
    YAY UPDATE DAY.

    What does this mean, exactly? I can already destroy the gameobject associated with PKFxFX which kills them, is this a different sort of functionality or?
     
  47. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    @mittense : Yeah, it needs to be enabled (project-wise) via "Edit>PopcornFX Settings>Enable Individual Effects Killing" and it allows you to instantly kill all the particles spawned by a PKFxFX component instead of waiting for them to die out.

    It has to be manually enabled because it requires us to store a spawner ID for every particle and keep a reference on a lot of stuff that needs updating, which as you can imagine is not exactly the cheapest of processes.

    When PKFxFX.Kill() is called, we iterate through all live particles to individually kill those matching the killed spawnerID.

    So that feature is there, but depending on your effects it can be quite taxing on the performances and if you don't absolutely need it, it's better not to use it.
     
  48. pexoid

    pexoid

    Joined:
    Aug 29, 2014
    Posts:
    16
    Couple of questions:

    Are you planning to support dynamic primitive colliders? When?
    Can the "scene mesh" built run-time? Think of content generated at start.
    Can we receive event ticked with 'broadcast' from Popcorn to Unity?
    Have (dynamic) arrays of attributes?

    Thanks.
     
  49. MornFall

    MornFall

    Joined:
    Jan 11, 2013
    Posts:
    160
    I have popcorn since some time now, but i got discouraged a little bit. Since i am learning to script in C# in unity at the same time, i decided to come back to popcorn later on, with the hope that i would find more "unity related" tutorials.
    So... here i am now, my game prototype is almost done. I am at the stage where i have to do the visual effects...
    But... still the same unity tutorials... the fire/smoke thingy.
    I need moooaaarrrr.
    Like : is there a way to switch between local and worldspace emission ?
    I have a cannon energy projectile i need to make : The shoot, the projectile itself and the impact. Can i do that in one effect and "triggers" from within unity via code ?
    i have a "time based" Spawn system, x unit takes 5 sec to spawn, y unit takes 10 sec, ect... can i do that in one effect ? the initial effect, the looping , and the end of the spawning. Again, is there a way to trigger all that via code ?

    If you could point me out as to where i can find all those informations, that would be great ! thanks.
     
  50. PopcornFX

    PopcornFX

    Joined:
    Mar 20, 2014
    Posts:
    32
    Hi,

    side note:
    a part of the team is in Amsterdam for Unite Europe! If you have the chance to attend this event, you can meet us at the booth A14 tomorrow!

    @pexoid
    - not yet, there is several ways to provide dynamic primitive colliders, can't tell you when right now but we'll explore the options and try to bring this feature asap. (card added in the Trello: https://trello.com/b/Z1q9xz72/popcornfx-roadmap you can vote for it!)
    - changing the scene mesh at runtime will require a rebuild of the KdTree so it can take a significant amount of time, but if you can afford it during a loading, mesh handling could be added
    - "Can we receive event ticked with 'broadcast' from Popcorn to Unity?" can you explain this, not sure to understand ?
    - no we can't provide arrays of attributes, this won't fit well with the architecture of popcorn. You'll be able to use the upcoming attributes samplers (curve or texture) to pass complex datasets.

    @Feydwin
    You're right we are very conscious about the tutorials needs and this is the top priority for our tech art team right now!
    Meanwhile, please have a look at http://wiki.popcornfx.com/index.php/Unity/Animating_Effects_Attributes , this should answer most of your questions.
    And please don't hesitate to check answers.popcornfx.com and ask for help on specific subjects if needed!

    Regards,