Created
July 12, 2020 17:48
-
-
Save CharStiles/f2121d97c055752c4d332f1cfe0ce1ce to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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