Is it possible to bake a lightmap for a group of objects that have one packed uv.


Is there any way to bake a group of objects in one uv instead of baking them separately. for example I want to combine some objects and make a uv for them in maya , then separate them and bake them with unity. But I want unity to bake them like the combined object, in one complete map. Is it possible to do.

Thanks in advance.

Actually you can do this very easily:

The lightmapping options have an “object” tab. These are the lightmapping settings of the selected object. The other tabs are the actual baking options, so don’t get confused by that.

Anyway, what you do is:
Select each object at a time. Go to the Lightmapping > Object settings
The “scale in lightmap” sets how much space the object will take up in your lightmap. All of these numbers together should be 1…or a bit less due to padding and inefficiency in combining uv’s. So scale two objects to 0.45 for example instead of 0.5
If it doesn’t fit, Beast will more the next object to a new lightmap without a warning. But don’t get confused by that, just lower the scaling a bit.

In the editor view check the “show resolution” box to see what you are doing. And check the baked map if it’s efficiently done.

You can assign which objects go into which lightmap by setting the “Lightmap Index”. Zero is the 1st map it’ll bake. Just make sure that for each lightmap the total scale doesn’t exceed 1.

So if you do a test with two objects and assign one to 0.3 scale, the other to 0.1 and set the same lightmap index, you’ll have one single texture.

Now if you go to the Lightmapping > Bake options, you can change the lightmap resolution by tweaking the “resolution” number. 50 texels per world unity means in my case 1024x1024 texture, so 25 gives me a 512x512, and so on.

Looking at it from another perspective, if you get the amount of lightmaps you want and the resolution is too low, either change the resolution of a bigger size texture or change the scaling for the objects that you want to look better. You’ll get an extra lightmap texture, but it’s a very efficient way to assign more texture memory for object that are really noticable :slight_smile:

If you need help just let me know!

Yes, you could. But it’s too Complex:

1.bake as normal.

2.get the uv of every objects of your group;

3.montage the uv into a “whole” one(complex)

4.“lock Atlas” and bake again.

then you get a “whole” lightmap.

Can you please explain it step by step in unity way. how can u merge al the UVs into one from different meshes inside unity 3D !