lukemcraig / farkle

(WIP) A JUCE-based audio plugin that recreates Bruce Botnick's "Farkle" effect, as heard on Van Dyke Parks' 1968, Song Cycle
https://github.com/lukemcraig/farkle
4 stars 0 forks source link

make debug visualizations with something other than sliders #12

Open lukemcraig opened 6 years ago

lukemcraig commented 6 years ago

#define PI 3.1415926535897932384
float circle(vec2 p,vec2 hk, float r){    
    float d = length(p-hk);
    return step(d,r);
}

void main( )
{
    vec2 resolution= vec2(1000.0,1000.0);
    vec2 uv = (gl_FragCoord - (resolution.xy*0.5))/resolution.y;

    vec3 col = vec3(0.0);
    float dwp = .25;
    float drp = dwp-0.25;
    col+=vec3(circle(vec2(cos(drp*2.0*PI),sin(drp*2.0*PI))*.3,uv, 0.03),0.0,0.0);

    col+=vec3(0.0,circle(vec2(cos(dwp*2.0*PI),sin(dwp*2.0*PI))*.3,uv, 0.03),0.0);

    // Output to screen
    gl_FragColor = vec4(col,1.0);
}