Created
December 12, 2020 02:52
-
-
Save CharStiles/9802ef698f85206fc55be463eb3ba02f 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
// to see this function graphed out go to: https://www.desmos.com/calculator/rz7abjujdj | |
vec3 cosPalette( float t ) | |
{ | |
// please play around with these numbers to get a better palette | |
vec3 brightness = vec3(0.3); | |
vec3 contrast = vec3(0.5); | |
vec3 osc = vec3(0.5,1.0,0.0); | |
vec3 phase = vec3(0.4,0.9,0.2); | |
return brightness + contrast*cos( 6.28318*(osc*t+phase) ); | |
} | |
void main () { | |
vec2 pos = uvN(); | |
vec4 webcam = texture2D(channel0, pos ); | |
vec4 bb = texture2D(backbuffer, pos* vec2(1.01)); | |
vec3 cosPal = cosPalette(webcam.r); | |
vec4 color = mix(bb,vec4(cosPal,1.), 1.-webcam); | |
gl_FragColor = color; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment