         irradiance += texture(lightmap_x_basis, fs_in.lm_tex_coords).rgb * max(dot(lm_x_basis_vec, normal), 0.f);
         irradiance += texture(lightmap_y_basis, fs_in.lm_tex_coords).rgb * max(dot(lm_y_basis_vec, normal), 0.f);
         irradiance += texture(lightmap_z_basis, fs_in.lm_tex_coords).rgb * max(dot(lm_z_basis_vec, normal), 0.f);
-        out_irradiance = vec4(irradiance * albedo.rgb, texture(lightmap_direct_mask, fs_in.lm_tex_coords).r);
+        out_irradiance = vec4(ao * irradiance * albedo.rgb, texture(lightmap_direct_mask, fs_in.lm_tex_coords).r);
     }
     else
     {

    const vec4 albedo = texture(albedo, fs_in.mat_tex_coords * base_mat_uv_scale * inst_mat_uv_scale);
    out_albedo = albedo;

    // Output irradiance
    if (use_lightmap)
    {

uniform sampler2D lightmap_y_basis;
uniform sampler2D lightmap_z_basis;
uniform sampler2D lightmap_direct_mask;
uniform sampler2D ao_map;
uniform sampler2D albedo;
uniform sampler2D normal_map;
uniform sampler2D roughness_map;
