1234567891011121314151617181920212223242526272829303132333435 |
- #version 120
- uniform sampler2D leavingSlideTexture;
- uniform sampler2D enteringSlideTexture;
- uniform float time;
- varying vec2 v_texturePosition;
- void main() {
- #ifdef use_white
- vec4 color = vec4(1.0, 1.0, 1.0, 1.0);
- #else
- vec4 color = vec4(0.0, 0.0, 0.0, 1.0);
- #endif
- vec4 texel;
- float amount;
- if (time < 0.5) {
- texel = texture2D(leavingSlideTexture, v_texturePosition);
- amount = time * 2;
- } else {
- texel = texture2D(enteringSlideTexture, v_texturePosition);
- amount = (1.0 - time) * 2;
- }
- gl_FragColor = mix(texel, color, amount);
- }
|