An unreal engine after image effect plugin
Ghost trails is an Unreal engine plugin to allow easy creation of after image type effects, or "Ghost Trails". It is designed to be quick to set up and easy to extend for your own needs.
Enable "Ghost Trails" plugin in your project.
Open an animation of your choosing (e.g. your characters walk/run).
Add the anim notify of "Ghost Trail Notify Material Parameters"
Select C_EffectTimeline in effect timeline of the notify. (you may need to check "show plugin content" from the cog icon)
Add a material to the Materials array of the notify (e.g. M_FresenelTrail_Inst)
Run your project and view the animation in game to see a "trail" spawn at the notify's location in the animation sequence.
The core of the plugin, these provide various methods of generating the after image effects.
This class is the base of the ghost trail functionality. It is intended to be used as a core setup of the poseable object and be built upon either using the provided 2 other classes or your own.
It will create the after image via a poseable mesh that copies the pose of the character and applies the supplied material. It will then run a timeline based on the supplied float curve (x axis is time, y axis value is used in timeline update). When the timeline completes it will then destroy the actor.
As the intent is for functionality to be applied on top of this class it provides 2 functions that can be implemented in blueprint:
Update Effect Progress - Called with the Y Axis value provided in the curve with the intention to update the effect as the timeline runs.
Effect Finished - Called on timeline completion NOTE: This currently destroys the actor so if overriding you may wish to call the parent or provide your own clean up/pooling logic.
If you simply want a posed mesh to be created and destroyed this class could be used as is, however it is recommended you use 1 of the other 2 included implementation or provide your own for better effects.
The effect is achieved by simply spawning the actor as detailed below:
Time Line Curve - This should be the float curve to be followed for this GhostTrail
Trail Materials - This is an array of materials that will be applied to the copied mesh, it will apply them in the same order as the material slots on the original.
Trail Character Mesh - This is the Skeletal Mesh Component that is the be copied (usually from your character).
Should Process Child Meshes - Checking this will process and copy any children (skeletal or static meshes) of the above Mesh component otherwise it will only process the first skeletal mesh. Note: For child meshes only the last material in the provided array will be applied to them.
Should Render Custom Depth - Whether to set the custom depth flag on the poseable mesh.
This class is an implementation of the Ghost Trail Base class that sets the materials up as dynamic material instances so that the parameters of the material can be during the timeline update. As such this should be used if you wish to update a material parameter directly in order to achieve your desired effect, by default this class will use the parameter of "Opacity", but can be set to what ever you desire.
This class is an implementation of the Ghost Trail Base class that sets sets primitive custom data on the meshes during the timeline update. This should be used if you wish to update primitive data on the meshes to achieve your material effects, thus avoiding the overhead of creating dynamic material instances. This provides the additional option of being able to set the index that is to be updated.
Animation notifes for easy use of the effect.
This notify is provided to allow easy use of spawning ghost trails from within animations. It takes care of a lot of the setup including passing in the meshes and spawn transform from the character running the animation. It allows you to select a Ghost Trail class so can be used with any Ghost Trail type, however if any additional parameters are used it will only be able to pass in the defaults for that class.
The parameters of the notify should correlate 1:1 with the Ghost Trail class whilst also allowing you to offset the the spawn transform relative to the character via the "Offset" transform.
This notify behaves as per the default Ghost Trail Notify, however is specifically for classes that derive from the Ghost Trail Material Parameters class and as such provides the option to change the material parameter used.
This notify behaves as per the default Ghost Trail Notify, however is specifically for classes that derive from the Ghost Trail Custom Data class and as such provides the option to change the primitive custom data index used.
Included with the plugin are 3 example materials to help you get started along with instances and adjustable parameters.
A simple outline effect that provides parameters for the opacity, colour and emissive strength.
A holographic effect with a large amount of customisability, from the amount of lines, wether to use dots, colours along with scanlines, opacity and a world position offset based pulse.
A ghostly mist style effect with parameters allowing for change of colour, opacity scrolling speeds and the texture used.