Created
October 12, 2019 02:18
-
-
Save me2beats/f6a3686b67c58ffec6453e4aae70cd6a to your computer and use it in GitHub Desktop.
Wipe transition (kivy)
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
from kivy.uix.screenmanager import ShaderTransition | |
from kivy.properties import StringProperty | |
class MyWipeTransition(ShaderTransition): | |
'''Wipe transition, based on a fragment Shader. | |
''' | |
WIPE_TRANSITION_FS = '''$HEADER$ | |
uniform float t; | |
uniform sampler2D tex_in; | |
uniform sampler2D tex_out; | |
void main(void) { | |
vec4 cin = texture2D(tex_in, tex_coord0); | |
vec4 cout = texture2D(tex_out, tex_coord0); | |
gl_FragColor = mix(cout, cin, step(1., tex_coord0.x+t) ); | |
} | |
''' | |
fs = StringProperty(WIPE_TRANSITION_FS) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wipe transition.
imo, blurring (blending?) the edges of textures (what the default wipe transition does) is old-fashioned.
So i fixed it