ucupaint icon indicating copy to clipboard operation
ucupaint copied to clipboard

Significantly increasing baking speed (special mode)

Open m00nk opened this issue 3 months ago • 7 comments

Pre-Flight checklist

  • [x] Did you check to see if this issue already exists?
  • [x] This is a single feature request. (Do not put multiple feature requests in one issue)

Describe The Feature Request Below

I'm creating a set of assets for modular game design. My blender file contains over a hundred objects that use the same ucupaint material with the same UV map (all the object islands are combined into one large map). Baking this material takes a very long time on my system, sometimes taking over 30 minutes.

I noticed that the more objects in the scene, the longer the baking process takes. From this, I concluded that ucupaint performs a separate bake for each object. I conducted an experiment: I deleted all but one object from the scene and then baked it. It took less than a minute. However, the resulting textures only contained parts related to the object I'd left behind, which is unacceptable for me.

My suggestion: please add a special "full bake" mode to ucupaint that would bake entire textures in a single pass.

Here's how I think it should work: the script creates an empty Plain and assigns current ucupaint-material to it. This Plain already has a UV map by default, completely covering the entire texture area. The script then bakes only for this Plain and, when finished, simply deletes it.

For my specific workflow, this will increase baking time by tens or even hundreds of times.

Thank you. I hope to hear from you soon.

PS Sorry for my English - I use google-translator.

m00nk avatar Sep 23 '25 22:09 m00nk

I see, can you upload an example blend file to test? I don't have a scene that has hundreds of objects.

ucupumar avatar Sep 25 '25 03:09 ucupumar

To see the issue you do not need the file with hundreds objects.

This example.blend.zip contains three objects, all using the same ucupaint material. Baking takes over 40 seconds on my system. But I can delete all these objects and simply add a plane (it's already in the file as a hidden object), then assign it the ucupain material and bake, which takes about 18 seconds and produces the same result.

The more objects in the scene, the longer the baking time, since each object is baked separately. But I just need to "merge" all the working textures into the final set, which can be done in one pass, significantly saving baking time.

m00nk avatar Sep 25 '25 15:09 m00nk

Okay thanks! I'm currently still busy, so I'll check that out later.

ucupumar avatar Sep 27 '25 06:09 ucupumar

Any news?

m00nk avatar Oct 26 '25 13:10 m00nk

I already checked on your file. The are several problems with baking using a plane, which are

  • Only possible if all the layers and masks are using the same UVMap
  • Other texture coordinates than UV are not supported
  • Bake margin extension is also not possible since it needs proper UVMap for baking

With those drawbacks and the possible complexity of the implementation, I dunno if I'll implement this myself soon. But feel free to implement this yourself if you are capable of doing it.

ucupumar avatar Oct 27 '25 04:10 ucupumar

I have added PR: https://github.com/ucupumar/ucupaint/pull/339

m00nk avatar Oct 28 '25 13:10 m00nk

Okay, thank you. I'm currently very busy, so I'll check that out early next month.

ucupumar avatar Oct 29 '25 16:10 ucupumar