4

I'm trying to draw previous frame of animation on screen

you can see this effect here: https://youtu.be/WNL_KJNl6pU

Mortal Combat X (left) , Street Fighter Alpha 2 (right):

Johnny slides in to land a hit, leaving behind a glowing green trail that looks like multiple instances of himself Cammy jumps up to kick, and leaves behind previous visible ghosts of herself

This effect also found in animation software and called onion skinning:

a deer's gallop

I've implemented this by spawning object every second but I think It is possible with shader.


Update

I could make this effect by using RenderTexture for capturing previous frame , but I can't remove background color :(

I tried with Blending and grab pass but don't work(it was rendered normally)!!

sources :

https://github.com/smkplus/TrailingFX

https://unitylist.com/r/4tp/unity-fluid-2d-blur-image-effect

several dozen 3D models in a trailing line

Seyed Morteza Kamali
  • 8,333
  • 12
  • 50
  • 84

1 Answers1

2

I would solve this using post processing. You find some way to mask out your ghosting objects (stencil buffer, render layers, w/e) then create a compositing PP effect that combines the current render with the previous renders at a lower opacity. Since you're just pasting new information on top of the old render, you can stack all the previous renders in one texture. This is essentially onion skinning.

You would control how many "ghosts" get displayed based on how quickly you decrease your opacity.

The quick proof of concept I made looks like this (they already faded before I got the screenshot) enter image description here

Zebraman
  • 819
  • 5
  • 6