anchor.diff:    return createNode(index);
   }
   
  +float nearChildIndex(Node node, Ray ray){
  +  uint axis = uint(node.split);
  +  float index = ray.dir[axis] > 0.0 ? node.left : node.right;
  +  return index;
  +}
  +
   Node farChild(Node node, Ray ray){
     uint axis = uint(node.split);
     float index = ray.dir[axis] <= 0.0 ? node.left : node.right;
     return createNode(index);
  +}
  +
  +float farChildIndex(Node node, Ray ray){
  +  uint axis = uint(node.split);
  +  float index = ray.dir[axis] <= 0.0 ? node.left : node.right;
  +  return index;
   }
   
   
  
positive.code: 	return weights.x * normals.n1 + weights.y * normals.n2 + weights.z * normals.n3;
  }
  
  Hit traverseTree(Ray ray){
    uint state = FROM_PARENT;
  	Hit result = Hit(max_t, -1.0);
  	Hit temp;
    Node current = nearChild(createNode(0.0), ray);
    while(true){
      if(state == FROM_CHILD){
  
negative.code:         return result;
        }
        Node parentNear = nearChild(createNode(current.parent), ray);
        bool atNear = current.index == parentNear.index;
        current = createNode(atNear ? current.sibling : current.parent);
        state = atNear ? FROM_SIBLING : FROM_CHILD;
      } else {
        bool fromParent = state == FROM_PARENT;
        uint nextState = fromParent ? FROM_SIBLING : FROM_CHILD;
        float nextIndex = fromParent ? current.sibling : current.parent;
        if(rayBoxIntersect(current, ray) >= result.t){
          // missed box
        } else if (current.triangles > -1.0) {
          // at leaf
          processLeaf(current, ray, result);
        } else {
          nextIndex = nearChildIndex(current, ray);
          nextState = FROM_PARENT;
        }
        current = createNode(nextIndex);
        state = nextState;
      }
    }
  }
  