 
 const float BASE = 255.0;
 const float OFFSET = BASE * BASE / 2.0;
+const float RESTITUTION = 0.25;
 
 float decode(vec2 channels) {
     return (dot(channels, vec2(BASE, BASE * BASE)) - OFFSET) / scale;

        p.x = mod(p.x + random * 10.0, worldsize.x);
    }
    if (length(obstacle) > 0.5) {
        if (length(v) < 0.5) {
            p.y += worldsize.y; // dislodge
            p.x += random;
        } else {
            p.x -= v.x * 2.0;
            p.y -= v.y * 2.0;
        }
    }
}


        v.y = 0.0;
    }
    if (length(obstacle) > 0.5) {
        if (length(v) < 0.5) {
            v = obstacle * 0.5;
        } else {
            v = reflect(v, obstacle) * RESTITUTION;
        }
    }
}

