 
     vec3 kS = F;
     vec3 kD = vec3(1.0) - kS;
-    kD *= 1.0 - material.metallic;
+    kD *= 1.0 - metallic;
 
     float NdotL = max(dot(N, L), 0.0);
 

    vec3 irradiance = textureLod(environment.texture, cn, 20.0).rgb;
    vec3 diffuse_environment = irradiance * albedo.rgb;

    vec3 ambient = (kD_env * diffuse_environment + specular_environment);

    color = vec4(Lo.rgb + diffuse_static.rgb, material.opacity);
    color.a = material.opacity + tex_color.a;

    //Fog

    //TODO: Shouldnt it be tex_color.a * material.opacity?
    albedo = vec4(mix(material.albedo * material.opacity, tex_color.rgb, tex_color.a), 1.0);

    vec4 metallic_map_color = texture(material.metallic_map, fragment.uv);
    float metallic = mix(material.metallic, metallic_map_color.r, metallic_map_color.a);

    float ambient_occlusion = texture(material.ambient_occlusion_map, fragment.uv).r;

    for (int i = 0; i < max_decals; i++){
        if (fragment.proj_coords[i].w > 0.0){
            vec2 d_uv = fragment.proj_coords[i].xy / fragment.proj_coords[i].w;
