     float energySum = 0.0f;
     for(int i = 0; i < SIZE; ++i)
     {
-//        if(sphereHit[i] == 1)
             energySum += energy(position, i);
     }
     return energySum;

    int sphere;
    Ray marchingRay = ray;

    currentStep = 1.0 ;
    float direction;
    int steps = 0;
    float nrj = 0;

    for(int i = 0; i < 30 ; i++)
    {
//        countHits(marchingRay.origin);
//        nearestDistance(marchingRay.origin, currentStep);
        marchingRay.origin += currentStep * marchingRay.direction;
        marchedDistance += currentStep;
//        countHits(marchingRay.origin);
        steps++;
        nrj = energySum(marchingRay.origin);
        if(nrj > 0.5f)
            break;
    }

    currentStep = 0.01;
//
//    if(nrj > 0.5)
//        direction = -1;
//    else
        direction = 1;

    for(int i = 0; i < 1 ; i++)
    {
        nearestDistance(marchingRay.origin, currentStep);
        marchingRay.origin += currentStep * marchingRay.direction * direction;
        marchedDistance += currentStep;
        steps++;
        if(energySum(marchingRay.origin) > 1.0f)
            break;
    }


    normal = vec3(energySum(marchingRay.origin));
    if(steps == 39)
    {
        return false;
    }
    return true;

}


float energy(in vec3 position, in int sphere)
{
    return (-1)*(smoothstep(blobs[sphere].radius, 2.5*blobs[sphere].radius, dist(position, sphere)) - 1);
//    float d = dist(position, sphere);
//    if(d > 2*blobs[sphere].radius)
//        return 0;
//
//    return -1*(d - 2*blobs[sphere].radius);
}

float energySum(in vec3 position)
