 		shadowRay.isActive = AT_NAME::scene::hitLight(
 			isHit, 
 			&light,
-			path.lightPos,
+			shadowRay.lightPos,
 			shadowRay, 
 			AT_MATH_EPSILON, AT_MATH_INF, 
 			&rec);
 
 		if (shadowRay.isActive) {
-			path.contrib += path.lightcontrib;
+			path.contrib += shadowRay.lightcontrib;
 		}
 	}
 }

		aten::hitrecord rec;
		bool isHit = intersectBVH(&ctxt, shadowRay, AT_MATH_EPSILON, AT_MATH_INF, &rec);

		auto light = ctxt.lights[path.targetLightId];
		if (light.object.idx >= 0) {
			light.object.ptr = &ctxt.shapes[light.object.idx];
		}

		auto lightobj = sampleres.obj;

		auto dirToLight = normalize(sampleres.dir);

		auto cosShadow = dot(orienting_normal, dirToLight);

