 }
 
 
-EAVL_HOSTDEVICE int getIntersectionSphere(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, float &distance)
+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)
 {
 
 

 distance=minDistance;
 return minIndex;
}



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)
{


    for(int i=0; i< size; i++)
    {
        maxDepth= max(depthBuffer->GetValue(i), maxDepth);  
        minDepth= max(0.f,min(minDepth,depthBuffer->GetValue(i)));//??
    } 
    //for(int i=0; i< size; i++) cout<<depthBuffer->GetValue(i)<<" ";
    maxDepth=maxDepth-minDepth;
    for(int i=0; i< size; i++) depthBuffer->SetValue(i, (depthBuffer->GetValue(i)-minDepth)/maxDepth);
    
    eavlExecutor::AddOperation(new_eavlScatterOp(eavlOpArgs(depthBuffer),
                                                 eavlOpArgs(d),
