Skip to content

Instantly share code, notes, and snippets.

@molotovbliss
Created October 2, 2018 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save molotovbliss/eb5871de8dbc32dc9d1e2f1cafe1d924 to your computer and use it in GitHub Desktop.
Save molotovbliss/eb5871de8dbc32dc9d1e2f1cafe1d924 to your computer and use it in GitHub Desktop.
a Readable Space Invader Shader from shadertoy.com/view/ldcXD2
// Formatted for human reading: Space invader shader
// sauce: https://www.shadertoy.com/view/ldcXD2
void mainImage(out vec4 o, vec2 d) {
float t = iTime;
o += 1. - o + fract(
.3 * t);
d *= .03;
for (int i = 0, y; i
++ < 5;) o *= 1. > mod(((y = int(mod(
t - d.y / o, 14.))) > 3 ? 35552534e8 : 56869384.) / exp2(
float(y * 7 + int(abs(mod(d.x / o - 7. * cos(t), 14.) - 7.)))), 2.) ? .5 : 1.;
o.z *= 2.;
}
// ORIGINAL:
// Created by Sebastien Durand - 2018
// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
//// ////
//// ////
//// ////
void ////
mainImage(out vec4 o,vec2 d){
float t=iTime; o+=1.-o+fract(
.3*t); d *=.03;for(int i=0 ,y;i
++<5;) o *=1.>mod(((y= int(mod(
t-d.y/o,14.)))>3? 35552534e8:56869384.)/exp2(
float(y*7+int(abs(mod(d.x/o-7.*cos(t),14.)-7.
)))) ,2.)?.5:1.;o.z*=2.;}///////// ////
//// ///////////////////////////// ////
//// //// //// ////
//// //// //// ////
//////// ////////
//////// ////////
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment