2019-12-14 21:06:12 +00:00
|
|
|
// VERTEX_SHADER:
|
|
|
|
void main() {
|
|
|
|
gl_Position = u_projection * u_modelview * vec4(aPosition, 0.0, 1.0);
|
|
|
|
|
|
|
|
vUv = vec2(aUv.x, aUv.y);
|
|
|
|
}
|
2017-12-11 07:22:28 +00:00
|
|
|
|
2019-12-14 21:06:12 +00:00
|
|
|
// FRAGMENT_SHADER:
|
2017-12-11 07:22:28 +00:00
|
|
|
uniform float u_progress;
|
|
|
|
uniform sampler2D u_source2;
|
|
|
|
|
|
|
|
void main() {
|
|
|
|
vec4 source1 = Texture(u_source, vUv); // start child
|
|
|
|
vec4 source2 = Texture(u_source2, vUv); // end child
|
|
|
|
|
2019-04-24 10:56:23 +00:00
|
|
|
float p_start = (1.0 - u_progress) * u_alpha;
|
|
|
|
float p_end = u_progress * u_alpha;
|
|
|
|
vec4 color = (p_start * source1) + (p_end * source2);
|
2017-12-11 07:22:28 +00:00
|
|
|
setOutputColor(color);
|
|
|
|
}
|