         {
             hit.hit = true;
             float d = 0.001;
+            hit.meshId = meshId;
             /* vec3 du = displace( vec3(pos.x + d, pos.y, pos.z) ) - displace( vec3(pos.x - d, pos.y, pos.z) ); */
             /* vec3 dv = displace( vec3(pos.x, pos.y, pos.z + d) ) - displace( vec3(pos.x, pos.y, pos.z - d) ); */
             /* normal = cross( normalize( dv ), normalize( du ) ); */

    float distance;
    vec3 normal;
    vec3 color;
};

void mindistSphere(vec3 spherePos, float sphereSize, bool deform, vec3 pos, inout HitInfo hit)
{
    vec3 localSpherePos = pos - spherePos;
    if( deform )
    {

            {
                vec3 vispos = pos + hit.normal * 0.5 * float(i);
                /* float d = mindist( vispos, hit, dummyNormal, dummyColor ); */
                mindist( hit.meshId, vispos, dummyHit );
                float occl = clamp( dummyHit.distance, 0.0, 1.0 );
                vis += occl / float(i+1);
                maxvis += 1.0 / float(i+1);
