 		path.lightPos = posLight;
 		path.lightcontrib = aten::make_float3(0);
 
-		if (path.targetLight.attrib.isSingular || path.targetLight.attrib.isInfinite) {
+		if (light.attrib.isSingular || light.attrib.isInfinite) {
 			if (pdfLight > real(0)) {
 				// TODO
 				// WIg^[̈ɂ.


	aten::vec3 lightPos;
	aten::vec3 lightcontrib;
	aten::LightParameter targetLight;

	real pdfb;



		// TODO
		int lightidx = aten::cmpMin<int>(path.sampler.nextSample() * lightnum, lightnum - 1);
		path.targetLightId = lightidx;
		lightSelectPdf = 1.0f / lightnum;

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

		sampleLight(&sampleres, &light, path.rec.p, &path.sampler);

		const auto& posLight = sampleres.pos;
		const auto& nmlLight = sampleres.nml;
