 
 					if (attrib.w >= 0) {	// exid
 						isectTmp.t = AT_MATH_INF;
-						isHit = intersectAABB(&bvhray, aabb, isectTmp.t);
+						//isHit = intersectAABB(&bvhray, aabb, isectTmp.t);
+						isHit = aten::aabb::hit(r, boxmin, boxmax, t_min, t_max, &isectTmp.t);
 						tmpexid = attrib.w;
 					}
 #if 0

			aabb[0] = tex1Dfetch<float4>(nodes, 4 * nodeid + 2);
			aabb[1] = tex1Dfetch<float4>(nodes, 4 * nodeid + 3);

			if (node.x < 0 && node.y < 0) {
				if (attrib.z >= 0) {
					if (intersectAABB(&bvhray, aabb, t)) {
						stackbuf[stackpos++] = (int)attrib.z;
						tmpshapeid = (int)attrib.x;
					}

		auto mtxW2L = ctxt->matrices[param.mtxid * 2 + 1];

		aten::ray transformedRay;
		transformedRay.dir = mtxW2L.applyXYZ(r.dir);
		transformedRay.dir = normalize(transformedRay.dir);
		transformedRay.org = mtxW2L.apply(r.org) + AT_MATH_EPSILON * transformedRay.dir;

		if (intersectBVH(ctxt->nodes[c.exid], ctxt, transformedRay, t_min, t_max, &isectTmp)) {
			if (isectTmp.t < isect->t) {
