Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

PopcornFX - Optimized Particle Effects Plugin

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

  1. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    226
    how do I get
    Sync with PopcornFX 1.9.0. Make sure to update your editors!?
     
  2. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    Hi @pexoid ,
    No, no gpu particles in this update.
    We have promising stuff currently in development but we're not production-ready just yet.
     
    overthere likes this.
  3. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    This is about the PopcornFX Editor, you'll find it here http://wiki.popcornfx.com/index.php/Announcements

    We also have an auto-update that should be triggered shortly.
     
  4. Janoooba

    Janoooba

    Joined:
    Feb 9, 2016
    Posts:
    43
    Unfortunately, the lack of multi layer rendering is a huge deal breaker for me. I'm developing a space game, and multiple layers are a key part of rendering. I can't even use PopcornFX systems on a rudimentary level without this, as all my effects are duplicated across all layer cameras. See attached: (Effect is better seen in motion)

    Unless there is some for of work around, I won't be able to use this for the majority of my games as even they implement basic view-model style systems and 3D skyboxes (As is the standard in the industry)
     

    Attached Files:

  5. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    Hi,
    I'm not sure what the problem is on the attached screen capture.

    The way our particle engine is built allows us to batch a lot of operations together to save both cpu cycles and draw calls.
    The other side of that coin means it's either all or nothing. You can't draw only certain effects from the same viewport.
    You can have multiple cameras with different viewports rendering their own effects to textures and do some compositing in an image effect on your main camera, though.
     
  6. Janoooba

    Janoooba

    Joined:
    Feb 9, 2016
    Posts:
    43
    Basically what I have is two layers to my scene.
    There is what I call "Starspace" which is a scaled down version of the star system. It has a single camera that mimics the player movement at a scaled down level (eg. 100m for the player is only 1m for the star camera), and renders only the things in starspace. This camera has a depth of 0, and renders first.

    Next I have what is called "Ship space". This is where the player is located, along with all of the things he can interact with (asteroids, shipwrecks, etc) The player here is always centered around (0, 0, 0), and this camera only renders shipspace material. The camera composites this RT ontop of the starspace one, this provides the illusion of a seamless, extremely large space.

    Because of this, if I have a particle effect on, lets say, the star. I have to render it ONLY to the starspace camera. Which works if that's the only PopcornFX renderer, but if I also, lets say, have a laser beam particle shoot out for the player ship, I need a renderer on that camera too, which will also render the starspace effect, doubling it in two locations.

    I want to stress that this isn't a specific problem with only my setup. Most games with 3D skyboxes have a setup similar to this, look at Half-Life 2 for an example.

    Hopefully this image should clear things up more.
    starspace_shipspace.png
    If I have a giant laser beam coming out of the top of the sun, it will show up in both starspace, far away where it should. But also right infront of the player, since that's where the sun TECHNICALLY is.
     
  7. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    Ok, so do the viewports of those cameras actually have to intersect?
    The cameras could be distant from each other, that way the effects can be positioned in the correct space.
     
  8. Janoooba

    Janoooba

    Joined:
    Feb 9, 2016
    Posts:
    43
    This is definitely a possibility, but we've been having issues with jittering due to floating point errors if we move things away from eachother. I've heard you should be safe up to 10k distance, but we've been seeing issues after 4k.
     
  9. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455
    Hello,

    So when I build out the game with these particles, I dont see them

    unity 5.3

    Windows 64
     
    Last edited: Feb 16, 2016
  10. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    Hi,
    Which package are you using?
    Did you take a look at our troubleshooting page?
    Do you get any errors at all (check out the PopcornFX log, too)?
     
  11. CameronSinfield

    CameronSinfield

    Joined:
    Jan 6, 2015
    Posts:
    4
    I've run into an issue.
    We launch our unity .exe's from a custom URI inside of chrome, it seems that the plugin is searching for the popcorn.htm in the executing assembly's location (or not, I forget which way around is the correct way when launching through other programs). Either way, this is the error I'm receiving:
    UnauthorizedAccessException: Access to the path "C:\Program Files (x86)\Google\Chrome\Application\48.0.2564.109\popcorn.htm" is denied.

    This causes PKFxManager to not initialise and, therefore, no particles :(
     
  12. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455
    WarfarePack

    Yes I looked at the trouble shooting page
    No, again it happens only in built exe game
     
  13. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    Indeed that's a bug. If you disable file logging in the PopcornFX preferences you should be able to go around this issue.
    We'll fix this behaviour in an upcoming release.

    Ok, what graphics API are you using?
    Can you check in your build's directory, the <Data directory>/output_log.txt and/or the popcorn.htm logfile and see if there's anything suspicious there?
     
  14. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455
    I looked the builds data directory streaming assets folder , plugins folder , and all DLLs are in
    dont know where the popcorn logfile is...... tried it in a fresh project as well
    What do you mean by graphics API, i am using a custom shader for the deferred in the graphics settings
    Windows API

    Maybe its the latest version of unity?
     
  15. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    Are you trying to build for x86 ?
    If that's the case, in Unity, you must check the box "Standalone" in the import settings of the dll D3Dcompiler_47-x86 and choose x86 platform.

    Either way, can you make sure you have the correct import settings for all the target-able platforms?
    You can refer to the Libraries Setup Reference Table on our wiki : http://wiki.popcornfx.com/index.php/Libraries_Setup_Reference_Table_(Unity_Plugin)

    I mean in the player settings, you can choose between OpenGL/DirectX9, 11 or 12. If you didn't change anything there you're probably in Automatic, which is DX11.
    I doubt it, we've been testing as far as Unity 5.4 beta and never encountered such issues.
     
    overthere likes this.
  16. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455
    yes , I was trying to build for X86 that fixed the problem...
    thank you for the responses
     
    ArtyBoomshaka likes this.
  17. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455
    Ok, so how do I use the effects if the camera is not tagged as mainCamera?
     
  18. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    Tags are irrelevant, you get effects on every camera that has the PKFxRenderingPlugin component attached to it.
     
  19. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455
    Hello again,

    So I am using the multicam setup, where the top camera is using the depth layer....

    the PKFxRenderingPlugin component does not work with that setup, as it seems to require the camera with the highest depth....
    how do I go about making the popcornFX work with the multi cam setup?
     
  20. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    A few questions. Does this work on Unity 5.2? Does this work on the Wii U? How is performance compared to Unity's 5.3 particle system? Thanks in advance.
     
  21. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    Hi, yes it works on Unity 5.2 and as far back as Unity 4.5 (see the rendering differences between versions here).
    No, we don't support WiiU (you can find a table of supported platforms and graphics APIs here).
    Performance is overall better, up to 3 times faster (depending on the platform, the effects, etc), both at instantiation (spawning a large amount of particles at once), at the simulations (think turbulences sampling, physics, etc...) and rendering (we use a rather aggressive batching strategy).
     
  22. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    Not sure what you're talking about, here.
    What are you trying to achieve? What do you mean by multi-cam setup?
     
  23. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    That's too bad. We really need a high performance particle effects solution for the WIi U. Our only hope now is that Unity 5.3/5.4 improvements will help. If you ever decide to support Wii U, I am willing to be a tester to help iron out the issues.
     
  24. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    Aw, sorry to hear that. :/
    Noted, but [Edit : don't] hold your breath.
     
    Last edited: Feb 23, 2016
  25. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I assume you mean don't hold my breath or are you saying there is something in the works already? ;)
     
  26. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455
    • Camera (0) with depth = 0 which draws the Default layer and ClearFlags to Skybox.
    • Camera (1) with depth = 1 which draws Nothing, that's where your weapon would be in a FPS for example so the layer would have to be set accordingly and ClearFlags to Depth Only.

    the PKFxRenderingPlugin component does not work with that setup, as it seems to require the camera with the highest depth....
    how do I go about making the popcornFX work with the multi cam setup?
     
  27. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    I swear I wrote "don't", how did that slip through even after proofreading my post?
    Anyway, yeah. Don't hold your breath. :/
     
  28. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    If by "not working" you mean it draws the fx on top of everything, that's because the camera's culling mask is set to "Nothing", so the PKFxRenderingPlugin has no depth information when rendering particles.

    If by that you meant something else, then I'm at a loss.
     
  29. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455
    When did I say that culling layer was set to nothing?
    its set to depth, and yes it draws on top of everything,

    Multi Camera Setups: A (First camera: Clear with Background / Skybox, for the other cameras: depth only or don’t clear.

    Because that cam script you made there has to be on a camera with the highest depth, it causes the particle effect to render out in the camera that is set to depth only
     
    Last edited: Feb 23, 2016
  30. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    I... There, you said it there :
    It seems that's not what you meant and I apologize if I didn't understand correctly.

    None of my tests have permitted to verify what you are saying. The particles render in the camera that has the PKFxRenderingPlugin component attached to it, regardless of the camera's depth, clear flags or culling mask (as far as I can tell).

    Can you post a screenshot of what seems to be the problem and what you were expecting instead?
     
  31. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455
  32. Janoooba

    Janoooba

    Joined:
    Feb 9, 2016
    Posts:
    43
    Is your second (Viewmodel) camera supposed to have an ADDITIONAL rotation on top of the main camera?
    This would definitely cause the weird effect I'm seeing here. Try making the secondary camera have 0,0,0 in position AND rotation and report back.

    [Edit1: for clarity]
    Your second camera is rendering the particle effects from a completely different angle (an extra 20 degrees in rotation), then overlaying that on top of your first camera. That's what I'm seeing at least. Both cameras must have the exact same position, rotation, and FoV for this to work.

    Also take note of the problem I had using this type of setup:
    You will NOT be able to render different effects, on different layers. So make sure you're sure about rendering ALL particle effects on the viewmodel camera, and only the viewmodel camera.
     
  33. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455
    yea ,but it still on renders the particle as depth which makes it renders IN FRONT of all objects, thats the whole point of having the secondary camera to render view models and avoid clipping....

    Anyway I think what needs to happen is that script needs to be able to render on a camera that doesn't have the Highest Depth.
     
    Last edited: Feb 25, 2016
  34. pexoid

    pexoid

    Joined:
    Aug 29, 2014
    Posts:
    16
    Am I going totally bonkers or is popcorn flipping the frame when forward rendering is enabled on camera?
     
  35. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    Mmmh flipping does happen when an image effect is added to the camera, we have the Has Post FX bool to flip it back, but that has nothing to do with forward rendering...
    Care to elaborate on the issue?
     
  36. pexoid

    pexoid

    Joined:
    Aug 29, 2014
    Posts:
    16
    Scene with forward rendering camera with PKFxRendering component. PostFx, soft particles, distort and blur enabled. Gameobject with PKFxFX that emits additive and distort particles, moved so that it should be visible in upper portion of screen. Renders to bottom part. Switching rendering mode to deferred and it renders where it should.

    This is the simplest case that seems to go wrong for me. The behaviour goes wackier if I start the scene with deferred rendering on and switch to forward while playing the scene, it gets rid of distortion rendering and flips frame.
     
  37. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455
    @ booyah.

    hello, did you solve the 2 camera depth issue?or do I need to send you a demo to look at?
     
    Last edited: Feb 29, 2016
  38. PkFxBaron

    PkFxBaron

    Joined:
    Feb 29, 2016
    Posts:
    4
    Hello @AlteredPlanet ,
    This behavior is clearly not a bug. As you may understand, the "PkFxRenderingPlugin" component needs the depth of the camera to which it is attached to if you want the scene geometry to hide your effect (an explosion behind a wall should not be drawn on top of the wall). As your "WeaponCamera" is not rendering anything but the particle and has a greater depth, all your effects are on top of the scene you are rendering with the "MainCamera". Furthermore, as both of those cameras dont have the exact same orientation (based on your video, the relative rotation of the "WeaponCamera" is not set 0, 0, 0), the effects don't seem to be drawn at the right place.

    So to sum up your problem:
    - The effects are drawn on top of everything because the PkFxRenderingPlugin is attached to the "WeaponCamera" and not to the "MainCamera"
    - The effects seem to be drawn at the wrong position because the "WeaponCamera" is not aligned with your "MainCamera"

    I don't really understand what you are trying to achieve but I hope this helps.
     
  39. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455
    SO the PkFxRenderingPlugin doesnt have to be on the camera with the highest depth?
     
  40. PkFxBaron

    PkFxBaron

    Joined:
    Feb 29, 2016
    Posts:
    4
    Depends on what you want to achieve, but if you don't want the particles to be rendered on top of everything, then you should put the PkFxRenderingPlugin component on your "MainCamera", otherwise no object in the scene can occlude your particle effects, this is a normal behavior. Even if you draw a cube on your "WeaponCamera", it will appear on top of everything and will not be aligned with the scene, just like the particles in your video.
     
  41. PkFxBaron

    PkFxBaron

    Joined:
    Feb 29, 2016
    Posts:
    4
    @pexoid
    I do have the frame flipping when I change the rendering path at run-time, but I have the exact same rendering whether I choose deferred or forward rendering before playing the scene (without changing any settings on the PkFxRenderingPlugin).
    Can you give us more information about the version of the plugin, the version of Unity and the graphic API that you are currently using?
     
    Last edited: Feb 29, 2016
  42. pexoid

    pexoid

    Joined:
    Aug 29, 2014
    Posts:
    16
    PopcornFX plugin 2.7 for Unity 5.2 and up (Build 1.9.0.28360)
    Unity 5.3.1p2
    Dx11
     
  43. Liviuss

    Liviuss

    Joined:
    Apr 2, 2014
    Posts:
    101
    Seems to be a very nice plugin but, i just downloaded presentation demo from android store and looked into performance.
    It seems that shuriken outperform popcorn when you use < 25 emiters.
    Tested on Galaxy S5 Octa Core and on "Fire Breath" emitters i get Shuriken:80-120fps Popcorn:30-82fps also noticed how high is the CPU usage on Popcorn. Where Popcorn do really a good job is when you use a lot of emitters but let's be honest, it's not a mobile case. Also i don't know which unity version is used on that android build since unity improved a lot the particles rendering pipeline. Any comments on this?
     
  44. PkFxBaron

    PkFxBaron

    Joined:
    Feb 29, 2016
    Posts:
    4
    @pexoid We are currently investigating the bug.
    @Liviuss The benchmark is not very accurate as it only tests very simple Fxs (no physic, no complex particle behavior...), and the results depend on the hardware. We are currently working on a more accurate benchmark with more advanced effects to show where are the advantages of using Popcorn, but clearly, if you are aiming at very few particles and simple effects, then Shuriken might be faster (that doesn't address the authoring process, though).
     
  45. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455
  46. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    Hi, can you look at your build's logs to see what might be wrong?
     
  47. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455
  48. ArtyBoomshaka

    ArtyBoomshaka

    Joined:
    Mar 5, 2013
    Posts:
    226
    Well, there's a bunch of errors stating the dll couldn't be loaded.
    I looked at your video again and it seems you're loading HH_UnityPlugin.dll for 64 bit for both x86 and x64. You should make sure it's set to x64 only and set the HH_UnityPlugin.dll from Plugins/x86 to load for x86 builds.
     
  49. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455
    I tried it , and that did not work either
     
  50. Gus3D

    Gus3D

    Joined:
    Dec 1, 2014
    Posts:
    27
    Any news on the Mac editor?