 						// TODO
 						// Only sphere...
 						//isHit = intersectShape(s, nullptr, ctxt, r, t_min, t_max, &recTmp, &recOptTmp);
-						isHit = hitSphere(s, nullptr, ctxt, r, t_min, t_max, &recTmp, &recOptTmp);
+						recTmp.t = AT_MATH_INF;
+						hitSphere(s, nullptr, ctxt, r, t_min, t_max, &recTmp, &recOptTmp);
 						recTmp.mtrlid = s->mtrl.idx;
 					}
 
-					if (isHit) {
-						if (recTmp.t < hitt) {
-							hitt = recTmp.t;
-							*exid = tmpexid;
-							*shapeid = tmpshapeid;
-						}
-						if (tmpexid < 0) {
-							if (recTmp.t < rec->t) {
-								*rec = recTmp;
-								*recOpt = recOptTmp;
-								rec->obj = (void*)s;
-							}
+					if (recTmp.t < hitt) {
+						hitt = recTmp.t;
+						*exid = tmpexid;
+						*shapeid = tmpshapeid;
+					}
+					if (tmpexid < 0) {
+						if (recTmp.t < rec->t) {
+							*rec = recTmp;
+							*recOpt = recOptTmp;
+							rec->obj = (void*)s;
 						}
 					}
 				}

					}
				}
				else {
					isHit = false;
					tmpexid = -1;

					const auto* s = &ctxt->shapes[(int)attrib.x];

					if (attrib.w >= 0) {	// exid
						t = AT_MATH_INF;
						isHit = intersectAABB(&bvhray, aabb, t);
						recTmp.t = t;
						tmpexid = attrib.w;
					}
#if 0

			boxmax = aten::make_float3(_boxmax.x, _boxmax.y, _boxmax.z);

			if (node.x < 0 && node.y < 0) {
				const auto* s = &ctxt->shapes[(int)attrib.x];
				const aten::ShapeParameter* realShape = (s->shapeid >= 0 ? &ctxt->shapes[s->shapeid] : s);

				const auto& prim = ctxt->prims[(int)attrib.y];

				recTmp.t = AT_MATH_INF;
				hitTriangle(realShape, &prim, ctxt, r, t_min, t_max, &recTmp, &recOptTmp);
				recTmp.mtrlid = prim.mtrlid;

				if (recTmp.t < rec->t) {
