 		G = geometric attenuation.
 		F = fresnel coefficient.
 	*/
-	float NdotH = max(0.0, dot(N, H));
-	float NdotV = max(0.0, dot(N, V));
-	float VdotH = max(0.0, dot(V, H));
-	float NdotL = max(0.0, dot(N, L));
+	float NdotH = max(0.0, dot(dir.N, dir.H));
+	float NdotV = max(0.0, dot(dir.N, dir.V));
+	float VdotH = max(0.0, dot(dir.V, dir.H));
+	float NdotL = max(0.0, dot(dir.N, dir.L));
 
-	float gauss = 9.0;
+	vec3 R = normalize(p + reflect(dir.L, dir.N));
+	vec3 refl = F * textureCube(env, R).xyz * 2.0;
 
 	float G = min(
 		1.0, 

			(2.0 * NdotH * NdotV) / VdotH, 
			(2.0 * NdotH * NdotL) / VdotH));
	float a = acos(NdotH);
	float D = gauss * exp(-(a * a) / (roughness * roughness));
	// D = DGGXTrowbridgeReitz(roughness, NdotH);

	return (F * D * G) / (4.0 * NdotL * NdotV);
}

/*

	uniform vec3 cameraPosition;
*/

/*
	Contains common vectors for different stuff,
	unclutters the code quite a bit.
*/
struct directions
{
	vec3 H;
	vec3 L;
	vec3 N;
	vec3 V;
};

float schlick(float F0, float HdotV)
{
	return F0 + (1.0 - F0) * pow((1.0 - HdotV), 5.0);
