
vec2 calculate_moments(in vec4 position, in vec2 depth_range)
{
	float d = ((position.z/position.w)*0.5 + 0.5) * depth_range.y;
	float dx = dFdx(d);
	float dy = dFdy(d);
	float dd = d*d + 0.25*(dx*dx + dy*dy);
	return vec2(d, dd);
}
