 	aovTexclrTemporalWeight[idx].w = temporalWeight;
 }
 
-#if 0
 inline __device__ float3 min(float3 a, float3 b)
 {
 	return make_float3(


			int pidx = getIdx(xx, yy, width);

			if (isReferPath) {
				v[pos] = make_float3(paths[pidx].contrib.x, paths[pidx].contrib.y, paths[pidx].contrib.z);
			}
			else {
				auto s = src[pidx];
				v[pos] = make_float3(s.x, s.y, s.z);
			}
			pos++;
		}
	}


	auto idx = getIdx(ix, iy, width);

	const int centerMeshId = curAovMomentMeshid[idx].w;

	if (centerMeshId < 0) {
		// This pixel is background, so nothing is done.
		return;
	}

	auto curColor = medianFilter(ix, iy, curAovColorVariance, width, height);

	curAovColorVariance[idx].x = curColor.x;
	curAovColorVariance[idx].y = curColor.y;
	curAovColorVariance[idx].z = curColor.z;

	// accumulate moments.
	{
		float lum = AT_NAME::color::luminance(curColor.x, curColor.y, curColor.z);
		float3 centerMoment = make_float3(lum * lum, lum, 0);

		// ώZt[̃Zbg.
		int frame = 1;

		auto momentMeshid = prevAovMomentMeshid[idx];;
		float3 prevMoment = make_float3(momentMeshid.x, momentMeshid.y, momentMeshid.z);

		// ώZt[P₷.
		frame = (int)prevMoment.z + 1;

		centerMoment += prevMoment;

		centerMoment.z = frame;

		curAovMomentMeshid[idx].x = centerMoment.x;
		curAovMomentMeshid[idx].y = centerMoment.y;
		curAovMomentMeshid[idx].z = centerMoment.z;
	}

	surf2Dwrite(
