     return true;
 }
 
+float dist(in vec3 position, in int sphere)
+{
+    return sqrt(    pow(blobs[sphere].position.x - position.x, 2) +
+                    pow(blobs[sphere].position.y - position.y, 2) +
+                    pow(blobs[sphere].position.z - position.z, 2)) - blobs[sphere].radius;
+}
+
+float energy(in vec3 point, in int sphere)
+{
+    return smoothstep(blobs[blobs[sphere].radius, blobs[blobs[sphere].radius*2, dist(point, sphere));
+}
+
 bool nearestDistance(in vec3 position, out float t)
 {
     t = INFINITY;

	return (t < INFINITY);
}

bool hitSphere(in vec3 position, out int sphere)
{
    float t;

    for(int i = 0; i < SIZE; ++i)
	{
        if(getDistance(position, i, t) && (t <= 0.003))
        {
            sphere = i;
            return true;
        }
	}
    return false;
}

bool trace(in Ray ray, out vec3 normal, out Material material, out float t)


Sphere blobs[16];
Material materials[16];
int spheresHit[16];
int hitcount;

void cache(
	sampler2D positions
