Marching Ants Sprite Outline Shader

An article by 1 Comment An article by mgear

Saw interesting question here https://forum.unity.com/threads/animated-outline-effects-using-shader.600028/

and unity sprite outline https://github.com/wlgys8/Sprites-Outline + stackoverflow https://stackoverflow.com/a/16856878/5452781 to the rescue!

(although this is for 2D sprite..)

Results:



TODO

– Test how this would look with screenspace values (to keep same size even if zoomed)

– Maybe could check neighbor pixel to get “flowing direction” for each pixel ?

Modified shader: *note: hard coded values, could put them into properties, and also download the original github project first to test.

Resources:

– wiki https://en.wikipedia.org/wiki/Marching_ants

– rectangle outline marching ants shader https://www.shadertoy.com/view/XltcR2

– 3d marching ants from uvs https://shaderfrog.com/app/view/1847

– marching ant ideas https://losingfight.com/blog/2007/08/30/an-alternate-way-to-implement-marching-ants/

– marching ants done in Flash http://www.quasimondo.com/archives/000573.php

Comparison (photoshop selection line)

