Texture Baking in Blender for Beginners (Tutorial)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone this is ryan king and welcome to this blender tutorial where i'm going to show you how to bake textures in blender so there are a few different reasons why you might want to bake textures you may just want to take like your procedural materials and turn them into a texture map and then you can plug that in and that way you don't have to use all the procedural nodes and also if you have like a model and you want to use it for maybe like a video game so you want to put it in a game engine and within blender maybe you created the asset and you have like some procedural nodes maybe you have some image textures and you've like edited them and changed the colors and stuff or maybe you want to upload your model so that someone else can use it with a different 3d software or maybe you want to upload your model to something like sketchfab something like that in those cases you're probably going to need to bake your textures into texture maps because blender's procedural nodes and all blenders like nodes that you can do editing with like for instance rgb curves or noise textures or things like that that data within blender doesn't work with other 3d software and it also doesn't really work with like a game engine or things like that so when you're using procedural nodes or if you have a big node setup for your materials if you want to import it into a game engine or a different 3d software or something like that you're going to need to bake your textures and i'm sure there are other reasons why you might want to bake your textures but those are the main reasons so i created this dragon model right here and you can see i baked the textures and that way i was able to upload this on sketch fab and everything looks correct if you want to see the model on sketchfab i'll leave the link in the description but when i was first creating this material i used some different things like for instance i used the pointiness value within blender to kind of get those dark places in the crevices i also used like a noise texture on his skin different things like that and those things wouldn't work in other 3d software and they wouldn't work when like previewing them in sketch fab and if you were going to put them in a game engine they wouldn't work as well so i baked this out and as well as baking the color i also baked the normal map and that way you can see that there is normal data so that like the edges can bump out and the little scales there look like they have normal and then i also baked a roughness map as well so that i have data to tell it where the dragon's going to be more shiny and where it's going to be more rough so in this tutorial i'm going to show you how to bake out all the maps that you need and then replace them for your original material setup just a couple things i wanted to mention before we get started if you'd like to help support this channel the best places to do that over on my gumroad store and my patreon page and on my gumroad and patreon i have the tutorial files i also have artwork project files procedural materials and i also have different 3d models and assets that i sell over on my gumroad and patreon and also if you'd like to help support me monthly here on youtube i have the youtube memberships so if you click on the join button down below next to the subscribe button you can join my memberships and you'll get some cool perks and also help to support me monthly so those are a few ways to help support the channel if you'd like to help out and one last thing before we get started i want to thank sketchfab for sponsoring this video sketchfab is a 3d model site where you can preview 3d models in your browser you can even view them on a phone tablet or in ar and vr they also have a huge 3d model store where you can purchase models and assets you can even apply to sell your own models on the platform check out sketchfab with the links in the description all right so in this tutorial i am going to be baking out textures for this procedural rock material that i've created now if you'd like to watch the tutorial on how to create this procedural rock shader i'll leave the link in the description if you'd like to watch that video so basically what i did is i used like some different noise textures and things like that to create this procedural rock texture but as i said this isn't going to work in like a game engine or a different 3d software or something like that it's not going to work because these kind of things only work within blender so you have to bake out texture maps if you want to preview this material in for instance a game engine or another 3d software or something like that and as you can see there are three different values that are being plugged into this principle shader there is the base color there is the roughness and there is the normal so i'm going to be creating three texture bakes for this material so the color roughness and normal now if your material has other things like for instance an emission if maybe it has some emissive places on the material then you could do that as well i'll show you how you can do that but the main ones that you're probably going to be using are base color roughness and normal and also if you just have a base color you could just do that as well alright so let's go through all the steps that you need to do to do texture baking so the first thing that i'm going to do is i'm going to click right here and i'm going to drag down and that way this is going to split the window i'm going to click right up here and i'm going to change this to the uv editor because the first thing that we need to do is we need to actually make an image texture and then tell blender to bake it onto that image texture so to make an image texture you can click on the new button right here now the name you can call this whatever you want i'm going to call it rock color because this is going to be the color map for the rock so i'm just going to name it rock color now the width and height here this is a 1k texture on default if you want to turn this up you can you could really just change this to whatever you want i would recommend that you keep the width and the height the same but if you just want changes to like 2 000 pixels 4000 pixels 5000 pixels whatever you want to do i want to make a 4k texture that is pretty standard so to make a 4k texture i'm going to click on the top one drag down and then let go and what this is going to do it's going to allow us to change both of the values at the same time now to make it a 4k texture right now it's a 1k texture so to make it a 4k texture i need to times this number by four now you can actually do that in blender very easily what you do is you hit the little star button and then you click on four so on my keyboard the star button is on the top of the numpad and also if i press shift eight that also makes the star come up and that's basically just telling blender to times it by the next number and the number is four so i'll hit enter and that is the resolution of a 4k texture a square 4k texture so if you want a 4k texture you could just type in 4096 by 4096 or you could just type in anything that you want or you could also like look online and find some texture resolution so if you want like a 2k texture whatever you want to do you can just look those up but if it doesn't matter to you then it's totally fine you can do whatever you want you could just type in 4000 pixels by 4000 pixels but i want a 4k texture so i'm going to type in 4096 by 4096. now the color here this really doesn't matter i'm just going to leave it as the default which is black because when we texture bake this it's going to bake the texture over the top of this so it doesn't really matter what color it is and then i'm just going to leave these all at default and i'm going to click on ok so now if i just zoom out here we have created this rock color texture all alright now the next thing that you need to do is you need to uv unwrap this mesh onto your image because if you've ever just downloaded an image texture online and you've plugged it into your material you're going to need some way of uv unwrapping the texture onto your object now this is a procedural texture so in this case i use the object mapping but because we're going to be baking this into a texture and then plugging it up we need to properly uv unwrap this so if you have like a prop or a character or something and maybe you've added seams and actually uv unwrapped it then that's totally fine i'm just going to show you a very easy way to uv unwrap an object if you haven't properly uv unwrapped it already so what i'm going to do is just go over to the uv editing tab and then what i'm going to do is select everything and i'm going to press u and then i'm just going to click on the smart uv project now the island margin i'm going to turn this up to like 8.01 just that each island has a little bit of space and then i'm just going to click on ok so now i can zoom in here and you can see here is our uv unwrap now i also just want to click on this and just click on the rock color just that i can see it on the uv map not super important but i just want to see it underneath the uv map so again if you have like a character or a prop and you already properly uv unwrapped this that's great but for something like this i just did the smart uv project now there is one really important thing with the smart uv project and that is you need to make sure that there aren't any overlapping vertices because if there are overlapping vertices then there's going to be some issues where the overlap is when you bake the texture so to make sure this isn't a problem you can just press a and a just to make sure everything is deselected and then i'm going to click on select and i'm going to click on select overlap now nothing was selected that's because nothing is overlapping but if there was some parts that are overlapping you just need to kind of move it around and place it nicely on this uv layout so just make sure you have a decent uv layout and then let's go back over to the shading tab so where those uvs were placed on our rock color that is where it's actually going to bake it on to the color map all right the third thing that we need to do is we need to actually add this rock color image into our material but we don't want to plug it up because we still want this procedural material to be plugged up so we just want to kind of add it and just stick it right here in the material so i'm going to press shift a and i'm going to search for an image texture and i'm just going to drop it right here and then you could click on new and add a new image if you haven't added one already but we already added one so i'm going to click right up here and then i'm just going to click on this rock color to add it in alright and then just make sure that your object is selected and then just make sure that the rock color image is selected and then i just have this up here so that when it finishes texture baking i can just see what it looks like all right so now we can really get on with the texture baking settings so there's a few things that we need to do the render engine if you have that set to eevee it's not going to work because ev doesn't support texture baking so you're going to need to change this to cycles now if you have this set to ev that's totally fine once you're done texture banking you can turn it back to eevee if your scene was an eevee but just turn it to cycles for now while we're texture baking and then when we're done you can turn it back to ev the other thing is that if you're rendering with your gpu if you have a gpu uh the texture baking isn't gonna work and so you're gonna need to change this to cpu so i render with a gpu because i have a gpu and so it's a lot faster to render with gpu but i'm just going to turn it to cpu while i'm texture baking and then when i'm done i'll turn it back to gpu alright so then right down here if you scroll down uh this is right here on the render properties you can see that there is a bake right here so if i open this up these are the bake settings so there's just a few things that we need to do before we actually bake this so the bake type on default i believe it's set to combined and we don't really want this because what that's going to do is it's going to bake whatever this looks like right here so it's actually going to like bake all the lighting and everything now we don't actually want to bake the lighting we just want to bake the color the roughness and the normal and that way when you add this into like a game engine or use it on a different 3d software or whatever you do it'll actually interact with the lighting because if we bake it with combined it's just going to bake all the lighting here like bake the shadows and everything like that and in this case we don't want that there may be cases where you would want that but i do not want that so instead of combined i want to change this to diffuse now diffuse is the same as color so diffuse and color they're pretty much the same thing we're going to bake the color so basically what's ever going into the color if i i have the node wrangler add-on turned on so if i just ctrl shift and click on this and then go into the material preview basically that's what we want to bake because that is the color map so it's going to create a bake of that and then we can just plug it in instead of using all these procedural nodes now the other thing here is this influence uh there is this direct and indirect we want to turn these off because again it's going to do the same thing where it's going to like bake the lighting and that's not what we want we just want it to bake the color so i'm going to set this to diffuse and then set that to color now before you click on bake it's a really good idea to go file and just click on save again because sometimes blender can crash so just make sure you save this and then really important make sure that the object is selected make sure that in the materials make sure that this is selected and that way blender will know what image to bake to because you have this selected and then just set this up how you want and then you're just gonna click on a bake and you can see right down here um it may go really quick or it may take kind of a long time it really depends on how complex it is and also depending on how big this image is if it's like a really really big image it's going to take a while and if this is kind of really complicated then it will take longer you can see this is taking a while it's only at two percent um and that is because this is a little bit complicated and is kind of detailed and this is also a 4k texture so it will just take a little bit um i am just going to skip over until it's done all right and it just finished so you can see if i zoom in here that looks really great there is our color map so now what we need to do this is really important you need to make sure that you save this as an image file on your computer because if you just close blender then blender isn't going to save this so you just have to save it on your computer just like if you downloaded a texture online or something like that so to save this you can just click right over here on image and then just click on save as and then i'm just going to save this as rock color png you could also just save this as a jpeg if you wanted to but i will just click on it save as and save that alright so that is finished now so now we need to do is we basically just need to do the same thing for the other textures so i'm going to click right here and exit out of this and then also exit out of this so now we need to make another texture so you can click on the new button right here or the new button right here i'll just click on new and then this one again i want to be the same resolution and this one i'm going to call it rock roughness so there we go rock roughness and then just leave that at the default and i'll click on ok with a 4k texture so now we have that and then right here i can click on this and then just go to the rock roughness and that way once it finishes we will be able to see it right here and then again make sure this is selected and make sure your image is selected and then if we don't change anything here it's just going to use the color so we need to tell it to bake the roughness of this material so click right here and we are going to change it to roughness now there are a bunch of different ones here if you like have an emission you could use a mission if you have the normal which we're gonna do after this you can change it to normal there's a bunch of different things here so just choose the ones you need i'm gonna do roughness next and then remember just go file and save this again and then just those two really important things make sure your image is selected and make sure this is selected as well and it has the rock roughness selected and then you can just click on bake and there we go it's starting to bake so i will jump over to when this is finished all right and the rock roughness map finish so there we go it looks really good so again we just need to go to image and then click on save as and you can see here are the other textures that i'm using so here is the rock color and i'm going to save this one as rock roughness dot png and we will just save that all right so that is great now the last one that we need to do is we need to do the normal and so that is the bump right here so it's going to create a normal map so what we need to do is just do the same things we're going to exit out of this exit out of this we're going to click on new and this one i'm going to call rock normal because it is a normal map rock normal and then the same thing at 4k texture and i'm going to click on ok and then right here we can just add in the rock normal and then just make sure that these are both selected and make sure that is at normal and then we're gonna click on bake one more time all right and it finished so we have a nice normal map and this looks just like a normal map that you'd get if you downloaded like a texture from a texture website so let's just click on image and then we'll just click on save as and again just like my other files i'm going to save this as rock normal and just save that all right so with that done now i can just unplug these and i can actually set up my images so i'm just going to unplug the roughness unplug the base color and the normal i'm just going to press b for the box select just box select all these and just move them over for now you could delete them if you wanted to i'm just going to move them over here so now i just need to set this up like i would with regular textures you might download online so i'm just going to shifty this drop it here and then shifty this and drop it right here because we have three of them now i'm just going to click on this right here and this one i need to be the rock color and then this one right here i need to be the rock roughness and then this one right here i need to be the rock normal now the rock color the color i'm just going to put that in there and let's just also let's just change this back to gpu rendering and then i'm going to go into rendered mode and if you want to change this back to ev you can do that as well so the rock color i'm just going to plug that in and there we go and you can see because we uv unwrapped that the uv and wrap is where it needs to be right on the texture so there we go and then the roughness will plug that in now with any texture that isn't contributing to the color the color space we need to change this to non-color so there we go change that to non-color so that it works properly and then the normal here we also need to change that to a non-color and then we can plug this up to the normal here now you can see that there are some problems here and that's because we need to press shift a and we need to add a normal map node so it converts it properly and now that we've set that up all properly you can see there it is and it looks just like the procedural texture so i'm just going to close this now so there we go looks like the rock texture but you can see that it is actually maps instead of the procedural textures and so then if you wanted to you could just select these and delete them and now you just have a regular material setup and so this could be used in like a game engine you could also upload it to a website like sketchfab or it could work in other 3d softwares because it has the data that it needs and other 3d software or game engines can use this data so that's it that is the basics of how you do texture baking in blender i hope you enjoyed this tutorial and thank you so much for watching and if you'd like to help support this channel i will have links in the description to my gumroad and patreon if you'd like to help support the channel but again thanks for watching and i hope you found this video helpful and i will see you in a future video
Info
Channel: Ryan King Art
Views: 24,557
Rating: undefined out of 5
Keywords: Ryan King Art, Blender Tutorial, Blender, Ryan King, Art, Tutorial, bake, texture, baking, texture baking
Id: eYvgFWEiNp8
Channel Id: undefined
Length: 18min 15sec (1095 seconds)
Published: Sat Jun 12 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.