The_Lightmapper icon indicating copy to clipboard operation
The_Lightmapper copied to clipboard

Pre-packing issue

Open samevision opened this issue 3 years ago • 3 comments

Hello,

thanks for the new version. I am glad that you are still working on this project.

Unfortunately I have still problems with pre-packing since I can't use my own uv maps. I have two objects, both of them have a second uv map ("UVMap_Lightmap"), I created an atlas group, I added both objects to the atlas group and choose as unwrap mode "Lightmap":

enum "EDIT" not found in ('OBJECT')

If I choose "Smart Project" as unwrap mode it works fine. But I would like to use my own uv maps.

Am I doing something wrong?

Best

samevision avatar Feb 23 '21 22:02 samevision

Hi,

It seems you've found a bug, although I can't seem to reproduce it - although I think for what you want, the workflow is a little different.

If I understood you correctly, what you have are two objects with premade UV maps. You want to have those in the same atlas lightmap right?

What the prepack method does, is that it takes all your objects and runs your selected algorithm on them simultanously (in your case, Lightmap being the Lightmap pack function in Blender). Your own UV maps are overriden when using this.

What I think you want is the postpack method - It takes all your objects, uses the existing UV or creates a new one and bin packs them into the same atlas (provided your atlas is large enough).

The workflow is:

  • Under the Atlas settings, select postpack and add a group of sufficient size (enough to contain your lightmap resolutions)
  • Under Object settings, if you already have setup a UV or provided a custom UV channel, you can ignore these as it's just if not lightmap channel is detected. Toggle on Postpack Object and select your Atlas Group.
  • When you bake now, it should be baked to the same atlas:

Bake_atlas

bake_object

bake_together

bake_uv

But as I mentioned, you did seem to stumble upon a bug, as the object edit error is not supposed to happen.

Hope it helps!

Naxela avatar Feb 24 '21 09:02 Naxela

Hello Naxela,

sorry for my late reply. It took some time to get some space to tackle this lightmap problem again. Thanks for your response!

I also experimented with post packing mode but I can say that I definitely want to use the prepacking mode because I don't want to pack multiple textures into one. As your image shows a lot of space is wasted since you pack all textures side by side.

Blender offers the nice feature to unwrap multiple objects at ones. So after just make a smart uv unwrap of both spheres I get this UV Map:

tJ0Td4Eb15

Now I want to bake the lightmap of both spheres due to this UV Map on one single texture. Am I able to do this anyhow?

Best

samevision avatar Mar 20 '21 13:03 samevision

Hi, I think I misunderstood you the first time around,

I think what you're seeking is the option copy existing under the atlas group tab (prepack):

image

Below is an example of the spheres using an arbitrary manual UV map and baked together to the same prepacked lightmap:

image

I don't remember exactly when I implemented the copy existing option, but it might have been after you initially asking your question, but I hope it does what you're seeking

Naxela avatar Mar 22 '21 13:03 Naxela