hi there, to preface, im a beginner in unity and blender, i made some models made in blender and am trying to bake lighting into it but im facing a few issues. ive made sure to enable generate light map uvs, and triangulate faces in blender, but am still getting some artifacts as seen in the picture
#issues with baked lighting
1 messages · Page 1 of 1 (latest)
This looks like some wrong sided triangles.
Here what looks like a perfect regular cube has one inverted face. If I enable backface culling (which is the standard in realtime rendering), the face is no more visible.
It can be fixed by using the mesh/normal menu, and select "recalculare outside".
You can also use the "face orientation overlay" with backface culling disabled to highligh back faced normals :
thank you so much! i checked blender and they really were inverted faces!
here is the updated image
is there a reason why the drawers on the right side are still differently colored though? in blender it looks like this:
Maybe check the lightmap texel density, it seems pretty low.
i bumped it up to 128, but seems like theres still uneven colouring in the drawers 
They really look like they have very big texels on them.
What does their UV packing look like ? You can display their lightmap UV by checking the MeshRenderer component on the object.
BTW, if you have outer faces for these walls (which you might for proper shadowing and lightmap rendering), you might want to separate them from the rest of the meshes, and set them to "contibute to GI" but "recieve GI from lightprobes", so the polygons that are not visible won't fill up space in the lightmap.
this is what the lightmap looks like
Oh boy.
i have no idea what im looking at to be honest 😅
You're looking at the UVs for all the meshes in the lightmap.
The things highlighted in yellow in the upper right part is the currently selected object.
As may have noticed, there is a lot of unused space in the lightmap
How was the diorama exported from blender ?
As a single mesh ? Separate ones ? Did you use instancing in blender ?
most of the objects are joined into one mesh each, for the drawers im using an array modifier... what is a good practice for importing from blender to unity when it comes to the meshes?
Not just for Unity, but for realtime rendering in general :
- use instances. In Blender this is done by duplicating an object with "linked" enabled (or alt+D instead of shift+D). So multiple objects are treated as copies of the same mesh, instead of individual meshes with exactly the same data. Use this for the drawers, tatamis, books ...
- Remove polygons that will never be seen : So the GPU doesn't even have to evaluate them, and they won't waste space in the lightmap. For example, the back of the drawers and the cabinets ...
What file format did you use to export ? A good choice is FBX, it's quite universally supported, and does handle objects instancing.
i see! thank you for the tips. i used fbx when exporting!
should i manually remove the faces that cant be seen from the general direction of the camera?
If you look in your previous screenshot, you can spot things like the floor mesh under the tatamis (or tiles ?), you can see that is it mostly black, only the space in between where light can pass is visible. So that's a lot of wasted lightmap data for things that can't be seen
ahhh! i should remove the underside faces of the tatami tiles?
In the middle right you can see some big squares with uniform lightmap.
I have no idea to what it coresponds to in the 3D model but :
When lightmapping, Unity tries to have an uniform texel density over all object. That means that these squares seem to have about the same size as to room floor ? It make me really think that you have the outter walls / under floor quad visible and rendered in the lightmap. Again a waste of space
It could be an idea. But I understand that it makes everything less easy to edit, so you can keep it if you optimize elsewhere.
I don't understand why it seems to be there 4 times though 🤔
If you're ok to share the scene (maybe blender file) I could give you an in depth feedback
this is the blender file!
Oh, wow, hum, be gentle on that bevel modifier that you have everywhere ^^
For example, on this drawer it does create a lot of very small polygons.
And because you've triangulated it, it is also a bit uneaven.
You don't need so much geometry for things to look smooth, just use the menu "object > shade smooth" 🙂
Here's a drawer where I removed the handles bevel, and kept the 6 subdivisions.
And here it is with only 2 subdivisions, but with shade smooth :
In general, try to avoid intersecting geometry. And more in particular, the lightmapper really hates that. There is quite a mess on the chair :
And like I said, remove face that can not be seen, like the top plate under the seat of that chair
The books are an other example of very bad geometry with all those inner polygons
Is possible, use objects with the scale at (1, 1, 1). Or at least, with an uniform scale (X=Y=Z)
Use "Apply scale" in blender to apply the scale of an object to it's geometry
As for bevel, be cautious with the subdivision surface modifier. Smooth shading with controlled bevels can give the same result with way less polygons.
Here for example is one of the "paper roll" objects, from right to left :
original mesh, flat shaded
same mesh, but with 2 subdivisions
tweaked mesh, hand made bevels and smooth shading
I forgot to disable "optimal" display on the subdivision modifier, here is what the geometry actually looks like :
So, um, I guess you have a lot of things to look at and optimize now 🙂