24 lines
848 B
Plaintext
24 lines
848 B
Plaintext
init python:
|
|
renpy.register_shader("doom.melt", variables="""
|
|
uniform sampler2D tex0;
|
|
uniform float u_custom_time;
|
|
|
|
attribute vec2 a_tex_coord;
|
|
varying vec2 v_tex_coord;
|
|
|
|
""", fragment_300="""
|
|
vec2 p = v_tex_coord.xy;
|
|
|
|
//melt ahead of time then shift it forward as the player won't see it
|
|
|
|
p.x += -0.275 + (0.35 * fract(sin(dot(vec2(p.y, 0.0), vec2(10.0)))*1000.0));
|
|
p.x += -0.275 + (0.35 * (u_custom_time-1.0));
|
|
|
|
//draw 'transparent' if it melted or not
|
|
if (p.x > 1.0) {
|
|
gl_FragColor = vec4(0.0);
|
|
} else {
|
|
gl_FragColor = mix(vec4(vec3(0.0), 1.0), texture2D(tex0, p.xy), p.x/1.0);
|
|
}
|
|
""")
|