             vec3 L = normalize(light.position - fragment.position);
             vec3 H = normalize(V + L);
 
-            float NdotL = max(dot(N, L), 0.0);
+            float NdotL = max(dot(normal, L), 0.0);
             float cos_dir = dot(L, -light.direction);
             float spot_effect = smoothstep(cos(light.angle / 2.0), cos(light.angle / 2.0 - 0.1), cos_dir);
 

        discard;
    }

    vec3 N = normalize(normal);
    vec3 V = normalize(camera.position - fragment.position);

    vec3 F0 = vec3(0.04);
    F0 = mix(F0, albedo, metallic);

            vec3 radiance = light.strength * 0.09 * light.color * attenuation;

            // Cook-Torrance BRDF
            float NDF = distribution_GGX(normal, H, roughness);
            float G = geometry_smith(normal, V, L, roughness);
            vec3 F = fresnel_schlick(clamp(dot(H, V), 0.0, 1.0), F0);

            vec3 nominator    = NDF * G * F;
            float denominator = 4 * max(dot(normal, V), 0.0) * max(dot(normal, L), 0.0) + 0.001;
            vec3 specular = nominator / denominator;

            vec3 kS = F;
