Created
December 2, 2012 02:51
-
-
Save chrisdickinson/4186707 to your computer and use it in GitHub Desktop.
interleaving two fragment shaders: http://glsl.heroku.com/e#5174.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
precision highp float; | |
uniform float time; | |
uniform vec2 mouse; | |
uniform vec2 resolution; | |
#pragma glslify: balls = require(./balls, time=time, mouse=mouse, resolution=resolution) | |
#pragma glslify: sauron = require(./sauron, time=time, mouse=mouse, resolution=resolution) | |
int modulo(float x, float y) { | |
return int(x - y * floor(x / y)); | |
} | |
void main(void) { | |
ivec2 m = ivec2(modulo(gl_FragCoord.x, 2.), modulo(gl_FragCoord.y, 2.)); | |
if(m.x == 0 || m.y == 0) { | |
balls(); | |
} else { | |
sauron(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment