Manual
Afterimage
Add Pass Forge Afterimage to an object to leave fading ghosts behind it as it moves.
| Setting | What it does |
|---|---|
| Space | World records each ghost where the object stood and draws it there, so a camera can move and turn around them. Screen keeps them on the picture, which is what a continuous smear needs. Sprite Renderers follow it too, 2D Animation skinning included, so in World a 2D camera following a character leaves the trail behind in the level. Sliced or tiled sprites and Spine skeletons always leave their ghosts on the picture. A skinned mesh leaves World ghosts in a build only with Read/Write on in its model's import settings; without it, its ghosts stay on the picture, the Console says so once, and the inspector offers Turn On Read/Write. |
| Color | Ghost color. Alpha sets how strongly ghosts show; HDR values feed bloom. |
| Blend | Additive glows on top of the picture, Tint paints the ghosts in a solid color. |
| Hue Cycle Speed | Turns around the color wheel per second, for rainbow ghosts. Needs a colored rather than a white or gray Color. |
| Fade Time | Seconds until a ghost has faded to half. |
| Stamp Interval | Seconds between ghosts. Zero leaves a continuous smear. |
| Min Stamp Distance | How far the object must move before it leaves another ghost, so a still object does not keep stamping. |
| Rim, Rim Power | Fade the middle of each ghost so its edges stand out. |
| Hide Under Object | Hide ghosts where the object currently is, so they trail behind it. |
| Include Children | Also leave ghosts of child renderers. |
Space decides where the ghosts live, and it is the setting to get right for a third person game.
World, the default, records the object as it stands: the mesh of a Mesh Renderer with its transform, the pose of a Skinned Mesh Renderer baked into a mesh of its own, and the shape of a Sprite Renderer with its flip, bent by its 2D Animation bones as they stand. Each ghost is then drawn at that place for as long as it lasts, so a camera following a running character leaves the ghosts behind it in the world, and turning the camera moves around them rather than dragging them along. Where they overlap, the ghost that shows most wins the pixel, so the trail fades evenly whichever way the object runs.
Up to 16 ghosts are kept per object, each a copy of the pose it recorded. A Stamp Interval too short to fit the whole fade into that budget is stretched to fit, so the trail ends by fading out rather than being cut off. Recording a skinned pose, or a sprite bent by bones, costs a little CPU and a mesh's worth of memory per ghost, so a crowd of skinned characters with short Stamp Intervals is worth measuring.
Screen keeps the ghosts in a screen sized history, one per camera, the way a smear needs: each stamp is laid into the picture and the whole history fades. A moving camera carries them along. Spine skeletons always leave their ghosts this way, because Spine rebuilds a skeleton's mesh every frame, and so do sliced or tiled sprites, whose shape the Sprite Renderer makes itself.
PassForgeAfterimage.ClearAll() drops every ghost, in the world and on screen, which suits a camera cut or a teleport.
Shipped afterimage presets: Speed Ghosts, Shadow Clones, Energy Smear, Motion Echo, Rainbow Dash, Fire Trail, Ninja Vanish, Phantom, Frozen Echo and Speed Smear. Energy Smear, Fire Trail and Speed Smear are continuous smears and come set to Screen; the rest stand in the world. Apply them from the presets window's Objects tab or from the Preset menu in the Afterimage inspector.