input1.x ? 1.0 : 0.0; amount.y = input0.y > input1.y ? 1.0 : 0.0; amount.z = input0.z > input1.z ? 1.0 : 0.0; amount.w = input0.w > input1.w ? 1.0 : 0.0; // calculate slide down float d = max(1.0, abs(slide_down)); sd = vec4(1.0 / d); down = input1 + ((input0 - input1) * sd); // calculate slide up float u = max(1.0, abs(slide_up)); su = vec4(1.0 / u); up = input1 + ((input0 - input1) * su); // mix between down and up gl_FragColor = mix(down, up, amount); } ]]>