Skip to content

Instantly share code, notes, and snippets.

@Iainmon
Created March 29, 2021 07:33
Show Gist options
  • Select an option

  • Save Iainmon/d02b02e2a698876e2d54bfeaebf500e6 to your computer and use it in GitHub Desktop.

Select an option

Save Iainmon/d02b02e2a698876e2d54bfeaebf500e6 to your computer and use it in GitHub Desktop.
#include "lib/runtime.glsl"
float sierpinski(int x, int y) {
return (x & y) == 0 ? 0.0 : 1.0;
}
void program(inout vec3 color) {
vec2 pos = gl_FragCoord;
float pixel = sierpinski(int(pos.x), int(pos.y));
color = vec3(pixel);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment