 	return make_float3(pos.x, pos.y, pos.z);
 }
 
+inline __device__ float C(float3 x1, float3 x2, float sigma)
+{
+	float a = length(x1 - x2) / sigma;
+	a *= a;
+	return expf(-0.5f * a);
+}
+
+inline __device__ float C(float x1, float x2, float sigma)
+{
+	float a = abs(x1 - x2) / sigma;
+	a *= a;
+	return expf(-0.5f * a);
+}
+
 #define IS_IN_BOUND(x, a, b)	((a) <= (x) && (x) < (b))
 
 __global__ void varianceEstimation(

			cudaBoundaryModeTrap);
	}

	auto centerViewPos = computeViewSpace(ix, iy, centerDepth, width, height, &mtxC2V);

	float3 centerMoment = make_float3(momentMeshid.x, momentMeshid.y, momentMeshid.z);


					float Wd = exp(-0.5f * d * d / (sigmaD * sigmaD));

					float Ws = exp(-0.5f * (u * u + v * v) / (sigmaS * sigmaS));
#elif 0
					float Wn = 1.0f;
					{
						float normalCloseness = dot(sampleNml, centerNormal);
