export default `float blend(const in float x, const in float y) { return (y > 0.0) ? min(x / y, 1.0) : 1.0; } vec4 blend(const in vec4 x, const in vec4 y, const in float opacity) { vec4 z = vec4(blend(x.r, y.r), blend(x.g, y.g), blend(x.b, y.b), blend(x.a, y.a)); return z * opacity + x * (1.0 - opacity); } `