                                              RayIntersectFunctor(vertsTex,bvhTex,bvhLeafsTex,TRIANGLE)),
                                                                                                     "intersect");
     eavlExecutor::Go();
-    //for( int i=0; i<size; i++) cout<<primitiveTypeHit->GetValue(i)<<" ";
+
+
+    eavlExecutor::AddOperation(new_eavlMapOp(eavlOpArgs(hitIdx),                /*On primary ray: hits some in as -2, and leave as -1 if it misses everything*/
+                                             eavlOpArgs(hitIdx),                /*This allows dead rays to be filtered out on multiple bounces */
+                                             HitFilterFunctor()),
+                                             "Hit Filter");
+    eavlExecutor::Go();
+}
+
+void eavlRayTracerMutator::occlusionIntersect()
+{
+    eavlExecutor::AddOperation(new_eavlMapOp(eavlOpArgs(localHits), //dummy arg
+                                             eavlOpArgs(localHits),
+                                             FloatMemsetFunctor(0.f)),
+                                             "memset");
+    eavlExecutor::Go();
+
+    eavlExecutor::AddOperation(new_eavlMapOp(eavlOpArgs(eavlIndexable<eavlFloatArray>(occX),
+                                                        eavlIndexable<eavlFloatArray>(occY),
+                                                        eavlIndexable<eavlFloatArray>(occZ),
+                                                        eavlIndexable<eavlFloatArray>(interX, *occIndexer),
+                                                        eavlIndexable<eavlFloatArray>(interY, *occIndexer),
+                                                        eavlIndexable<eavlFloatArray>(interZ, *occIndexer),
+                                                        eavlIndexable<eavlIntArray>  (hitIdx, *occIndexer),
+                                                        eavlIndexable<eavlFloatArray>(localHits)),
+                                             eavlOpArgs(localHits),
+                                             occIntersectFunctor(vertsTex,bvhTex,bvhLeafsTex,aoMax, TRIANGLE)),
+                                             "occIntercept");
+            
+    eavlExecutor::Go();
 }
 
 void eavlRayTracerMutator::Execute()

        minHit = getIntersectionTri(ray, rayOrigin, false,bvh,bvhLeafs, verts,maxDistance,distance);
    
        if(minHit!=-1) return tuple<int,float,int>(minHit, distance, TRIANGLE);
        else           return tuple<int,float,int>(-1, INFINITE, get<7>(rayTuple));
    }
};


    // /eavlConstArray<float> bvh;
    eavlConstArrayV2<float4> bvh;
    eavlConstArrayV2<float> bvhLeafs;
    primitive_t primitiveType;


    occIntersectFunctor(eavlConstArrayV2<float4> *_verts, eavlConstArrayV2<float4> *theBvh, eavlConstArrayV2<float> *theBvhLeafs, float max, primitive_t _primitveType)
        :verts(*_verts),
         bvh(*theBvh),
         bvhLeafs(*theBvhLeafs),
         primitiveType(_primitveType)
    {

        maxDistance=max;
        
    }                                                   
    EAVL_FUNCTOR tuple<float> operator()( tuple<float,float,float,float,float,float,int, float> rayTuple){
        
        int deadRay=get<6>(rayTuple);//hack for now leaving this in for CPU
        bool alreadyOccluded= get<7>(rayTuple) > 0 ? true : false;
        if(deadRay==-1)     return tuple<float>(0.0f);
        if(alreadyOccluded) return tuple<float>(1.f);
        int minHit=-1;   
        float distance;
        eavlVector3 intersect(get<3>(rayTuple),get<4>(rayTuple),get<5>(rayTuple));
