     float NdotH2 = NdotH*NdotH;
 
     float nom = a2;
+
     float denom = (NdotH2 * (a2 - 1.0) + 1.0);
-
     denom = M_PI * denom * denom;
     denom = max(0.0001, denom);
 

#endif

#define M_PI 3.14159265359

uniform int u_graphicsWidth;
uniform int u_graphicsHeight;

#ifdef lights
    #if lights > 0
        struct Light {
            vec3 position;
            vec3 direction;
            float intensity;


            kD *= 1.0 - metalness;

            float NdotL = max(dot(N, L), 0.0) * light.intensity;
            Lo += (kD * albedo / M_PI + brdf) * radiance * NdotL * lightAttenuation;
        }
    #endif

    vec3 ambient = vec3(0.03) * albedo;
    vec3 color = ambient + Lo;

    #ifdef defGammaCorrection
        color = color / (color + vec3(1.0));
        color = pow(color, vec3(1.0 / 2.2));
    #endif

    gl_FragColor = vec4(color, 0.8);
}
