Skip to content

Instantly share code, notes, and snippets.

@CharStiles
Created July 12, 2020 17:48
Show Gist options
  • Save CharStiles/f2121d97c055752c4d332f1cfe0ce1ce to your computer and use it in GitHub Desktop.
Save CharStiles/f2121d97c055752c4d332f1cfe0ce1ce to your computer and use it in GitHub Desktop.
void main () {
// we put the pixel coordinates in a variable for easy access
vec2 pos = uvN();
// here we get the webcam texture from channel0 which we assigned in the texture
// panel (the lil gradient icon)
// we use the pixel coordinates to grab the right pixel
vec4 web =texture2D(channel0,pos);
// here we just add the pixels postition as a color, just for fun
// here vec4(pos,pos) is shorthand for vec4(pos.x,pos.y,pos.x,pos.y)
vec4 col = web + vec4(pos,pos);
gl_FragColor = col ;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment