How to Texture Bake Procedural Materials in Blender (Tutorial)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this tutorial I will show you how to texture bake procedural materials in blender and then at the end of the video I'll be showing you a really great blender add-on which makes texture baking so much easier and speeds up the baking workflow now if you're a regular viewer of my channel then you know that I create many procedural material tutorials and I actually sell all of my procedural materials on my gumroad store in my patreon page so if you'd like to purchase any of my procedural materials I'll have the links in the description and what's so cool about procedural materials is that they don't use any external image textures they just use the procedural textures and the procedural nodes in blender to create the material and because these types of materials are procedural they're also very customizable so you can for instance change the scale and the size you can change the colors and you can change the material settings to make it look exactly how you want so procedural materials are very cool but the downsides of using them is that they only work in blender so if you want to use the material in something like a game engine or maybe upload to skin sketchfab or use it in another 3D software then the procedural material isn't going to transfer over into another program so to use a procedural material in another 3D program you'll have to bake out the material to texture maps and that's what I'm going to show you how to do in this video now the process of texture baking procedural materials works just like any other texture baking process and if you haven't seen my texture baking for beginners tutorial I'll have a link in the description where you can check that out you can also check out my texture baking tutorial playlist to watch all of my texture baking tutorials but I get a lot of questions about this in the comments of my videos so I thought I'd make a specific video on how to texture bake procedural materials so for demonstration I'm going to be using my procedural dented metal and I created a tutorial a little while back on how to create this material so if you'd like to check out that tutorial and create this material to follow along I'll have the link in the description you can also purchase this material on my government store and my patreon page links in the description to that as well but you can really use any procedural material and follow along with this tutorial now I'm going to be baking this material to an object but if you want to bake your procedural material to tileable seamless texture maps that you can use on different objects that I actually have a separate video on that and I'll have a card right up there on the screen and the link in the description if you'd like to check out that video but in this video I'm going to be texture baking the material to this object so the first thing that we need to do is create an image that we're going to actually bake the textures to so I have the 3D viewport right over here and then I have the Shader editor right here so to create an image here in the Shader editor I'm going to press shift a let's go to the search and I'm going to search for an image texture and I can just drop it right up here above the principled Shader and then I want to click on the new button because we want to create a new image that we can bake to so I'll click on new and I can just rename this to dented metal and then on the width and height here I want this to be a 4K texture so I'm going to 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 change this to 4096 by 4096 6 and that is the resolution of a 4K texture but you can change this to whatever resolution you want I'm going to go with 4K and then we can leave the color black because we're going to be texture baking over the image and then I can click on ok now the next step to texture baking is that we need to UV unwrap the object because we need some way for the 3D mesh to be placed on the 2D image texture so that blender knows where to bake the material onto the image so with the object selected you can click right over here to go to the UV editing layout and if you don't have a UV editing layout you can click on the plus here and then go to General and you can open up UV editing so let's go to the UV editing layout and then I can zoom into the object and you can see it's going to take us into edit mode and then right over here is the UV editor so if I press the a key I can select all the UV editing now if you'd like to learn the basics of UV unwrapping then you can check out my UV unwrapping for beginners tutorial with the link in the description but when I'm doing texture baking I usually just use the smart UV project so in edit mode with the object selected I'm going to press the U button and then I can just do the SMART UV project and then right here on the island margin I do want a little bit of space in between the islands so there isn't any overlapping so I will turn my Island margin to a .01 and then click on OK and that will be fine for texture baking now there are a few things to keep in mind the first thing is that you don't want the UV Islands to be going out of the boundary of the image because if they're going out of the boundary of the image texture then there's going to be problems with the baking and if you don't see the black image that we added in the background you can scroll over and click right here and then you can just select the image that we added now another important thing is to make sure that there's no overlapping of the islands and you can see because I added that Island margin there is no overlapping of the islands and then the other really important thing is to make sure you're using as much of the image as possible so you want to scale these islands up so they're as big as possible without going outside of the boundary of the image because if you use more of the image space then it's going to use more the pixel size and so the final bake texture will be higher quality but you can see that there's a lot of extra space right up here and so these are all pixels in the image that we're not using so depending on the shape and size of your UV Islands you could press the a key to deselect everything then you can hover your mouse over the islands and press the L key to select the linked vertices and you could move the island and you could like scale it up so I think I will do that just so it's a bit bigger and then press the L key to select the island to kind of scale it up you basically just want the islands to be as big as possible and so by moving the islands around I was able to scale them up a little bit so they are a little bit bigger so now let's go right back over here to the shading layout so we can now go over the bake settings so right over here on the side panel we want to go right up here to the render properties and right here on the render engine you want to make sure you're using Cycles Render because the EV rendering engine doesn't support baking now if you are using EV that's totally fine you just need to switch it to Cycles then do the texture baking and then you can turn it back to EV once you're done so just make sure it's set to cycles for now now if you open up the San sampling tab right here on the render samples you want to turn the render samples to one because if you turn the samples down it's going to bake faster but it won't affect the quality of the bake so you can just turn the sample all the way down to one and it'll bake faster and let's close the sampling and we can now open up the baking Tab and right here is where we have all the bake settings I'm going to be baking the base color because we do have some data going to the base color I'm also going to be baking the roughness and then I'm also going to be baking the normal and then because this material is made of metal the metallic value is turned to one so I'm also going to be baking a metallic map now I want to be able to see the image texture once it's finished baking so what I'm going to do is move my mouse right up here when the Crosshair appears and I can click and then drag down to split the window and then I can click right here to change the editor type and I'm going to change this to the image editor and then if you click down here on the drop down you can select the dented metal so then when it finishes baking we'll be able to see it updated here so now let's go over the bake settings so I want to bake the color map first so right here on the bake type I'm going to click on this and I want to change it to diffuse and diffuse is the same as Albedo or color so this will bake the color map now right here on the influence 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 lights and Reflections that the material has but I don't want to bake the lighting data I just want to bake the base color so I'm going to turn off the direct and indirect but leave the color on now something that's really important to remember when you're baking a material which is made out of metal is that before you bake the color map you need to make sure the metallic value is turned to zero because if the metallic value is turned up when you bake the image any values which are metallic are going to look really black and it's going to mess up the bake image texture so if you have any value plugging into the metallic you need to just unplug it from the metallic on the principle and you need to make sure that the metallic value is set to zero before you bake the base color now we're baking the color map and the color map is contributing to the base color of the material so right here on the dented metal image I want to make sure that this color space here is set to the srgb but when we're baking the other Maps like the metallic and the roughness and the normal those other Maps aren't contributing to the base color of the material so we want to change those to non-color but for the color map we want the color space set to srgb so then before we bake this we need to make sure that the object is selected and make sure that the image is selected and we have this set to diffuse and so I can now click on the bake button and there's a loading bar right down there and it shouldn't take very long and there it is so it has already finished so there is the color map and so whatever data was going into the base color that was going to bake so now I can save this image so I can click right up here on image and then I can click on save as so in my project files I've just created a folder called texture maps and I'm just going to save this as dented metal but then I'm going to rename it to color so I'm going to add the color there at the end of the name and I will just save it as a PNG image but you could also save it to jpeg if you want to and then I will click on save as so now that we've finished making the color map we can turn the metallic value back up so I'm going to turn the metallic back up to one or if you have any data which was plugged into the metallic value like a texture you can plug that back into the metallic value so the next map that I want to bake is the metallic value so if I click here on the bake type and I look down here at the drop down you can see there isn't actually any metallic value so to bake the metallic value I'm going to use the emission instead so just click on emission and then before I go any further I do need to enable the node Wrangler add-on so if you don't have the node Wrangler enabled you can click on edit and you can go to the preferences and then over there in the add-ons tab you can just search for node Wrangler and just check mark the node Wrangler add-on so the add-on is built into blender and I'll show you how to use it in the video so now that the node Wrangler has enabled you can hold down the control and shift key and then you can select different nodes and that is going to plug it directly up to whatever node you clicked on so if you have a node which is plugged up to the metallic value on the principled Shader then you just need to control shift and select that node and because the bait type is set to emission it's going to bake whatever we are previewing using the node Wrangler now for this material it is completely metallic so I don't actually have any value which is going into the metallic so instead what I'm going to do is press shift a and I'm going to go to the search and I'm just going to search for an RGB node and then we can take the RGB color and we can put that into the metallic so the RGB is just one single color value so if I turn the RGB to fully white it's going to be completely metallic so because this material is completely metallic I'm going to turn the RGB to completely white and then I just want to control shift and select the RGB node to preview it so this way it'll bake completely white and then that way it'll be completely metallic now what's also really important here on the dented metal is that you take the color space and you change this to non-color when you're baking the metallic map because the metallic map isn't directly contributing to the base color it's going to be going into the metallic and so we do want to change this to non-color so that is very important for the other Maps so then just make sure that you have the image selected make sure that you have the dented metal selected we have the bait type set to emission and then I can click on the bake button and if your material doesn't have any metallic values you can just skip this step you don't have to bake the metallic map so it has now finished so I can now save this image so let's click right here on image and then click on save as and then this one I'm going to save in the same folder but I'm going to rename it to dented metal metallic and then I'll just save it as a PNG image and click on save as so that is the metallic map so now that we're finished baking the metallic map I can click on the RGB and I can press X to delete it and then I will control shift and select the principled Shader so I can now bake the roughness map so right here on the bake type I'm going to change this over to the roughness and so if we change this to roughness it's going to bake any data which is going into the roughness value and then again what's really important is to make sure that the color space is set to non-color for the roughness map so then just make sure the object is selected and make sure the image is selected we have this set to roughness so I can now click on baked again and it has now finished so here is the roughness map so again I'll click on image and then I can click on save as and then this one I'm going to rename to dented metal but I will take away the metallic and I'm going to write roughness instead so dented metal roughness as a PNG image and I will click on save as alright so we just have one more to bake and that is the normal map so right here on the bake type I can click on this and I'm going to change it to the normal and so it's going to bake any data which is going into the normal of the principled Shader so then again make sure that you have this object selected and right here on the color space we want this to be set to non-color for the normal map and then make sure that this image is selected and then you can click on the bait button and while we're selecting the image is because that's telling blender what image it's going to bake to and and it finish so there is the normal Maps then to save this you can click here on image and you can click on save as and then this one I'm going to rename this to dented metal normal so I'll get rid of the roughness and I'll just rename this to normal and I'll save this as a PNG image and I will click on save as alright so we baked all the maps so I can now just delete this material and I'll create a new material and add in all the maps so just in case I want to go back to this material I'm going to click on the shield icon right here and that is going to set a fake user so even if we delete this material from any of the objects it's going to keep this material data in the blender file just in case if I need to go back to it and rebake anything so I can now 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 now I'm going to be using a feature of the node Wrangler to automatically set up all the texture Maps so with the printable texture selected I'm going to press Ctrl shift T and Ctrl shift T will bring up blender's file browser and then I'm going to go into the folder with all of the texture maps that I baked and then I'm just going to click and drag to select all the texture maps and I can click on the printable texture setup and it's automatically going to set up all of the texture maps for us now one problem here for some reason it actually added in the normal map and I don't know why it did this I think this is just a bug using that feature of the node Wrangler so what I'm actually going to do is just click on the exit button here to get rid of this metallic image and then I'm going to click on the open button to open up the correct image and then here is the correct image so it's the dented metal metallic so I can just click on this and then click on open image and then again what's really important is that the color space here is set to non-color and make sure that the color space is set to non-color on all of the image textures except the base color the base color needs to be set to srgb because it's contributing to the base color of the material but all the other images should be set to non-color so there's the material with the baked textures and you can see it looks just like the procedural material that we started out with now that overall all process was pretty complex because we had to remember to add the image texture we had to remember to set the color space to non-color we also had that little issue with the metallic value where when we're baking the color map we have to turn off the metallic values that doesn't mess up the base color and we also had to bake each image individually and we also had to individually save each image after it was baking so this entire process does take a lot of time and it can be quite confusing and so this is where the quick Baker add-on comes in so the quick Baker add-on is a really great blender add-on for speeding up your texture baking workflow and it does pretty much everything for you so it automatically sets the color space correctly it automatically fixes that metallic issue when we're baking the color map and it makes all of the maps at once and it also saves all of the images automatically to your computer and I actually have a dedicated review video on how to use the quick picker add-on so if you'd like to check out that review video I'll have the link in the description and also in the description I will have some affiliate links to where you can purchase the add-on on the blender Market as as well as gumroad and so if you purchase the add-on through my links then I will earn a small commission and that's a great way to help support me and this channel so I brought back the procedural material on this object and what I'm going to do is press the N key to open up the side panel and once you've enabled the add-on you're going to click right down here on the cue Baker that is the quick Baker add-on so it's right here on the side panel after you enable the add-on so I now need to add a bait group so I'm going to click on the plus here to add a big group and then I'm not baking High poly to low poly I'm just baking the image textures so I can just uncheck the high to low and then I need to add an object to bake so I'm going to click on the plus here to add a new object and then I can click on the eyedropper and I can just select the object that I want to bake so we can now go right down here to the maps and I can just add all the maps that I want to bake so I can click here on ADD and I can add the Albedo that's the same as color or diffuse I can also click on ADD and add the metallic and I can click on ADD and add the roughness and then the last one that I want to add is the normal now now right here you can choose where you want the add-on to save the image textures so I'm just going to click on this file icon right here and then I'm going to create a new folder and I'll go into this folder and then click on accept so when the image is bake the add-on is automatically going to save the image textures and then right here you can also choose some of the settings so I'm going to change this to 4096 because I want to bake to 4K and also right here on the format I also want to set this to PNG and there are a few other settings that you can change and then before you hit the bake button you do also need to make sure that the object is uvan wrapped so if you haven't already you've unwrapped the object you can go over to the UV editing and you can UV unwrap the object and I did already cover you van wrapping earlier in this video so I can just go back here to the shading Tab and then it's as simple as just hitting the bake button and so it's going to go through and bake all four image textures and it will save all the image textures to your computer and the baking has finished so I'm now just going to delete this material and then I will add a new material and add in all the maps so I'll press the n key to close the side panel and then right over here if I go to the materials I can click on the x button to delete this material and I can click on the new button to add a new material so then just like I did before I'm going to use the feature the node Wrangler to automatically set up all the texture Maps so I will select the principles Shader and then I can press Ctrl shift T and then I can just locate to the folder where the add-on has saved all the image textures and I can just click and drag to select all the images and then I can click on printable texture setup you can see it's going to set up all the texture maps for us so we have the base color the metallic and the roughness and the normal and so as you can see this add-on saves so much time because you don't have to fiddle around with all the different settings and it also bakes all the images at once and saves them all to your computer so if you'd like to purchase the add-on then I will have affiliate links in the description to where you can purchase the add-on on the blender Market as well as gumroad and those are affiliate links so if you purchase the add-on through my links then I will earn a small commission and that's a great way to help some support this channel so that is how you texture bake procedural materials in blender so I hope you found this helpful and thank you for watching
Info
Channel: Ryan King Art
Views: 30,819
Rating: undefined out of 5
Keywords: Ryan King Art, Blender Tutorial, Blender, Ryan King, Tutorial, texture bake, procedural materials, texture baking, baking, texture, material, shader, bake, texture baking for beginners, bake procedural materials, procedural shaders
Id: B2kFeMBBBjc
Channel Id: undefined
Length: 19min 6sec (1146 seconds)
Published: Mon Jan 30 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.