Back to shaders
Shader test bench
Cannabisleaf
runnable transition
GLSL transition function. Stronghold supplies two demo textures and progress/time uniforms.
Code
// Author: @Flexi23
// License: MIT
// inspired by http://www.wolframalpha.com/input/?i=cannabis+curve
vec4 transition (vec2 uv) {
if(progress == 0.0){
return getFromColor(uv);
}
vec2 leaf_uv = (uv - vec2(0.5))/10./pow(progress,3.5);
leaf_uv.y += 0.35;
float r = 0.18;
float o = atan(leaf_uv.y, leaf_uv.x);
return mix(getFromColor(uv), getToColor(uv), 1.-step(1. - length(leaf_uv)+r*(1.+sin(o))*(1.+0.9 * cos(8.*o))*(1.+0.1*cos(24.*o))*(0.9+0.05*cos(200.*o)), 1.));
}