Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <math_constants>
- #include <multisample>
- const int SIZE = 480;
- param int SAMPLES = 3 : logrange(1, 16);
- param float RPM = 60 : logrange(1, 10000);
- param float shutterDelay;
- glsl float spinner(vec2 pos, float rotation) {
- float r = length(pos);
- float a = atan(-pos.y, pos.x)-rotation;
- float t = max(0.5+0.5*sin(3.0*a), 0.1875);
- return step(0.125, r)-step(t, r);
- }
- glsl vec4 rollingShutter(vec2 p) {
- float rowTime = shadron_Time+(0.5-p.y)*shutterDelay;
- float angle = TAU/60.0*RPM*rowTime;
- float fill = spinner(1.0625*(2.0*p-1.0), angle);
- return vec4(vec3(1.0-0.8375*fill), 1.0);
- }
- animation RollingShutter = glsl(multisample<rollingShutter, SAMPLES>, SIZE);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement