Hi! I’m doing some light baking tests with my modular set. I’ve attached screenshots of my custom, manually created lightmap (UV channel 2) for the modular set, and the packed lightmap UV after baking into the global lightmap atlas. Why does the lightmapper place the islands so inefficiently and leave tons of empty space? Is there any way to make the lightmapper pack my islands as tightly as they are in my custom UV2?
#Lightmap packing issue
1 messages · Page 1 of 1 (latest)
It looks like not all UV islands are visible in the preview that were baked onto the lightmap
So there's stuff in the "empty" gaps, and you can see lighting information there too
So gaps are not expected
But I think it still tends to leave empty space in some circumstances
For that you can decrease max lightmap size so it allocates the islands to smaller textures
It seems like that it's all uv islands, which are present in my scene
1К
At the time of baking? those texels in the "empty" space had to come from UV islands I'm pretty sure
512
There is really nothing else in my scene
Why are some of these white and some blue? It somewhat looks like the yellow UVs on the lightmap and white UVs on your preview line up
But that lighting has been baked onto the blue UV areas
Which points to there really being UV regions in those spots
I can see the dark blue UV regions from the preview also on the lightmap as solid blue regions in another spot
Whatever that white highlighting means, it feels like that's where the split is happening
In this picture you've highlighted all the meshes in your scene, but it didn't highlight all the UV regions on the lightmap
So where do the rest come from?
Also, with 512 max size the lightmap layout did not change at all, implying the atlas was always 512 or smaller and you have to decrease max size further if you want to see an effect
It happens, cause unity has no multiselection highlight and it highlights only last selected object
There are no rest uv regions. Meshes - the only UV regions in my scene
Light was bake on all islands but it seems that packer packs objects with different mesh renderers to different 'cells' in global lightmap atlas
And i have no idea, how to fix it
I see!
64x64 resolution also provide some weird results
I guess it makes sense that the lightmap space is in 0...1 range per mesh
Otherwise the lightmapper would have to effectively generate new lightmap UVs when it bakes
The question is "Can i create 'LightmapUV atlas' for my modular set and freeze it during packing process like here?"
Okay, in this way i need to create unique lightmap for each part of the set?
No
The lightmapper did "freeze" it but the result was the exact opposite of what you hoped
That arraignment would only be valid if you're baking those exact parts together, which you likely won't be as they're modular
Add another instance of one of the pieces into the scene and it no longer fits in that puzzle
Yes, if you want to create them manually
Unity's automatic UV generation is for most cases perfectly adequate