-
-
Save gre/8609062 to your computer and use it in GitHub Desktop.
This file contains 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
#ifdef GL_ES | |
precision highp float; | |
#endif | |
// General parameters | |
uniform sampler2D from; | |
uniform sampler2D to; | |
uniform float progress; | |
uniform vec2 resolution; | |
uniform vec3 color; | |
uniform float colorPhase; // if 0.0, there is no black phase, if 0.9, the black phase is very important | |
void main() { | |
vec2 p = gl_FragCoord.xy / resolution.xy; | |
gl_FragColor = mix(mix(vec4(color, 1.0), texture2D(from, p), smoothstep(1.0-colorPhase, 0.0, progress)), | |
mix(vec4(color, 1.0), texture2D(to, p), smoothstep( colorPhase, 1.0, progress)), progress); | |
} |
This file contains 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
{ "color": [0,0,0], "colorPhase": 0.5 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment