Skip to main content

ROTATE

Constant ROTATE 

Source
pub const ROTATE: &str = "// Port of gl-transitions/transitions/rotateTransition.glsl\n// Author: haiyoucuv\n// License: MIT\n// alpha2: pi to f32 precision rather than upstream\'s 3.1415926.\nconst ROTATE_PI = 3.14159265358979;\n\nfn gl_transition(uv: vec2f) -> vec4f {\n    let angle = progress() * ROTATE_PI * 2.0;\n    let c = cos(angle);\n    let s = sin(angle);\n    // Upstream\'s row vector times mat2(c, -s, s, c).\n    let v = uv - 0.5;\n    let p = fract(vec2f(v.x * c - v.y * s, v.x * s + v.y * c) + 0.5);\n    return mix(gl_from_color(p), gl_to_color(p), progress());\n}\n";
Expand description

Spinning, tiled cross-fade transition body.