pub const DOORWAY: &str = "// Port of gl-transitions/transitions/doorway.glsl\n// Author: gre\n// License: MIT\n// alpha2: the opaque black floor is `back_color`, the reflection is composited over it\n// premultiplied, and the door and frame edges are antialiased.\n\nfn doorway_project(p: vec2f) -> vec2f {\n return p * vec2f(1.0, -1.2) + vec2f(0.0, -0.02);\n}\n\nfn gl_transition(p: vec2f) -> vec4f {\n let middle_slit = 2.0 * abs(p.x - 0.5) - progress();\n // Upstream sets the door\'s point only where the slit is open; both doors are\n // computed everywhere here so their derivatives are.\n var door = p + select(1.0, -1.0, p.x > 0.5) * vec2f(0.5 * progress(), 0.0);\n let d = 1.0 / (1.0 + params.perspective * progress() * (1.0 - middle_slit));\n door.y = (door.y - d / 2.0) * d + d / 2.0;\n let size = mix(1.0, params.depth, 1.0 - progress());\n let next = (p + vec2f(-0.5, -0.5)) * vec2f(size, size) + vec2f(0.5, 0.5);\n let floor_point = doorway_project(next);\n let door_w = fwidthFine(door);\n let next_w = fwidthFine(next);\n let door_in = builtin_aa_step(0.0, middle_slit) * builtin_interval_coverage(door.x, door_w.x)\n * builtin_interval_coverage(door.y, door_w.y);\n let next_in = builtin_interval_coverage(next.x, next_w.x) * builtin_interval_coverage(next.y, next_w.y);\n let floor_in = builtin_interval_coverage(floor_point.x, next_w.x)\n * builtin_interval_coverage(floor_point.y, next_w.y * 1.2);\n let reflected = gl_to_color(floor_point) * (params.reflection * (1.0 - floor_point.y) * floor_in);\n let floor_color = builtin_over(builtin_valid(reflected), builtin_premultiply(params.back_color));\n let doors = mix(mix(floor_color, gl_to_color(next), next_in), gl_from_color(door), door_in);\n return builtin_valid(doors);\n}\n";Expand description
Doors opening onto the incoming picture transition body.