         if(currentNode>-1)
         {
 
-            float4 n1=bvh.getValue(bvhInnerTexRef, currentNode  ); //(txmin0, tymin0, tzmin0, txmax0)
-            float4 n2=bvh.getValue(bvhInnerTexRef, currentNode+1); //(tymax0, tzmax0, txmin1, tymin1)
-            float4 n3=bvh.getValue(bvhInnerTexRef, currentNode+2); //(tzmin1, txmax1, tymax1, tzmax1)
+            float4 n1=bvh.getValue(tri_bvh_in_tref, currentNode  ); //(txmin0, tymin0, tzmin0, txmax0)
+            float4 n2=bvh.getValue(tri_bvh_in_tref, currentNode+1); //(tymax0, tzmax0, txmin1, tymin1)
+            float4 n3=bvh.getValue(tri_bvh_in_tref, currentNode+2); //(tzmin1, txmax1, tymax1, tzmax1)
             
             float txmin0 =   n1.x* invDirx -odirx;       
             float tymin0 =   n1.y* invDiry -odiry;         

    
    if(numMats==0) { cerr<<"NO MATS bailing"<<endl; exit(0); }

    bvhTex      = new eavlConstArrayV2<float4>((float4*)bvhFlatArray_raw, bvhsize/4,bvhInnerTexRef);
    bvhLeafsTex = new eavlConstArrayV2<float>(bvhLeafs, bvhLeafSize,bvhLeafTexRef);
    vertsTex    = new eavlConstArrayV2<float4>((float4*)verts_raw,numTriangles*3, vertsTexRef);


    INIT(eavlConstArray<float>, mats,numMats*12);

        if(currentNode>-1)
        {

            float4 n1=bvh.getValue(tri_bvh_in_tref, currentNode  ); //(txmin0, tymin0, tzmin0, txmax0)
            float4 n2=bvh.getValue(tri_bvh_in_tref, currentNode+1); //(tymax0, tzmax0, txmin1, tymin1)
            float4 n3=bvh.getValue(tri_bvh_in_tref, currentNode+2); //(tzmin1, txmax1, tymax1, tzmax1)
            
            float txmin0 =   n1.x* invDirx -odirx;       
            float tymin0 =   n1.y* invDiry -odiry;         
