Texture Baking for Beginners (Blender Tutorial)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this blender tutorial i will show you how to do texture baking for beginners so there are many reasons why you might want to bake your material to texture maps in blender you might want to import your 3d model with your material into a game engine or you also might want to use it in a different 3d software or you also might want to upload your 3d model with the material to sketch fab or your material may not work in a different rendering engine like maybe you've created a material in cycles render but then you want to switch it over to blender evie and have the same look or maybe your material is just very complex and you want to bake the textures so that the performance is better so there are many reasons why you might want to bake your materials out to texture maps in blender so that's what i'm going to show you how to do in this video now probably the main reason why you'd want to bake your material out to texture maps is because you want to use it in a different 3d program or a game engine or sketch fab but you may be using some amount of procedural materials like for this material here i am using a procedural musgrave texture and also a procedural noise texture and these are procedural textures in blender shader nodes but because they're procedural they only work in blender and so if you want to use this material in a game engine or a 3d software or another program the procedural materials won't carry over to that other program so you have to bake out the material to texture maps and then you can use it in a different software so that is a common reason why you'd want to bake out your textures to texture maps and this material here is a procedural dirty metal material and i have a tutorial on how to create this procedural dirty metal material so if you'd like to check that out i will have the links in the description and i'm going to be using this material as an example for the tutorial and this procedural material is also available for purchase on my gumroad store and you can also get access to it on my patreon page and speaking of my gumroad store and patreon page tutorials like these are made possible thanks to my gumroad customers and my patreon supporters and my members on the youtube memberships so if you'd like to help support me and this channel i will have links in the description to my gumroad and my patreon and the youtube memberships those are all really great ways to help support me and this channel and if you find this video helpful and you'd like to give me a little tip you can also use the super thanks feature here on youtube and i do appreciate your support so in this tutorial i will show you how to bake the four most common texture maps and those are the color map the metallic map the roughness map and the normal map now the color map the roughness map and the normal map are the most common ones but i did also want to cover how to bake metallic maps because metallic maps are a pretty common material because you're going to use metallic maps for any material which is made out of metal and when you're baking metallic maps you do need to use a specific workflow because there are some common problems which can come up when baking metallic maps and so in this video i will show you how to properly bake metallic maps and of course if your material isn't using all of these maps then you don't have to bake all of them so if your object isn't made out of metal and you aren't using any metallic values then you won't need to bake a metallic map or maybe you're just trying to bake a really simple material and the material is only using a color value then in that case you could just bake the color map and also after this tutorial if you'd like to learn more about texture baking and learn how to bake some more maps like for instance displacement maps and emission maps and some other different maps baking textures from one uv map to a different uv map or baking multiple materials to a single texture map if you'd like to learn any of those things then you can check out my blender texture baking tutorial playlist after you watch this video alright so the first step to texture baking is we need to create an image to bake to so i am in the shading tab right here and so i have the 3d space here so i can preview the material and i'm in the rendered view and then right over here on this side i have the shader editor so in the shader editor i'm going to press shift a let's go here to the search and i'm going to search for an image texture and let's drop the image texture right here just above the principled shader so we need to create an image that we can bake the textures to so i'm going to click on the new button right here and then on the name i can just rename this to dirty metal now the width and height here is going to change the resolution of the texture and on default it is 1024 by 1024 and that is the standard resolution for a 1k texture for this material i want to bake a 4k texture so what i'm going to do is click and then drag down and then let go and this way i can change both values at the same time and i'm going to type in 4096. so 4096 by 4096 is the standard resolution for a 4k texture but you can of course change this to whatever you want whether you want to do like an 8k texture or just like a 6k texture or a 4k or even just like a 2k texture you can just change this to whatever resolution you want to bake the textures to now for the color here we can just leave this to fully black because the baking is going to bake over the image and then i can just click on the ok button so we have now created an image that we can bake to now we need to tell blender how the 3d object is going to be placed on the 2d texture and so to do this we need to uv unwrap the object if it hasn't already been uv unwrapped now to do this you could go over to the uv editing workspace but i'm instead just going to click right up here when the crosshair appears and i can click and drag down and that's going to split the window and then if i click right here to change the editor type i can change this to the uv editor and then i want to load in this image that we've added so if you click right here on the drop down you can just add the dirty metal so this is the blank black image that we've created and in the 3d space if i press the tab key to go into edit mode you can see that the default suzanne head has already been uv unwrapped so if your object already has a nice uv unwrap you can just leave it how it is but your object may not be uv unwrapped so i'm going to show you how to do a basic uv and wrap for texture baking so just press the tab key to go into edit mode and press the a key to make sure all of the vertices are selected i'm now going to press the u button and then i'm just going to use the smart uv project that'll work fine for texture baking so i'm going to click on the smart uv project and then we do need a little bit of space in between the islands so on the island margin right here i'm going to turn this to a .002 so .002 and then click on ok and so by using the smart uv project blender is going to do the best job that it can to uv unwrap the object and to preview this in full screen i can hover my mouse over the uv editor and then i can press ctrl spacebar that's going to go into full screen so here is the uv editing of the object now if you zoom in here if you zoom in closely you can see there is some space in between all of the different uv islands and so we definitely want some space because if the uv islands are overlapping then there will be problems when we do the texture baking and it won't look correct so that is why i turned up the island margin to just a small amount just to make sure all the islands do have a bit of space in between them and there's no overlapping and this is just a quick and simple uv unwrap but if you'd like to learn more about uv and wrapping in blender then you can check out my uv unwrapping for beginners tutorial i'll have a link to that in the description now i do just want to double check that there isn't any overlapping so i'm going to press the a key to deselect all the uv editing and then i can click on select and i'm going to click on select overlap you can see there are a few things which are overlapping so we can fix these and this is actually really easy to fix so what i'm going to do is click right up here and this is going to go to the face select mode you can also just click on the three button on the top of your keyboard and then i'm just going to zoom in here and i can just select this face and i just want to move this face out into a free area so i'm going to press the v key and the v key is going to rip the faces and so it's going to separate it into its own island and then i can click to place it there and if you want to move it again you can press the g key and then move this around and then just place it so i can now press the a key to deselect everything and then i can click on select and i'm going to click on select overlap again so i can just zoom in here and select this face and i can press the v key that'll rip the faces so it's its own island and i can just stick it somewhere here in kind of a free area and if you just have a few uv islands you can also scale the uv islands up so if the uv islands are bigger then they're going to be able to use more of the texture space and so if you can you can scale some of the uv islands up so it actually has more pixels and that way the final texture maps will be higher quality because they're using more of the pixels and then once again select and select overlap and there's just one more here so just select this face i can press the v key to rip the faces bring it over here and i could also scale it up a bit alright so i can click on the back to previous or i can press control spacebar to minimize that so we now have a decent uvan wrap for the texture baking and again if you'd like to learn the basics of uv and wrapping in blender then definitely check out my uv unwrapping for beginners tutorial now it may be that you also have some image textures in your material and those image textures might be using the uv editing of the object in this case i am just using these procedural textures and these procedural textures are using the object coordinates so they're not actually using the uv mapping but you may have some image textures in your material and those image textures might be placed on the object using the uv editing and so if your material does have some texture maps and you re-uv unwrap the object then it might mess up the placement of those textures and so if that's happening for your object then you should check out my video on how to bake textures from one uv map to a different uv map alright so i'm going to press the tab key to go back to object mode and we can now go over the bake settings so i'm going to click right up here to go to the render properties now right here on the render engine it is important that you use the cycles rendering engine because the ev rendering engine doesn't actually support baking so if your blender file is in eevee you can totally use eevee after you've baked the textures but first you need to change the render engine over to cycles and then do the baking and then once you're done with the baking you can change it back to blender eevee now if you open up the sampling tab right here you can go to the render samples and i like to use a render samples of just 10 because if you use less samples then it's actually going to bake faster but i found that just turning the samples to 10 won't affect the quality at all the texture bake will still look fine but the textures will bake much faster if the samples are turned down so i just use a sample count of 10. now on the device here i have a gpu in my computer and my gpu renders a lot faster than my cpu so if i use gpu it's also going to bake faster so the baking will work with both your cpu or your gpu if you have a gpu so you can just use whichever one you would normally render your images with so if you are in the cycles rendering engine you can scroll right down here and you will see that there is a baking tab and i'm actually just going to click and then drag up and just drop it right up here so that it's higher up and then i can click on this to open it up so the first texture that i'm going to bake is the metallic map and i especially want to cover the metallic map in this video because a lot of people can have problems with baking the metallic material so in blender if you try to bake any textures with a metallic value when you bake the textures the texture is going to be fully black and it's not going to bake correctly and so if you are baking a material which consists of metal you need to make sure the metallic value is turned all the way down to zero then you can bake all the textures and then once the texture baking is finished you can turn the metallic value back up to one or if you have a texture which is plugged into the metallic value you need to make sure that is unplugged and make sure the metallic value is turned to zero now back over here to the bake settings if you click on the bake type you can see that there are different options to bake to so there's the diffuse one and this one is used to bake the color maps there's also roughness and there's also normal but there isn't actually any metallic value to bake to so to bake the metallic map i'm going to use the emission so you can click on the omit and that is short for the emission now to continue i am going to be using blender's built-in node wrangler add-on so if you don't have the add-on enabled you can just click on edit and then you can go to the preferences and then over there in the add-ons tab you can search for a node wrangler and just check mark the node wrangler add-on so the add-on is built in a blender and i will show you how to use it in the video so now that the node wrangler add-on is enabled you can control shift and select different nodes and that is going to add a viewer node and it's going to preview the node on the object now if you click right here on the arrow to open up the viewer node you can see that the viewer node is actually an emission shader so if we click on the bake button with the bake type set to emission it's actually going to bake whatever the viewer node is previewing so i can control shift and select this color ramp and this color ramp here was going into the metallic value so this texture here is telling it where it's going to be metallic and where it's not going to be metallic so again just make sure you turn the metallic value all the way to zero on the principled shader and then make sure you control shift and select the texture which is going into the metallic value now it may be that your material isn't using a texture in the metallic value you might instead just be using a metallic value and so if you're just using a single value then instead of baking to a texture we just want to bake to a color so to do this i'm going to press shift a i'm going to go here to the search and i'm going to search for rgb and we're just going to add the rgb node and then real quick i'm just going to ctrl shift and select the principled shader again and what i can do is i can plug the color into the metallic value so now if you look at the material if i turn the rgb all the way up to fully white it is now a fully metallic material but if i turn the rgb all the way to black it's not going to be metallic at all so if you have a material which is fully metal you just want to turn the rgb all the way up to fully white and then i just want to unplug the metallic value so this metallic value is set to zero and then you can control shift and select the rgb node and that way the viewer node is going to preview a fully white color in my case though i am using this color ramp so i'm going to ctrl shift and select the color ramp alright so there's just a few more things before we actually hit the bake button right here on the viewer node you need to make sure that the strength is set to 1 because if the strength value is turned up higher than 1 or lower than 1 that's actually changing the value so just make sure the strength is turned to 1 on the viewer node but it should be set to a strength of 1 on default now the next thing that i need to do is turn the image texture's color space to non-color so right here on the color space make sure you turn this to non-color and you want to do this before you bake the textures for any textures which aren't contributing to the base color so for the color map you're not going to do this but for all of the other textures you want to set this to a non-color because if you don't set this to non-color if you just leave it at the default of srgb then it's not going to bake the correct values and so your final texture bake will look a bit different and then the other thing you need to do is make sure the correct object is selected and that way blender will know what object it needs to bake and then also here in the shader editor you just need to make sure that the image texture is selected and this way blender will know what texture it's going to bake to and then before i click on the bake button i'm going to press ctrl s and that'll save the blender file just in case for some reason if blender crashes we won't lose our progress and then i can click on the bake button and so right down here you can see there is a progress bar and how long it takes to bake will depend on the power of your computer all right and the baking is finished so i'm going to press the tab key to go into edit mode and then i'm going to press ctrl space bar with my mouse hovered in the uv editor so i can see this in full screen so you can see that blender has baked the metallic values to the uv editing and if i zoom in closely you can really see the importance of having that space in between the islands because if the islands were overlapping then it would texture bake over the island and so then there would be some problems and the bake wouldn't look correct and you can also see that when it bakes it gives a little space here in between the bake and the island so that is important that you have some space there between the islands so i'm just going to press ctrl spacebar again now if this island margin spacing is too big and you want to make it smaller you can change that so right over here on the bake settings if you open up the margin the default size right here is set to 16 pixels and so most of the time i just leave this at the default but if for some reason you want to make the margin smaller you could turn this down so for instance i could just turn the margin size down to like an 8 and then again make sure the object is selected make sure that the image is selected and then i can click on bake again and it finished and if i press the tab key to go into edit mode you can now see that that island margin is much smaller so an island margin of 8 is fine so i'll just leave that to 8. all right so we now just need to save this image to our computer because if we don't save this as an image file to our computer then when we close blender blender is not going to save the image data so to save this to our computer let's click on image and then i can click on the save as and then i'm just going to save this in a folder on my computer and i'm going to rename this to dirty metal metallic because this is the metallic texture so i'm going to make sure to put the metallic at the end of the name there and then if you want to you can leave it as a png image but i want to make the file size a bit smaller so on the file format here i can just change this to jpeg and then i'll just turn the quality to 100 and then i can click on save as image so that is how you bake the metallic map alright so the next map is the color map now for the color map i don't want to use the viewer node so i'm just going to control shift and select the principled shader just to preview the principled shader again now as i mentioned earlier if the metallic value is turned up or if anything's plugged into the metallic value then when you try to bake the textures it's going to look fully black and it's not going to bake properly so while we're baking the other textures we need to keep the metallic value turned to zero but then once we're done texture baking we can turn the metallic value back up or you can of course plug in the metallic texture now if you go right over here to the bake type i want to bake the color map so i'm going to change the bake type to diffuse and so the diffuse is going to bake whatever is going into the base color of the principled shader so if i control shift and select this color ramp this is the color map and so this is what it's going to bake so i can control shift and select the principal shader now because this is the color map this image is going to be going directly into the base color so on the color space here i want to change this back to the default which is srgb now if we go right back over here to the bake settings there is this influence tab right here and if i open this up you can see there is direct indirect and color now if we leave the direct and indirect on it's actually going to bake the lighting data as well and in this case we don't want it to bake the lighting data we just want it to pick the color because we're going to use the lighting in the 3d scene to actually light the object so on the contributions right here we want to turn off the direct and indirect we just want it to bake the color map and then again before you hit the bake button make sure that the correct object is selected and make sure that the correct image texture is selected and we're going to use the same image texture so we are going to bake over this image texture but then we'll save it to our computer as a different image texture so make sure the object is selected make sure the image is selected this is set to diffuse here on the bake type so i can just click on bake again and it didn't take very long and it is finished so here we are here is the color map so then to save this map you can click on image and you can click on save as and i'm going to save this in the same folder with my other metallic map but instead of calling it dirty metal metallic i want to rename this to dirty metal color and then again i'll just save it as a jpeg image and i can click on save as alright so it is now time to bake the roughness map so to bake the roughness map over here on the bake settings we want to click here on the diffuse and we want to change this to roughness and then because the roughness values isn't going into the base color we need the color space here to be set back to non color so then again make sure that your object is selected make sure that the texture is selected we have the bake type set to roughness and the color space is set to non-color and then we can click on bake again and it finished so this is the roughness map so it baked the data here which was going into the roughness of the principled shader so then to save this image we can click on image and then click on save as so again i'm going to save the image in the same folder with my other textures but i'm going to rename it to dirty metal roughness so there we go dirty metal roughness and then i'll save it as a jpeg file and i will click on save as all right so the last one that we need to bake is the normal so i have this noise texture going into the bump and then this bump is going into the normal so right here on the bake type i can change this over to normal and so if this is set to normal it's going to bake whatever data is going into the normal of the principled shader now again right here on the color space we need to make sure this is set to non-color because the normal values isn't contributing to the base color so then just make sure the object is selected make sure that the image texture is selected we have the bake type set to normal and it is set to non-color and then i can click on bake again and it is finished so this data here is the normal data so we can save this image just like the other images so let's click on image and then click on save as and then one more time i'm going to save this in the folder with my other textures but instead of it being called roughness i'm going to save this to normal so dirty metal normal and then i will click on save as and that is it so the texture baking is now finished so let's press ctrl s again to save the blender file and then if you were using the eevee rendering engine you can now change this back to eevee because we are done with the baking so i'm now going to delete this material and we're going to add a new material and then we're going to plug up all the textures now just in case if there happens to be a problem with the texture baking and you want to go back to this material i'm going to click on this little shield icon right here and this is going to give the material a fake user so this way even if i delete this material from the object it's going to keep this data in the blender file and that way just in case if there's a problem with the baking i can go back to this and rebake it so now that i have this set as a fake user with the shield icon i can click on the x button to get rid of this material and then i can click on the new button to add a new material and i can just rename this to like baked textures so now we need to add in all the image textures now you can manually add them all in and plug them all up but there is actually a feature of the node wrangler add-on which will add in all the textures for us so with the principled shader selected and with the node wrangler add-on turned on i can press ctrl shift t and when you do that blender's file browser will come up and then we can just select all the image textures so just go into the folder where you have all the image textures and i'm just going to click and drag and select all of the image textures so we have the normal the roughness the color and the metallic and it is really important that these textures have those in the names because the principled shader is actually going to look at the names and it's going to use the names in the image textures to properly set up the material so i can now just click on principled texture setup and you can see that blender has automatically set up all the texture maps for us so it's added these mapping nodes right here and it's using the uvs and that's just telling the material that it's going to use the uv mapping and then that is being plugged into all the textures and then also something to notice is that the base color is set to srgb because it is going into the base color but the metallic the roughness and the normal are all set to non-color on the color space because they are not directly contributing to the base color and then also to convert the normal map into normal data the node wrangler has also added the normal map node and it's plugged that up correctly and then also for some reason if i ctrl shift and select this for some reason it added in the normal map and the metallic so real quick i'm just going to manually change this so i'm just going to click on the file icon here and then i'm just going to select the metallic texture and click on open image and then i just want to set the color space here to non-color and then i can control shift and select the principle shader and so that is now correct so now this is a baked texture but it looks just like the procedural material that i created and now that the textures have been properly baked you could use this material in another 3d software or you could upload it to sketchfab or use it in a game engine so that is it that is how you do texture baking in blender and if you'd like to learn more about texture baking and blender then definitely check out my blender texture baking tutorial playlist with the link in the description and if you'd like to help support me and this channel to help me keep on creating blender tutorials and blender content then i will have the links in the description to my gumroad store and my patreon page and the youtube memberships and i do appreciate your support but i hope you found this tutorial helpful and thank you for watching
Info
Channel: Ryan King Art
Views: 132,227
Rating: undefined out of 5
Keywords: Ryan King Art, Blender Tutorial, Blender, Ryan King, Tutorial, texture baking, baking textures, texture baking for beginners, beginner texture baking, ryankingart, texture bake
Id: Se8GdHptD4A
Channel Id: undefined
Length: 25min 27sec (1527 seconds)
Published: Fri Sep 09 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.