How to Unwrap and Bake Textures in Blender 2.8, 2.9, 3.0, 3.1 and 3.2?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video I want to show you how to UV unwrap and bake textures in blender and then import those into unity we're gonna do that for a couple reasons one I think it looks a whole lot better and two it's gonna allow us to reduce the number of materials that we have in unity and so just like the last video where I reduce the number of game objects before importing to unity if I can reduce the number of materials unities happier still the fewer materials that the rendering engine has to deal with when you're playing your game the happier and faster it's going to run so that sounds interesting let's get started so before we get into the nitty-gritty I want to show you what I've got set up so this is the same file that I was working on in the previous blender video on the Left I've got a low poly tree this is the original tree it's in lots of different chunks on the one in the middle here this is the one that we've joined and all the modifiers have been applied there's no modifiers acting on individual objects and if I go over to unity you can see that I have saved that blend file in the unity project you can see the two trees here you can also see the camera and the lights that are present in the blender scene okay so let's get down to the nitty-gritty here of what we need to do first thing we need to do is we need to open up a few new windows now this was I think I may be a little bit easier to do in the old versions of blender so the first thing I want to do is open up two new windows one is gonna edit the shader or the nodes and the other one is going to have the UV map or the UV unwrapping in it so I'm gonna come down here it's a little hard to get to you so when I mouse looks like that with the two arrows I'm gonna right-click and I'm gonna split the area and it's gonna let me choose where I want to split it it's a bit like that and then I'm gonna come to this one here right click split area and I'm gonna split this one in half then the one on the top this is going to be the shader editor the one on the bottom is going to be the UV editor like so so the next thing we need to do is UV unwrap this object and if you're new to this idea basically what we're gonna do is we're going to take all the polygons on this tree and spread them out on a flat surface so that we can map a texture to it so basically we'll have a PNG file with all the colors and the computer can look up on that PNG with U and V coordinates what color it should be displaying at that given pixel in unity so with the tree selected I'm gonna press tab to go into edit and then I'm gonna press a to make sure that I've got all the vertices selected then I'm gonna come down to the UV menu and then I'm gonna choose the light map pack now I really like this approach to UV unwrapping for low poly models if you're doing something more sophisticated something more realistic this is probably not the best way to do it but for low poly models this works great and what this is going to do is take all the polygons and the computer is gonna figure out how to arrange them to fill up the space as accurately or as completely as possible that way we get the highest resolution the best looking texture that we can for a given size so I'm gonna click on that and then we got some options here we got image size and again this is the bigger you habit and the longer it's gonna take to bake eventually it's also going to take up more space more memory when you're running your game I think for my purposes I'm gonna go to 1024 again best if your image size is a power of 2 for unity unity is gonna be a lot happier and then the pack quality this is effectively how long the computer takes and thinks to figure out how to get all the pieces to fit so you can maximize the amount of space taken up by the polygons or in other words minimize the amount of wasted space no texture this goes for I believe from 0 it goes up to 48 now if you have a really complex model you gotta be careful with how high you set this it can take several minutes to unwrap a large terrain or a large building in this case because I have a really simple tree I'm gonna go all the way up to 48 and then this margin this is basically how much space is between the various polygons I find the default a little small so if you go up to point 13 or even point 16 that really prevents any kind of bleeding of colors from one polygon to the other I'm gonna press ok and over here in my UV editing window I'm gonna go to new and I'm just gonna call this branched tree texture and I wanna make sure it's the common same size what I did and press ok and when I do that you can now see all the all the polygons from the tree have been flattened and mapped on to this texture so that's the part of UV unwrapping we've done that we've done the UV unwrapping now one thing to know that's different here in blender 2.8 is we no longer have the blender render now that was my preferred way of baking low poly models in older versions of blender it wasn't the fanciest but it got the job done and it looked good enough that no longer is part of blender 2.8 so we're gonna be using the cycles engine which is why we needed the shader or the node editor in the top left but before we can bake this we're going to need to add something to each of the materials so I'm gonna go over to my material tab so I've selected my leaf material now if you're doing this with a more complex model you're gonna have to do what I'm doing here with each of the materials in your object so I'm gonna come over here to the editor I'm gonna shift a to add and then search and I'm gonna type in image now I want to add in the image texture I'm gonna zoom in there a little bit so you can see a little bit better of what's going on and then I need to tell it what image texture to use and I'm going to choose the texture that I just created that branched tree texture and then I'm gonna do the same thing over with my trunk I'm gonna select the same image because we're gonna be baking both materials onto the same texture onto the same PNG file now if you don't do that you're gonna get a warning about something about a missing texture or missing image it's pretty opaque it's pretty hard to figure out what they mean this is what they're talking about so I want to share a couple settings here and the materials before I move on to the baking that I like to use to make it look a little bit better this totally personal preference but I want to show you a few of the settings that I like to adjust and I've imported this model from an older version of blender I think that's why I'm seeing this option here of use notes if you're seeing this you want to click that and it brings down all these options and here you can change this shader in my experience the principled psdf is the one that I want now for me I don't like low poly stuff that's shiny so I'm going to turn down the specular come down here to the emission and I'm going to change this so it emits a little bit of color and I'm going to select the same color is the base color but then I'm gonna turn it down a bunch something like that and what that does what that does is that effectively makes all the faces emit a little bit of color and it makes any sort of dark crevices or dark shadows a lot less prevalent and not as obvious so I'm gonna repeat that process with the leaves as well so what the material said I'm gonna go up to this tab right here which looks a little bit like the back of a camera I'm gonna click on that now we need to make sure that the renders engine is in cycles by default it should start in the Eevee render engine but we wanna make sure that we're in the cycles render engine if you're in there Eevee render engine you won't be able to bake there will be no bake option so we've got to be in the cycles engine so if you go down you can see this baked option down here there's a bunch of baked types here and for the most part the combined option is the most important one are the one it's gonna bring in most the detail into a single texture now if you want to break it down into smaller chunks you can do that and there may be reasons to do that but for now I'm just going to leave it at combined so I'm gonna press bake and this is gonna take a little while you can see that there is a progress bar at the bottom it's no longer at the top of blender and blender 2.8 is now at the bottom and with the cycles engine this is gonna take a little while even with a fairly simple model like my tree so when that gets done we'll be able to see the results on the bottom left and I'll fast forward this and I'll get back to you when it's done okay so there we go the baking is done now if I go back into edit mode you can see that all the polygons of the faces are lined up and you can see on the texture that each polygon has its own color and there's some different textures going on there's some lighting there's some shade it's a little bit more interesting than just a truly flat shaded low-poly style so we've got the UV unwrapping done we've got the baking net we're gonna take one further step to help optimize what we're doing and make it run a little bit smoother in unity so I'm gonna go back to object mode and I'm gonna duplicate this tree one more time and I'm gonna slide it over here and this is the process that I use this is kind of a workflow that I use in a lot of my blender projects here I will have three models I'll have one that's the raw original model I'll have one that's combined with no modifiers and then I'm gonna have a third and on this third one what I'm gonna do is remove the materials and then I'm gonna add in a new material I'm gonna call it branched tree like so and the reason I'm doing this is because now because I have all my color material mapped to my texture map to those PNG file I don't really need individual materials in unity to represent those different colors I just need one material and so again if you have three or four trees not a big deal but if you have maybe 20 50 or a hundred different models in your unity scene and they all have four or five or ten different materials that can be a real performance it so with that done I'm gonna save this file and again remember this file is saved into my unity project and you can see down here on the image there's an Asterix there I need to save this in as well this PNG file this texture does not get saved as part of the project so I'm going to save as just like I did before I'm going to navigate to my unity project and drop this into the assets folder with that done I'm going to move over to unity it's gonna think a little bit and you'll notice what's happened now I now have a third tree here in my unity scene as well as here is that texture that we baked before so I'm then going to right click create a new material and I'm gonna call this branched tree and then in that branch tree on the albedo channel I'm gonna drag in that texture that we baked in blender I'm gonna turn the smoothness down because I don't really like the smoothness and then I'm gonna drag this onto that tree now you'll notice that the trees pretty bright it's really kind of shiny almost and what I often find is I need to turn down the albedo color I'm gonna turn it down like so and now already I think that looks better it's softened it up it's looking a little bit better you may have to adjust the colors a little bit to get to look just like you want but I think that's already looking far better than the other two trees so let's go a step further I'm gonna turn on the emission and I'm gonna drag in the branch tree texture into there again and you'll see again it gets super bright so we're gonna turn that color down and what this does if I turn all the graph you can see that the shadows are really dark and if I turn the submission on just a little bit I lighten up those shadows I think it looks a lot better so there you go I've shown you how to unwrap and bake textures in blender and import those into unity I hope that was interesting and better yet I hope it was useful for you in your game development projects if it was think about hitting that like or subscribe button if you want to go even further in supporting the channel check out the links to my patreon and discord server in the video description below until next time happy game designing you
Info
Channel: One Wheel Studio
Views: 145,861
Rating: undefined out of 5
Keywords: Indie Game, Unity3d, Blender, Low Poly, Unity Tutorial, UV Unwrap, Import to Unity, Blender 2.8, Blender Unwrap, Blender Bake Texture, blender 2.8 bake, blender bake, blender to unity, blender 2.8 baking
Id: c2ut0Trcdi0
Channel Id: undefined
Length: 12min 17sec (737 seconds)
Published: Sat Aug 24 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.