#version 330 core

in vec3 positionViewSpace;

const float Near = 0.1;
const float Far = 100.0;
const float LinearDepthConstant = 1.0 / (Far - Near);

// Ouput data
layout(location = 0) out vec2 moments;

void main(){
	//float moment1 = length(positionViewSpace)*LinearDepthConstant;
	float moment1 = gl_FragCoord.z/gl_FragCoord.w;
	float moment2 = moment1*moment1;

	moments = vec2(moment1, moment2);
} 