Skip to content

Instantly share code, notes, and snippets.

@nthState
Created April 15, 2018 19:33
Show Gist options
  • Save nthState/702157a23918643a8ada7ccbcafd8d33 to your computer and use it in GitHub Desktop.
Save nthState/702157a23918643a8ada7ccbcafd8d33 to your computer and use it in GitHub Desktop.
Marching Ants
/**
Drag marching ants on SKShapeNode stroke
https://stackoverflow.com/questions/16838907/drawing-marching-ants-using-directx
*/
void main() {
float w = ((int)(v_tex_coord.x + v_tex_coord.y + (u_time*4)) % 8);
gl_FragColor = (w < 4 ? vec4(1,1,1,0) : vec4(0.48,0.84,0.99,1));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment