Bake Multiple Materials/Objects to One Texture Map (Blender Tutorial)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this tutorial I will show you how to bake multiple materials and multiple objects to the same texture maps in blender and that way they can share the same material and this method will work for multiple objects which are sharing the same material and it will work for multiple objects which have different materials and this method will also work for a single object which is using multiple materials if you'd like to learn the basics of texture baking in blender then definitely check out my texture baking for beginners tutorial with the link in the description and you can also check out my texture baking tutorial playlist to learn more about texture baking in blender so in this example here I have this battle ax 3D model that I created and this battle ax is made out of three different objects so it has the blade object it also has this metal part here and then it also has this wooden pole and there are two different materials so I created this procedural wood material on the handle and then I also created this procedural metal material and in this video I'm going to show you how to bake both of these materials to the same texture maps and then they can share the same material and if you'd like to use the same project files that I'm using and follow along with this tutorial then I will have a free download of the project files on my gumroad store and my patreon page with the links in the description or you can just use whatever model you're trying to bake and if you're downloading the project files on my gumroads store you can throw a few dollars into the price box before purchasing to send me a little tip and help support this channel if you'd like to or you can just punch in xero and download the project files for free so the first thing that we need to do is add an image to bake2 so you can just select whichever material you want I am going to select the wooden pole object so I am in the shading tab so I have the 3D viewport over here and the Shader nodes over here so I'm going to press shift a let's go to the search and I'm going to search for the image texture and let's drop the image texture here above the principled Shader now we need to create an image to bake to so let's click on the new button to create a new image and then on the name here I can just call this ax now the the width and height is going to determine the resolution of the image and I want my texture maps to be very high quality so I'm going to change this to a 4K texture so I'm going to click and then drag down and then let go and this way we can change both values at the same time and I'm going to type in 4096 and then hit enter and this is the standard resolution for a 4K texture so just change this to whatever resolution you want for the image textures and then you can leave all the other settings at the default and click on OK so this image is the image that we are going to bake the textures onto the next thing that we need to do is UV unwrap all the objects to this image so what I'm going to do is Click right up here to go to the UV editing workspace and then I'm going to press the Tab Key to go back to object mode and then what I need to do is just select all the objects so if you only have a single object with multiple materials you can just select that single object in this case I have three objects so I'm going to hold down the shift key and select all three objects at once then I'm going to press the Tab Key and this will go into multi-object editing so you can see we're in edit mode of all three objects and then right over here on the side we have the UV editor so I'm going to scroll right over here and then I want to click on the drop down and I want to preview the image that we created and this is the image that we're going to bake to so we now need to UV unwrap the objects onto the image and if you'd like to learn the basics of UV unwrapping in blender then definitely check out my uvn wrapping for beginners tutorial I'll have the link in the description but for this object I'm just going to use the smart UV project so press the a key to make sure all the mesh is selected in edit mode and then I'm going to press the U button and for this I'm just going to use the smart UV project and then I do want a little bit of space in between the islands to make sure there isn't any overlapping so I'm going to turn the island margin to a .003 and then I will click on OK so with the smart UV project blender is going to do the best job that it can to UV unwrap the mesh onto the image now the materials that I have on this ax are procedural so they're not using UV mapping but if you're using the materials which have texture Maps then you may already be using the UV mapping of the object and so in that case if you re-uvian wrap the object it might mess up the placement of the textures so in that case then you should check out my other video on how to texture bake objects from one UV map to another UV map in blender and in that video I basically show you how to create two different UV maps and then I show you how to bake textures from the first UV map to the new UV map I'm not going to cover that in this video but you can definitely check that out with the link in the description now this UV map actually isn't very optimized there's a lot of pixel space right here that we're not actually using and so when we bake the textures it's not actually going to look that high quality because there are so many pixels here that we're not using in the image so what I want to do is make the UV Islands as big as I can and that way we'll be able to use more of the pixels in the image so what you can do is hover your mouse over the islands and press the L key and that is going to select the entire Island and I'm going to continue to do that so press the L key with your your mouse hovered over the islands and that's going to select multiple islands and then in the UV editing you can press s to scale you can press R to rotate and G to grab just like in the 3D viewport and so I'm going to scale up these islands and I'm going to make them as large as possible and so the bigger they are the more pixels it's going to use in the texture map and the higher quality the bake will look so I'm going to continue to do this just by selecting some islands and I'm going to scale them up and I'm going to optimize this better alright so I've gone ahead and optimized the UV Islands so you can see the UV islands are much bigger now and so they're going to be able to use more of the pixels in the image now one really important thing is to make sure there isn't any overlapping of the UVS because if there's overlapping then it will mess up the texture baking so to make sure there's no overlapping you can press the a key to deselect everything and then you can click on select and you can click on select overlap and you can see nothing was selected and then also make sure that all of the islands are within the boundary of the image they need to be within the boundary of the image and you can see these are all inside the image alright so we're now going to go back over to the shading Tab and the next thing that we need to do is we need to add this image to all of the different materials so what I'm going to do is Select this wood material and then I'm going to click on this ax image I'm now going to press Ctrl C to copy the image and then I'm going to click right over here on this metal material and I'm going to press Ctrl V to paste the image and so you just need to select each material and add the same image to all the materials and if you have a single object which has multiple materials applied to it then you can go right over here to the material properties and right up here in the texture slots you can select all the different materials and then add the same image alright so we can now go over the bake settings so if you click right up here on the render properties right here on the render engine you need to be using Cycles Render because EV doesn't support baking now if your scene is using blender EV that's totally fine you can just switch it to Cycles then you can do the baking and then you can switch it back back to Eevee once you're done with the baking so make sure it is set to cycles and then let's also open up the sampling tab right here and right here on the render samples I want to turn the samples all the way down to one because if you turn the samples down then it will bake faster but it won't affect the quality of the bake if you turn the samples down so I can now close the sampling Tab and I can now open up the bake Tab and again make sure you're using Cycles Render because in EV this baking tab won't show up so I'm going to be baking four different texture Maps I'm going to be baking a base color a metallic a roughness and a normal but you can just bake whatever texture Maps you need for your object and again definitely check out my texture baking tutorial playlist to learn how to bake all of the different Maps so the first one that I'm going to bake is the color map so right here on the bake settings you want to change this to diffuse because diffuse is the same as color and then if you open up the influence right here we want to turn off the direct and indirect because the direct and indirect is actually going to bake the lighting data so it's actually going to bake the lighting which is on the object but I don't want to do that I just want to bake the color so just turn off the direct and indirect and then also it's really important before you bake the color Maps is you need to make sure to turn off any metallic values so if your object isn't made out of metal then you can just ignore this part but with my object I am using one material which is metallic so what you need to do is select any of the materials which are metal and right here on the metallic value you need to make sure it is turned to zero or if you have any textures being plugged into the metallic value you need to unplug it from the metallic value and then turn the metallic value to zero then we can bake the color map and then once we're done we can turn the metallic value back to one for some reason if you have the metallic value turned to 1 and you bake the color map the image will look very dark so make sure all the metallic values are turned to zero before you bake the color map now I also want to be able to preview the image as it's baking so what I'm going to do is Click right here when the Crosshair appears in the corner and I'm going to drag down and that's going to split the window and then if you click right here to change the editor type I'm going to change this to the image editor and then if you click right here in the drop down I'm going to select the ax image and this way I can see the material once it's finished baking now what's really important before you hit the bake button is you need to make sure you have all the objects selected that you want to bake so in this case I have three different objects so I'm going to hold down the shift key and select all three objects or if you just have one object you can just select the single object and then what's also really important before you actually bake this is you need to select the image within all the materials so right here this ax image you need to click on it and make sure it's selected and you know it's selected if it has that white outline so I'm going to hold down the shift key and I'm also going to select the wood object and then I can preview the wood material and make sure that is selected and again if you have an object which has multiple materials applied to it then right up here on the material properties you can select each material and then make sure that that image is selected so then you can go right back up here to the render properties and then we have the big type set to diffuse and I can click on the bake button and you can see there's a loading bar right down here and it's going to go through and bake each object so it's already done the first one and now it's doing the second one and now that's finished and now it is doing the last one so there we go it is baked all three of the objects so right here in the image editor this is the color map and if I click right here to go back to the UV editing layout I can click right here and make sure that I have this image selected and you can see that the UV editing is matching up with the image so I can go right back over here to the shading workspace and then I want to save this image to a file on my computer so I can click on image and then I can click on save as and then I'm going to rename this image to ax color because this is the color map and I'll just save it as a PNG file and then I will click on save as so that is the color map so we now need to do the other three Maps now because I'm finished baking the color Maps I can select the metal materials and right here on the metallic values I can turn these back to one or if you have some sort of texture going into the metallic value you can plug that back up because we're done baking the color Maps so the next map that we're going to bake is the roughness map so right over here on the bake settings right here on the bake type we want to change this to roughness and then everything else is pretty much already set up we have the images in the materials and we also have the object selected now something that's really important before you bake the roughness map is right here on the color space you need to change this to the non-colored data whereas the color map was set to the srgb now the color map was set to srgb because it was contributing to the base color of the material but any textures which aren't contributing to the color of the material need to be set to non-color here on the color space so right here on the color space make sure you set that to non-color for the roughness texture and then again hold down the shift key and make sure that you have all the objects selected and then you also need to go through each material and you need to make sure that the image texture is selected and if the image texture is selected blender will know to bake to that image so then press Ctrl s again to save the blender file we have the big type set to roughness and so I can now click on bake again and it's going to go through and it's going to bake each material from each object so we can now save this image so let's click right up here on image and then click on save as and then this one I want to rename it from color to roughness so ax roughness and again I'll just save this as a PNG file and click on save as alright so we can now bake the normal map so right here on the bake type we want to click on this and we want to change it to the normal so just select the normal and then again the normal map isn't contributing to the base color so here on the color space we want to set this to non-color so then again make sure that you have all the objects selected that you want to bake and within each material make sure that the image is selected and then you can click on the bake button and bake the normal map and here is the normal map and the baking is finished so I can I click on image and click on save as and this image I want to rename to acts normal because it is the normal map and I'll save this as a PNG file and I'll click on save as so then the last map that I want to bake is the metallic map because one of these materials is a metal material but if none of your objects are metal then you don't need to bake this map and I actually have a separate tutorial on how to bake the metallic Maps if you'd like to check that out I'll have the link in the description now for the metallic map if you go here to the bake type and click on this to change it you can see there isn't actually any metallic value so because there's no metallic value to bake to I'm going to use the emission instead so you can click on emit here emit is short for a mission and then to bake the emission values I'm going to be using the node Wrangler add-on so if you don't have the add-on enabled you can click on edit and you can go to the preferences and then over there on the add-ons tab just search for node Wrangler and just check mark the node Wrangler add-on so now the node Wrangler add-on is enabled I can control shift and select different nodes and that is going to plug the node directly up to the surface and it's going to preview that node on the object and so what you can do is select the material which is metal and you can control shift and select the metallic value to preview it and then that way it's going to bake that value now in this case I don't actually have any texture being plugged up to the metallic value because my metallic value is turned all the way up to 1. so what I can do instead is just make a color value so I'm going to press shift a I'm going to go to the search and I'm going to search for the RGB node and I can actually just plug the color up to the metallic and then I can control shift and select the principled Shader so if you turn the color value all the way up to White it's going to be completely metallic but if you turn the color all the way to Black it's not going to be metallic at all so I want to turn this color all the way up to White so that it is completely metallic and then I can control shift and select the RGB node to preview it so now that it's completely white it's going to bake as is completely white and then that will tell it to be completely metallic now I'm also going to hold down the shift key and select the wood material and the wood material is not metallic at all so for this one I'm going to press shift a let's go to the search and I'm going to search for another RGB node and let's stick this right here and then I can control shift and select the RGB node to preview it and then on the RGB value I want to turn this all the way to Black because the wood material is not metallic at all or you can just control shift and select any image texture if you have an image texture going into the metallic so I now just need to bake the images so again hold down the shift key and make sure you select all the objects and then also within each material make sure that you select the image and that'll tell blender to bake to that image so I need to make sure to select this image here and also on this material I need to make sure to select this image here and then right here on the bake type we have this set to emission and that way it'll bake whatever we are previewing using the node Wrangler and then before you bake this you also need to make sure that the color space is set to non-color because the metallic map isn't contributing to the base color of the material so if you set the color space to non-color on this image it should copy over and set it to non-color for all of the different materials because it's using the same image data so then we can click on the bait button and bake the image and the baking is finished so again you can click on image and you can click on save as and then this image I'm going to rename 2x metallic because it's the metallic map and I'll click on save as alright so we've baked all the image textures so we can now just delete all the materials and then we can add a new material and add all the image textures now just in case there's a problem with debaking and I want to go back to this old material what I'm going to do is click on this Shield button right here and that is going to add a fake user to the material and this way even if I delete the material from all the objects it's going to keep this material data in the blender file so I can go back to it if I want to so I'm also going to select the wood material and then I can click on the shield icon to add fake user so I can now just delete this material and I can click on this object here and click on the x button to delete that material and click on this object here and click on the x button to delete the material so I can now click on the new button to add a fresh new material and I'm going to rename this material to ax baked textures and then I can click and drag and I can drop this material on all the other objects so you can add the same material to all of the different objects so I'm now going to add in the images that we baked so with the printable texture selected I'm going to press Ctrl shift T and when you do that it'll bring up blender's file browser and I can now just select all of the image textures so I'm going to select the color and then I'm going to hold down the shift key and select the roughness and the normal and the metallic and I can now click on the printable texture setup button and this is using a feature of the node Wrangler add-on and so it's automatically going to set up all the texture maps for us and then also on the metallic roughness and normal it is set the color space to non-color because these images are not contributing to the base color of the material and there we have it so now these three different objects are all using the same material and again if you'd like to download the free project files then you can do that on my gumroad store and my patreon page with the links in the description and if you'd like to learn more about texture baking in blender then definitely check out my texture baking tutorial playlist with the link in the description and if you'd like to help support me and this YouTube channel I will have links in the description to where you can support the channel on my gumroad store and my patreon page and the YouTube memberships and I do appreciate all of your support but I hope you found this tutorial helpful and thank you for watching
Info
Channel: Ryan King Art
Views: 79,524
Rating: undefined out of 5
Keywords: Ryan King Art, Blender Tutorial, Blender, Ryan King, Tutorial, texture baking, blender baking, bake textures, texture maps, battle axe, 3d model, texture bake, blender, tutorial, bake multiple materials to 1 map, bake multiple objects to 1 map
Id: eE7FedDW2AI
Channel Id: undefined
Length: 18min 40sec (1120 seconds)
Published: Mon Dec 19 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.