 
 						if (tmpexid >= 0) {
 							candidates[candidateNum].exid = tmpexid;
-							candidates[candidateNum].shapeid = tmpshapeid;
+							candidates[candidateNum].shapeid = (int)attrib.x;
 							candidateNum++;
 						}
 					}

			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;
					}

		isect,
		IntersectType::Closer);

	aten::ray transformedRay;
	int previd = -1;

	for(int i = 0; i < candidateNum; i++) {
		const auto& c = candidates[i];

