Cartoon FX 1 | Cartoon FX 2 | Cartoon FX 3 | Cartoon FX 4 | War FX | Toony Colors Pro 2 | MatCap Shaders (Free) |
ShapeFX
Documentation
Thank you for your interest in ShapeFX!
This document will help you get started with the package, and explain its features in-depth.
ShapeFX is a set of VFX (visual effects) that have a very distinctive visual style, helping you give a stylized look to your Unity game or application.
All effects are composed of:
- one or multiple particle systems, using Unity's built-in system (code-named Shuriken)
- (optional) a light linked to the effect
- (optional) a handler script to help manage various things for the effect (autodestruction, camera shake, sound effect)
- an in-inspector editor to easily change the visuals of the effects in a few clicks
They all use simple shapes, yet achieve complex visuals and animation.
As such, they are recommended for:
- low-poly styled games
- voxel and Minecraft-like games
- placeholders
- prototypes
You can find all effects in the following folder by default: JMO Assets/Shape FX/Prefabs/...
They are thematically organized in sub-folders: environmental, explosions, hits, liquids, etc.
Drag and drop a prefab into your scene to quickly preview an effect. You can then change its appearance and behaviour using the ShapeFX Variants editor in the Inspector.
See below for an in-depth explanation of the ShapeFX Variants editor.
You can also just go and try to tweak all settings directly within Unity: everything was made to be as intuitive as possible.
There are also two demo scenes included that can help you preview the effects:
- JMO Assets/Shape FX/Demo/ShapeFX Demo: an example of how the effects look in different environments
- JMO Assets/Shape FX/Demo/ShapeFX Atlas: an exhaustive list of all included effects in Shape FX, along with their names
The ShapeFX Variants editor is embedded into each effect. It allows you to easily modify the appearance and behaviour of the effects without having to dig into the many properties of the Particle Systems.
While the ShapeFX Variants editor is a Component (so that it can be accessible in the Inspector), it will be empty and not cause any overhead in your builds.
You can only edit an effect when it is an instance in the Scene view, to prevent data loss from Prefabs directly.
Once you are happy with the changes, you can either:
|
The editor is divided into tabs that you can expand:
EDIT PROPERTIES
This tab allows you to modify various properties of the effect.
Use Mobile Atlas: use a single texture for all Particle Systems of the effect. This can be useful to reduce drawcalls when you use multiple different effects at the same time: you will only have one material per blend mode.
Use Density: control the Particle System's emission rate according to the Transform scale. Typically used for environmental effects, this ensures that the particle density stays the same when you resize the effect's box.
Effect Speed: change the Particle Systems' playback speed. Shortcut access to the ParticleSystem.playbackSpeed property that is not exposed in the Particle System inspector.
It will also adjust the effect light's playback speed setting, if any is attached.
Effect Size: change the scale of the effect easily. Once you are satisfied with the changes, you need to Apply the changes for them to take effect, else you can Revert them. Mostly useful before Unity 5.3 that introduced better Particle System scaling.
EDIT SHAPES
This tab allows you to change the visuals of the effect.
You will see a list of all Particle Systems composing the effect, with popups allowing you to change their appearance:
Shape: defines the shape used by the individual particles, for example square, circle, triangle, etc.
Style: defines the visual style for the selected shape, for example crisp, blur, etc.
Blend Mode: defines blending mode used, for example additive, alpha blended, multiplicative, etc.
SP: enable/disable Soft Particles for this effect (they still need to be enabled in the Quality Settings)
EDIT ALL: allows you to change a category for all Particle Systems of the effect. Useful if you want to stick to square shapes for a Minecraft-like game, for example!
Randomize: will randomly change the shape, style and blend mode for all Particle Systems, depending on which are toggled.
EDIT COLORS
This tab allows you to change the colors of the effect.
Change any of the values, and the effect will play automatically to preview the changes.
Once you are happy with them, you can Apply the changes, else you can Revert them.
Hue: will change the hue. Note that this doesn't have any effect if the saturation is 0 (i.e. grayscale colors).
Saturation: will change the colors' saturation. By default grayscale colors are excluded from this, unless you toggle the "Force Saturation" option.
Value: will change the colors' value, making them brighter or darker.
Invert Colors: will direclty invert the colors value. You don't have to hit Apply for this change to take effect (if you don't like it, just invert the colors again).
Restart Particle System on change: will replay the effect from start when you make a change. It's better to leave this disabled for looped effects.
EDIT LIGHT
This tab only appears if there is a light linked to the effect, using the ShFX_EffectLight component.
It allows you to edit that light without having to go into the light GameObject itself.
Enable Light Effect: enable/disable the Light GameObject, keeping it in the hierarchy.
Peak Intensity: the max intensity that the light will have during its lifetime (i.e. the intensity when the Intensity Curve value is 1).
Loop: repeat the light animation indefinitely, useful for looped Particle Systems.
Fade In: duration for the light's intensity to fade in, in seconds (if the effect is looped).
Fade Out: duration for the light's intensity to fade out, in seconds (if the effect is looped).
For looped effects it is recommended to directly call ShFX_EffectLight.StopLightEffect() from your scripts instead of relying on the auto-detection from the Particle System: this will ensure that the light intensity decreases while the last particles are still alive (instead of starting the fading out once there are no particles left).
|
Delay: delay before the light animation starts, in seconds.
Duration: duration of the light animation, in seconds.
Intensity Curve: variations of the light's intensity over its duration.
Color from Particle System: will get the light's color from the main Particle System of the effect.
Use Color Gradient: use a gradient to animate the color of the light over its duration.
Color: shortcut to modify the light's color.
Range: shortcut to modify the light's range.
Here is a step-by-step example that will:
- double the size of an effect
- change its visual appearance
- change its color
- change its attached light behavior
1.
Create an instance of the effect ShFX_Hit 1 in your scene2.
In the EDIT PROPERTIES tab, set the Effect Size to 2, and hit ApplyThis will double the size of the effect.
3.
In the EDIT SHAPES tab, on the EDIT ALL line:- click on the Shape drop-down and select Circle
- click on the Style drop-down and select Blur
- click on the Blend Mode drop-down and select Additive
4.
In the EDIT COLORS tab, adjust the values according to the screenshot below, making sure that Force Saturation is toggled (since the effect was initially white).Then hit Apply.
This will change the effect's color.
5.
In the EDIT LIGHT tab, adjust the values according to the screenshot below.
Note that the Range value should already be bold, indicating that its value is different from the source Prefab: this is because we doubled the size of the effect previously, which automatically handled the light's range as well!
|
6.
You now have a very different effect from the original, which you got in just a few clicks!You can save that new effect as new Prefab!
Overwriting the original Prefab is not recommended because:
|
Light Effect (ShFX_EffectLight)
You can either edit its properties from the Variants Editor directly (recommended), or in the light's Inspector.
Please refer to the EDIT LIGHT section of the Variants Editor for a description of its properties.
The light effect is previewed in the Editor when the Particle System is played. However, due to how it handles playing in the Editor, it might not play properly at times when previewing the Particle System. You can try to preview the effect again, making sure to have stopped it first, and it should work again. In any case, this won't interfere with how it plays at runtime. |
Effect Handler (ShFX_EffectHandler)
- the effect's auto-destruction or auto-deactivation when it has finished playing
- playing a sound effect when the Particle System is played
- performing a camera shake when the Particle System is played
You can completely disable Camera Shakes with the static flag ShFX_EffectHandler.DisableCameraShake
|
The Camera Shake system is made so that the original position/movement of the camera is preserved. It should "just work" in most cases. The camera position is moved during the Camera.onPreRender event, and restored during the Camera.onPostRender event. Be careful if you are also altering the camera position during these events! |
PROPERTIES
End Action: define what to do when the Particle System has finished playing.
- Do Nothing: ignore the end action
- Destroy Game Object: will call Object.Destroy on the GameObject containing the effect
- Deactivate Game Object: will call gameObject.setActive(false) on the GameObject containing the effect
Sound Effect: an AudioClip to play along with the effect (ignored if nothing is defined)
Shake Camera: enable/disable Camera Shaking when the effect is played
Camera To Shake: which Camera to shake (Camera.main will be used if nothing is defined)
Shake Angle: defines in which direction to shake the camera in degrees (e.g. 90° will create a vertical shake, whereas 0° or 180° will create an horizontal shake)
Random Shake Angle: randomizes the shaking angle at each shake
Shake Duration: how long should the camera shake last
Shake Delay: delay before shaking the camera
Shake Repeat: how many times should the shake be repeated
Shake Step: how long to wait before the camera is effectively moved during a shake (0 = every frame)
Shake Strength: maximum position offset for the camera to be from its original position
Use Falloff: enable/disable distance falloff settings to decrease the shake strength as the camera moves away from the effect
Falloff Min: distance between the camera and the effect at which the shake strength starts decreasing
Falloff Max: distance between the camera and the effect over which the shake effect is ignored
Soft Particle Modifier (ShFX_SoftParticleFactorModifier)
It avoids the need to create a lot of different materials with their own value by using Material Property Blocks .
Simply change the Soft Particle Factor value to the desired value.
Unlike the other scripts that work on the whole Effect and are attached to the parent GameObject, ShFX_SoftParticleFactorModifier works per ParticleSystem
|
If you still have questions, bug reports or suggestions please contact me by email: jean.moreno.public+unity@gmail.com
Cartoon FX 1 | Cartoon FX 2 | Cartoon FX 3 | Cartoon FX 4 | War FX | Toony Colors Pro 2 | MatCap Shaders (Free) |