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
#define EPSILON 0.001 | |
precision mediump float; | |
uniform float time; | |
uniform vec2 resolution; | |
uniform vec2 mouse; | |
uniform sampler2D backbuffer; | |
vec2 uv2p(vec2 uv) {return ((uv*resolution) * 2. - resolution) / min(resolution.x, resolution.y);} | |
vec2 p2uv(vec2 p) {return ((p*min(resolution.x, resolution.y))+resolution)/(2.*resolution);} |
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
#define EPSILON 0.001 | |
precision mediump float; | |
uniform float time; | |
uniform vec2 resolution; | |
uniform vec2 mouse; | |
uniform sampler2D backbuffer; | |
vec2 uv2p(vec2 uv) {return ((uv*resolution) * 2. - resolution) / min(resolution.x, resolution.y);} | |
vec2 p2uv(vec2 p) {return ((p*min(resolution.x, resolution.y))+resolution)/(2.*resolution);} |
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
whenmodr speeds numerators denominators modifier pattern -- applies the modifier to the pattern serially and conditionally, multiple times, dependent on the supplied speeds and whenmod parameters | |
| done = modifiedpattern | |
| otherwise = whenmodr rests restn restd modifier modifiedpattern | |
where modifiedpattern = inside speed (whenmod numerator denominator (modifier)) $ pattern | |
numerator = (head numerators) | |
denominator = (head denominators) | |
speed = (head speeds) | |
done = (null $ tail speeds) && (null $ tail numerators) && (null $ tail denominators) | |
restn = if null (tail numerators) then [numerator] else (tail numerators) | |
restd = if null (tail denominators) then [denominator] else (tail denominators) |