Bake Wrangler - Node based baking tool set

Yup. It seems I was right yet again. I hate being right.

On the other hand, no new API means no work, so that’s good I guess.

Well at least a de noise option and adaptive sampling shouldn’t be to hard to add as options

Things do seem to be broken though, Cycles X also seems to be 4 seconds slower on a 1k bake

Cycles

Cycles X

I will have to make a few changes due to branched path tracing being removed, but shouldn’t be a lot to do. Dunno if the performance for baking is really going to be any better. De noising will be nice for the one or two maps that actually can benefit from it :stuck_out_tongue:

Yeap, Cycles-X is supposed to be much much faster but i think that is optimization for how everything interacts with each other as a hole i think performance for map baking will be the same unless they specifically optimize for it and that is unlikely lol.

It seems very unlikely baking would be optimised specifically and many of the things they did don’t really impact baking much. I think what might actually be better is if you could bake in Eevee…

True that would be better. It would also be better if shaders could also work like substance designer so you would just output the final image and not actually bake anything.

How do you bake an image per material? I have one object but multiple materials with overlapping UV maps.

I figured the “input material” node was to bake based on the material, but there’s no documents on it and my wild guesses on how to use it has failed me.

For example, an object/mesh has both eyes and a body. Eyes are a different material from the body, but they share the same UV space.

My previous solution was to divide the object into “body” and “eyes” to get separate meshes to bake to seperate images, but that’s not a feasible solution when there’s many things I would have to separate out and then bring back together to export an fbx.

Edit: One ok solution right now is to make a UV map per material and use the UV map section of the mesh input.

There isn’t actually an easy way to split the materials on an object into separate files, other than using UDIM (which is basically the same as having a different UV map per material, which also works). There is also the ‘Material Override’ option, which will force just once specific material to be used, but would be annoying if you had a lot of materials to use that…

Is this a limitation of blender or of the addon?

Blender supports splitting each material to a different output, it’s just not something people typically want to do a lot of. So I’ve never added a strong set of features to support doing it. You can still do it, there just isn’t a bunch of dedicated settings for it.

Typically you don’t want an exported model to have multiple materials and you don’t want UVs to overlap. When you need more UV space for some elements, then UDIMs come in. This is because each material requires a draw pass, which is expensive. Overlapping UVs will also make it impossible to generate a single light map using that layout.

Of course I have no idea what you’re actually doing. But I think you probably want to use UDIMs if they are supported in your target application.

If you can explain an alternative workflow, I’m all for it.

But I am confused on UDIMs. I’m assuming Bake Wrangler will output multiple images with a number according to the UDIM. But in game each image needs to be applied via a different material, right? How does this reduce number of materials? Edit: Unless… you have a material with multiple images but you simply change the UV map it is using per image.

Edit: But the reason I wouldn’t use UDIMs at the moment because I want my image textures to be named something like Tex_BodyColor, Tex_EyeColor, rather than Tex_BodyColor1001 and 1002 (for eye).

Edit: Here’s the baking setup I’m using to get seperate images.

Ah, I don’t believe Unity supports UDIMs natively. I think you could probably implement them using texture arrays (which it supports but I think you have to create them with script rather than via the UI). Essentially UDIMs work by combining all the tiles into a single texture space that the shader can read all at once. Resulting in a single draw call.

If you aren’t using different shaders for the eyes and hair it would be better if you can put them in a single material.

Why are you currently having them in different files? Is it just because you need more UV space for details?

Edit: My suggested method won’t work because of overlapping UVs.

The add-on is designed to let you split the output by object. Normally I would expect you to have an export version of your model with all the parts merged and a working version that has separate parts. That’s just generally required to bake maps in a high poly workflow. Of course in a mid poly workflow it’s potentially no longer needed.

Still I think in your case I would have a merged export model and a split baking model just because it will make it way easier to manage.

If you want customizable or modular characters, using multiple materials is the way to go, despite the draw call cost. That said, I don’t particularly see the problem in having a recipe per material.

You can have multiple materials, but I think the overlapping UVs are still an issue. I believe Unity creates light maps per object rather than per material? It will have to generate its own UV map to do that if your UVs overlap, which isn’t going to be anywhere as good…

For prototyping stage there’s too much room for human error to be splitting and merging.

The first issue: Every time you split, you get objects named Body.001 Body.002 Body.003 Body.004 instead of Body, Hair, Eyes, Emotes. You’d then have to re-setup Bake Wrangler for those new objects.

So, my solution of creating UV maps for BakeWrangler does work. What might improve the situation is to specify the UDIM to be used and only that UDIM so then I can control the file names for each UDIM output, that way I would remove the step of creating UV maps for baking. I think I would still create single UV map for bakewrangler, but only 1 instead of 4.

I would like for people to be able to set both the resolution and output name of UDIM tiles. That would help with what you want to do as well.

The problem is how to do that in a way that makes sense to users… Blender currently only supports UDIMs are inputs. All the data is linked to the specific images, rather than to an object or UV layout and I think that’s really unclear to users.

I will probably add UDIM node that is placed before the bake pass in the future with some tricks to make that happen. But I need to freeze development for the moment and look at fixing all the documentation.

Some day when I have to make major changes to the baker, I will probably allow you to split output by material as well as object. But I don’t want to hack that into the current system as it isn’t really written to support it and object and tile splitting already a bit hacky. Also no one has ever asked to be able to do it before :stuck_out_tongue:

Okay I’ve updated the documentation for v1.2. Hope it makes sense, I have trouble describing some stuff >_<

https://bake-wrangler.readthedocs.io/en/latest/index.html

Let me know if there are any example processes you would like to see added to the examples section…

2 Likes

Thanks for that. I’ve only read about a quarter of the text and have learned a couple of things already. I probably should be more adventurous than the standard set of recipes I’ve been using.
I will attempt to read from a noobie point of view as I want to champion this addon in other user groups. I’ve been waiting for the addon to stabilise.

Well, it’s quite stable now. There won’t be any changes until Blender 3 and nothing really big… The only thing I’m wondering about changing right now is where the margin options are in the UI.

Currently you choose between blender or bw margin in the Mesh settings. The problem is that BW margin should really be in the Output settings, as it operates on the entire output. There is also no reason you couldn’t have both margin systems turned on as they can work together fine…

But having a margin setting in two different places just strikes me as really confusing, so I don’t know that I actually want to do it…

I will probably try to make a youtube video…