  distance=minDistance;
  return minIndex;
 }
-
-
-
+/*
+EAVL_HOSTDEVICE float intersectSphereDist(eavlVector3 rayDir, eavlVector3 rayOrigin, float4 sphere)
+{
+    float a  = rayDir.x*rayDir.x    + rayDir.y*rayDir.y    + rayDir.z*rayDir.z;
+    float b  = rayOrigin.x*rayDir.x + rayOrigin.y*rayDir.y + rayOrigin.z*rayDir.z;
+    float cc = rayOrigin*rayOrigin  + rayOrigin*rayOrigin  + rayOrigin*rayOrigin - sphere.w*sphere.w;
+    b*=2.f;
+    float d = b*b - 4.f*a*c;
+
+
+}
+*/
 EAVL_HOSTDEVICE float getIntersectionDepth(const eavlVector3 rayDir, const eavlVector3 rayOrigin, bool occlusion, const eavlConstArrayV2<float4> &bvh,const eavlConstArrayV2<float> &tri_bvh_lf_raw,eavlConstArrayV2<float4> &verts,const float &maxDistance)
 {
 

    scene->addSphere(5.f, 22, 5,0,0);
    scene->addSphere(5.f, 22, 33,0,0);

    scene->addSphere(1.f, 1, 1,0,0);
    scene->addSphere(2.f, 10, .5,0);




}


EAVL_HOSTDEVICE int getIntersectionSphere(const eavlVector3 rayDir, const eavlVector3 rayOrigin, bool occlusion, const eavlConstArrayV2<float4> &bvh,const eavlConstArrayV2<float> &bvh_lf,eavlConstArrayV2<float4> &verts,const float &maxDistance, float &distance)
{


