Outline effect Unity 3D – Color Transition Package
We finally got it!
Our outline is an image effect designed to be extremely cheap and mobile friendly.
It uses just two simple shaders and 2 blit operations!
We are very proud of the result!
In the last screenshot we were showing an early working result, but we’ve soon discovered an hateful bug occurring for moving objects: the render texture was looking corrupted, and an odd trail was shown along the trajectories of the moving objects.
We couldn’t explain why it was not working correctly.
We supposed that for any reason, a render texture was corrupted when blit was done…
After MANY tests, we finally figured it!
It was NOT a render texture issue… it was just about blending!
In the first shader we use to draw the colored outline, we have set – WITH ABSOLUTELY NO REASON – the blending mode to
Blend SrcAlpha OneMinusSrcAlpha
the tipical blending mode used for additive effects, like particle systems.
Now we have just switched it to
and magically everything works fine.
Here it’s the good result