Category:Unity

From PopcornFX
(Redirected from Unity)
Jump to: navigation, search
Quick note on languages: we are in the process of translating important contents for PopcornFX in Chinese, Japanese and Korean.
You'll find in this page the translated HowTo PDFs. If you'd like to see something else translated, please contact us (support@popcornfx.com).

All our packages on the Unity asset store can be found here: https://www.assetstore.unity3d.com/en/#!/publisher/8762?aid=1101lGAz&pubref=wiki
Our official thread on the Unity forums is here : http://forum.unity3d.com/threads/popcornfx-optimized-particle-effects-plugin.297938/

Unity-logo-g.png

What's the PopcornFX Unity Plugin

The PopcornFX Unity plugin is an integration of the PopcornFX runtime libraries in the Unity game engine.
It takes advantage of Unity's Native Plugin Interface and Unity's command buffers (depending on the version of Unity, see here)

The plugin actually refers to 2 distinct parts :

  • The native plugin: a C++ library that runs natively on each platform, libraries for each platform can be found in Assets/Plugins (see Libraries Setup Reference Table (Unity Plugin) for the detail)
  • The managed assemblies: a set of compiled C# assemblies that are not platform-specific and provide the interface between Unity and the native libraries. They're located in Assets/PopcornFX/Scripts/


These are both identified by their version numbers and can't be dissociated (you can't take the native part from the 2.6 plugin and use it with 2.7).
The Asset Store packages are identified with the managed version number only.

The managed assemblies are provided with each version of the plugin (desktop, ios and android) and should be exactly the same (so once you've imported 2.6 from whatever package, you only strictly need the content of Assets/Plugins/ from the other packages).
All 2.7 packages have the same managed assemblies. Only the different platform-specific native libraries are exclusive to each package.

Getting Started

Setup From A New PopcornFX Project

  1. Make sure you are using the right version of the editor.
    The editor's version must match the PKFxRenderingPlugin component version.

  2. Create a new project and choose the 'Unity Project' template
    UnityProjectTemplate.png
    Set your project to be located in <Unity project's path>/YourFxProjectName

  3. Edit the settings :
    Baking > New platform > <Unity project's path>/Assets/StreamingAssets/PackFx
    UnityPKFxBakingSettings.png

  4. Make effects!

  5. Bake with dependencies
    UnityPKFxBaking.png

  6. See Unity Project Setup and Use Particle Effects

Unity Project Setup

If importing for the first time / updating from a v2.8+

  1. Import the plugin package
    • Discard PKFxUpdater
    • Discard StreamingAssets/PackFx if starting from a new PopcornFX project
    PkgFreshImport.gif

If importing from a project with v2.7 or older

See Updater_(Unity_Plugin).

How To...

Use Particle Effects

  1. Have an FX pack baked in Assets/StreamingAssets/PackFx (see Setup from new PopcornFX project)
  2. In your scene add the PKFxRenderingPlugin component to your camera.
    UnityRenderingPluginAdd.gif
  3. Add a PKFxFX component
    • Either by creating a new GameObject
    UnityFXNew.gif
    • Or by adding the component on an existing GameObject :
    UnityFXAdd.gif
  4. Drag'n'drop a pkfx file from the baked pack in StreamingAssets.
    UnityFxDragNDrop.gif
  5. Run, watch, enjoy.

Setup Particle Collisions

Particles can interact with static environment in Unity.
A "scene mesh" needs to be built.

  1. Add a PKFxSceneMeshBuilder component to an object in your scene
  2. Expand "Game Objects To Search"
  3. Drag'n'drop game objects with mesh renderers in their hierarchy to be used as scene meshes.
  4. Enter a pathname (relative to pack's root) to save the built scene mesh to.
  5. Click "Build Mesh".
  6. On your camera's PKFxRenderingPlugin component make sure you enable the scene mesh collision and enter the same pathname.

Identify Errors (Debugging)

Identifying Errors

Animate Effect Attributes

Animating Effects Attributes

Animate Effect Attribute Samplers

Animating Effects Attribute Samplers

Manage Effects' Assets Loading

Managing FX Loading

Setup Sound Layers

Setting Up Sound Layers

Deploy On Mobile Devices (iOS/Android)

Deploying on Mobile Devices

Pass Custom Data to the Audio Samplers

Passing Custom Data to the Audio Samplers (Unity Plugin)

Downloadable Documentation

Here are the HowTo available for the PopcornFX Unity plugin :

http://www.popcornfx.com/downloads/2014_11_28_HowToPopcornFXInUnity_REV_8.pdf
http://www.popcornfx.com/downloads/2014_11_28_HowToPopcornFXInUnity_REV_8_S_CHINESE.pdf
http://www.popcornfx.com/downloads/2014_11_28_HowToPopcornFXInUnity_REV_8_JAPANESE.pdf
http://www.popcornfx.com/downloads/2014_11_28_HowToPopcornFXInUnity_REV_8_KOREAN.pdf

Rendering Pipeline

Rendering pipeline

Components Reference

UnityComponents.png

PKFx-Helper

PKFx-Helper Assembly

PKFx-Runtime

PKFx-Runtime Assembly

PKFxManager

PKFxManager Assembly

Plugin's Menus

Menus

Troubleshooting

Troubleshooting

Feature list

Not all features allowed by the PopcornFX SDK are implemented in the Unity plugin.
To see the current status of the Unity integration, see the Feature list.

Changelog

Changelog

Subcategories

This category has the following 3 subcategories, out of 3 total.