attribute vec3 position;
uniform mat4 modelmat;
uniform mat4 pmat;

varying mediump float depth;

void main() {
	vec4 rcoords = modelmat * vec4(position, 1.0);
	gl_Position = pmat * rcoords;
	depth = (rcoords.z + 5.0 + 1.732) / (4.0);
}
varying mediump float depth;

void main() {
	gl_FragColor = vec4(vec3(1.0), exp(-1.0 / (depth) + 1.0));
}