Baking texture for multiple meshes

In the progress of teaching myself hobby blender/unity, I’ve been creating a catapult. I am pretty content with it, considering I’ve been only doing this for a really short while. And this is a learning project.



I’ve got 2 versions of it, both with a procedural wood texture, just Cycles, one a bit lighter then the other. Now, each of the beams is it’s own separate mesh, a scaled, rotated and applied cube. All the beams use the same material. But, now I’d like to bake that material to an image that I can use as a texture. That works if I do one object at the time, and then give that one object one image file as texture. But that means that my, simple, catapult will have 11 texture files associated with it. That could be just how it is supposed to be, but I doubt it is.

If I combine all the different meshes into one big mesh, then the texture, in cycles, looks horrible, doesn’t look like separate wooden beams anymore, but like it’s carved from one block.

So, is there a way to bake different objects to one combined texture map? And if so, how? If not, then what would be a good approach to do this?

Maybe I am not asking my question correctly. I’ve got this work in progress catapult, that I’d like to use in Unity. I’ve made a wood and a metal texture and now I want to bake these to an image so I can use that in Unity. But, the spoon of the catapult and the wooden beams use different textures. Is there a way to bake those to a single image? Or am I forced to create a different texture file for each separate mesh inside the catapult?

Attachments


can you provide a sample file?

Yes. I’ve included the blend file.

Attachments

Wooden Catapult 002.blend (656 KB)

ok, so here is your problem. Besides minor things like ngons and flipped normals but thats modeling issues. You want to bake cycles material like difuse bsdf and gloss bsdf with some mixing etc. this can not be done this way. The only way to do this is to use emission shader. So all material outputs should be flat.

Next, if you have proceduraly generated material like this wood, you can not join all our meshes into one cause this will mess your generated material.
THe only way to do this is to first , make a copy of your catapult. Remove material and join everything. THen uv unwrap (add material for this mesh with texture node). Next in material settings of your procedural wood/metal yOu need to output color to emission shader. Then select all your meshes with generated materials and lastly select your uv mapped mesh. In baking options set bake type to emit and check selected to active selection checkbox increase a bit ray distance (or use cage) and hit bake.


on second layer there is uv mapped catapult with baked texture. Metal is black cause this material would require to be made differently.

In general its a bad approach on textures but still workable.

Thank you. Even if I don’t understand a significant bit of your answer. Let me check if I follow. First of, I’ve been able to bake a diffuse shader to an image and use that in Unity, but that’s not the way?

  1. Make a copy of the object,
  2. Join all meshes of the object into one
  3. UV Unwrap copied object
  4. Set output to emission shader
  5. Select all meshes of original object
  6. Add select UV mapped mesh
  7. Bake

I’ve seen the file you made, I will try to duplicate it to understand. Lastly, this is a bad approach you say, what would be the right approach?

If you want to use blender for texturing, just avoid making them from blender generator nodes. This wont give you good results. For wood texture (ofc it depends on your art style) you could paint it by hand or use image textures from internet.