 	vec3 infos = texture(effectsTexture,In.uv).rgb;
 	float roughness = max(0.0001, infos.r);
 	float metallic = infos.g;
+	float depth = texture(depthTexture,In.uv).r;
+	vec3 position = positionFromDepth(depth);
 	vec3 n = normalize(2.0 * texture(normalTexture,In.uv).rgb - 1.0);
+	vec3 v = normalize(-position);
 	
 	// Compute AO.
 	float precomputedAO = infos.b;

	vec2 uv;
} In ;

// Uniforms: the texture, inverse of the screen size, FXAA flag.
uniform sampler2D albedoTexture;
uniform sampler2D normalTexture;
uniform sampler2D ssaoTexture;
uniform sampler2D effectsTexture;
uniform samplerCube textureCubeMapSmall;

uniform mat4 inverseV;

// Output: the fragment color
out vec3 fragColor;


void main(){
	

	vec3 diffuse = (1.0 - metallic) * baseColor * (1.0 - F0) * envLighting;
	
	// Compute world normal and use it to read into the convolved envmap.
	vec3 specular = ggx(n, v, F0, roughness);

	fragColor = ao * (diffuse + specular);
}
