@Happy0Ending, I will reiterate what @shaderbytes and @sebavan said that a lightmap texture is not intended to be used as an albedo texture. However, with that said, there are some instances where using baked light and shadow detail multiplied into your albedo texture and displayed as an unlit material is exactly what you want in terms of performance. This takes the mesh out of the scene calculations for light and makes static meshes with no dynamic lighting conditions the route you want to go. In that case, you would not just be using a separate lightmap and mixing it with an albedo map, but instead you want to bake out a combined light, shadow, and albedo texture.
In this scene, you have an added bit of complexity in that the mesh contains some vertex color as well, which is usually multiplied with the albedo texture, which is why you are seeing the red and green wall colors, even when your lightmap texture looks wrong. The reason that the material looks wrong, while the Suzanne head looks right in this case:
Is due to the fact that there are typically two UV sets for meshes that have baked lightmaps. The primary UV set is for the albedo texture where you want to lean towards higher texel density textures since this is the main detail source for the material. You may also find tricks to maximize texel density in your textures by mirroring or tiling UVs. Lightmaps are usually baked into a separate UV set where you want to maximize a unique unwrap and are more willing to use a lower texel density on light and shadows as they are going to overlap the albedo texture and will hide some of the artifacts of a lower texel density.
What you are seeing above is that you assigned a light map texture that was baked out to the second UV set on the room displayed in the UV unwrap from the main UV set of the albedo texture. The Suzanne head has a unique unwrap that is the same in both of the UV channels on that mesh. This is why this particular mesh looks right in both instances.
To fix this, either use the lightmap as a lightmap which was already in your file but commented out:
function assignLightmapOnMaterial(material, lightmap) {
material.lightmapTexture = lightmap;
material.lightmapTexture.coordinatesIndex = 1;
material.useLightmapAsShadowmap = true;
}
which will render:
Or you need to set the texture coordinates of your lightmap texture to reference the correct UV set in the mesh to unwrap correctly:
function assignLightmapOnMaterial(material, lightmap) {
//lightMap as albedoTexture
material.albedoTexture = lightmap;
lightmap.coordinatesIndex = 1;
}
Which will render the same:
I hope this clears up why you were seeing what you did. You will need to work closely with your artists to understand how they are baking their textures and which UV sets they are assigning them to so that you can match it up in your material or texture declarations.