Manual Lightmapping Fundamentals | Blender - UE4

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
eh what's up everyone and welcome to the light mapping portion of our organic low polygon basics course let's get started as we learned in the texturing portion of the series that there are multiple ways to create textures for these low polygon assets there's a standard version which is where you actually create a texture image like we have here in our left UV map area and that method is typically used for assets where you can actually create textures that have some sort of visual appealing effect and in many cases that would also include the PBR standard mapping which would have normals roughness reflectiveness and so forth and there's also the material only method which doesn't require a texture image and only the materials with the diffuse color set to them that method is actually very useful for these low polygon models so in this video I will demonstrate how you'll need to do this next process for your light Maps with both methods because that is important and since we are doing a basics course it's good to show you both because we are going to advanced in later series where we start talking about actually texturing and substance painter and we're gonna need these core fundamentals and at least understand them at the most simplistic level so that we can bring those assets into ue4 too and we understand what we need to do in terms of creating additional UVs and such and so we'll start the light map tutorial off talking about how we would create our light map from our textured material so if you have a material with the texture applied to it like we do here then you're already using one UV map to do so ok so in this scenario where you do have an actual texture you're gonna have to go ahead and create an additional UV map and the way you do that is by traveling here to your object data okay and it's associated with this little triangle and we'll come down here where we see UV maps and you see we already have this default UV map which has been created so what we'll do is we'll create a additional one by clicking this plus button here and what that does is it literally just copies over the original UV map that you've created once we have that additional UV map created we're just going to rename it so that we understand what it is we're going to call it light map this doesn't really matter when you bring it into other programs like Unreal Engine 4 it's just going to refer to this as UV 0 and this will be UV map 1 but for us inside blender we want to know what it is so we're not confused and we're always making sure we have the right one selected we're just going to call it light map now once we've done that we can just go ahead and select everything with a a making sure that we're in edit mode here in our 3d view which we are and once we've select all the faces we're just going to go ahead and control E and we're going to mark all seams and we'll just do that by saying mark seen what that's done is it's marked everything ok now what's important to understand here is that when you're doing light Maps a light map is essentially just another UV similar to the current UV that we have here for our texturing but there's some things that are very important about light Maps light maps can never have overlapping anything essentially ok so you can never have a island like this would be an island ok and here's another island you can't have them overlapping you also can't have faces okay which are demonstrated by a little dot we have here so you can't have any faces overlapping other faces and also you don't want any faces connected together that are not on a single flat plane okay because that will cause bleeding which will happen and so what you'll have here is in between these two faces that have obviously are not planar meaning they have two different angles you're going to have a bleed if these are connected so that's why we're dicing everything up by marking everything with a seam now we are going to get rid of some seams here because we know that these that are cut up with tries are actually all on one face that face it has its own shadow okay so we can go ahead and combine those and we'll talk about that in a second one thing we can do that's really important also is we can go ahead and select all these faces here by holding shift and right clicking and making sure that we have all those faces that are on that singular flat plane one good way to check to make sure that it is flat is going to rendered mode if you go into world settings up here and you were to make sure you have environmental lighting on you can typically see if you have any faces that are you know causing issues here and this all looks very flat one thing we can do to make sure and basically guarantee to ourselves that it's flat it is when we're in solid mode solid view here we can select all those faces and we go down here to mesh and we will go to clean up and we can say make planar faces so that'll make all of those tries they're planar with each other making them on a singular plane and actually we didn't select them all let's make sure we select them all and we got mesh clean up and make planar faces okay and so we could do that for each one of these making sure that we are only selecting that face and we just you know mesh clean up and make planar faces again making them on a single plane alright I've already done it for all these so there's really no need to demonstrate it but you would also do it for this one as well if you needed to now that we know that those are all planar we can go in and hit ctrl tab select edge and we can go ahead and just shift right click all these edges that are inside of that plane and on that plane okay so as you can see here these are only in here to create tries for us we did that in the other video but what we can do here is once we've selected these we just hit ctrl E and clear the scene alright and the reason is is these should all be together on a single island alright because they are a single plane they're going to share a shadow together all right so there's no need to take up more space in our new map that we've created over here called light map there's no need for us to take out that space and we'll see what that's going to look like here in a second as we start to create that light map which is totally different from our current mapping for our texture we'll just come in here to each one of them and we're going to select all the edges that are inside that plane and we have all those there and we're just hit ctrl E and clear seam we'll do the same on this one over here and control e clear scene and so now we see that we don't have any edges marked with the seam that are on a single plane meaning that this entire plane here is completely flush okay it's an entirely flat surface together with all those triangles so we want to keep all them together that way when we do chop it up we have them on a singular Island over here now everything else is angular okay so each one of these faces here every one of these tries is essentially pointed in a different direction okay in the world space so it's important that those are all kept you know that each one of these edges does have a scene because we want to cut them into separate islands all right there is this down here so we could draw E and clear scene and that's just gonna clear up more space for us over here so we have it more optimized we've got everything that is on separate planes okay so facing separate directions in world space all marked with seams everything that is on a single plane is does not have a seam so basically this cut will go around this entire triangle here and this will be on an island over here now what we can do is we're just gonna go hit a a to select everything and we're going to hit you for unwrap and we're just going to do a normal unwrap there's a light map pack and I'll show you what that does real quick you could say that the image size was going to be 128 and we could set our margins for 128 I'll touch base on this in a second but is I believe Oh point zero one five all right and see this doesn't actually give us the appropriate margins there's actually an issue with light map pack that does that and the other problem with light map pack is that it does not take proportion into consideration which is very important for game design and your light map the proportion of each one of these triangles is very important because if we have different proportions between let's say this triangle in this triangle okay and especially like this small triangle in this triangle the shadow that's going to be baked in the Unreal Engine onto this and this needs to be proportionate so that the difference in the shade is you know effective so that actually looks appropriate otherwise you have some blotchiness it just would not look right this whole thing could turn up shadowy if it was really small for example when it's only supposed to have a shadow you know across this top portion you can really only understand that with practice and seeing the next few steps but we'll just continue on from there and just let you know that doing a light map pack is not the appropriate method for creating a light map for a game engine okay and it's because of proportions these are all basically just sized up so that they can fit as much information inside of this you know power up to square here you know whatever that may be 128 256 and so on and it's just packing it in there as tightly as possible based on the margins that you've set so without proportion we have junky light maps and game engines so what we want to do is we'll select everything and forget about light map pack which we're never going to use again and we'll just say unwrap and now we see with unwrap that where we have removed those seams or these triangles we have single islands and that's okay because this island will share a shadow together okay so that's why we want to do that and what that does is it allows us to optimize the amount of space that we're actually using over here okay most important thing with this is that we see over here margin let's talk about margin when you do an unwrap okay so if we unwrap right when you do the unwrap you have the option to set the margin and that's the amount of space in between each one of these islands here what's really important about that is that when you're baking your light map in the engine it's going to actually bake the shadow quite a bit farther out from the island okay and the reason is is if the shadow cuts across here okay it doesn't make sense to just bake the shadow image only to the bounds of this polygon here and the reason is is because then you don't have this perfect shadow that runs off where it's supposed to okay and so the solution to that is that when it bakes the light map it actually bakes it much larger not much but about a pixel larger and and really depending on the size of it you know we're gonna do 128 by 128 pixels for this tree because that's about what's appropriate typically should not have to go much higher than 128 128 and if you had like a not so detailed object or just had a few faces or they were all perfectly flat faces you might even get away with 64 by 64 but that all really depends on how small of polygons you have you know the smaller polygons like we have here these are going to have issues with a 64 by 64 light map there are a few things we could do to solve that but that's a lot of trial and error and in this basics course we're not going to get too in-depth into that so we're gonna shoot for a 128 by 128 ok and as you can see here we've selected everything hit unwrap and now we have the margin the way that we determine how much of a margin we need is actually with a calculator now the way this works is based on the amount of space that you're going to be using in our case we're going to shoot for 128 by 128 pixel size light map we're gonna take 1 divided by 128 that equals that number there now we're going to multiply that by 2 and that gives us this point 0 1 5 the reason that this number is important is because this is basically calculating based on the way that the Unreal Engine does its light mapping and how much space it's going to take up around these actual islands here for baking that on this number is determining for us a safe range based on 128 by 128 pixel if we were to change that to 64 we would get an entirely different number so we would say 1 divided by 64 times 2 and then that would give us the appropriate margin space that we need so that 1 divided by 128 is actually telling us the amount of space around each island that the light map is going to bake when we multiply by 2 we're giving enough space for two islands next to each other so that their light map is not baking overtop of say the corner of another island here and if that happened that would cause some bleeding so we would get this weird shadow that's actually coming off of this other Island onto this island and so we don't want that so that's why we're taking 1 dividing it by 1 twenty-eight which is our entire pixel squared light map sighs we're done a 128 light map and now we're multiplying a by two to get the appropriate spacing between each Island so we get point zero one five so now when we unwrap here we say unwrap we know that in the margin we can put point zero one five like that and that's the actual margin space we need for baking now Unreal Engine actually creates a two pixel exterior around your light map here so you actually don't have to worry too much about that but it is good to just make sure that you don't have it right up on the edge and the margin will automatically do that for you so this is fine another thing we can do is we can hit control P over here and repack it when we hit control P it allows us to reset the margin so if we actually unwrapped it we messed up one fix to that as we come back over here control P repack it and change our margin now one thing you may notice here is that we still have this texture image that we were working with as our background that's not really a big deal it's just using the image the only image that exists here okay we could create a new image if we wanted and we could tell it to be 128 by 128 and it's set to black and we could just call it light map if we wanted and that would just alleviate that pain of us seeing it and the way we change that is just select everything and then we would go to light map so that's what it would look like on a 128 by 128 again that doesn't really matter because if we control P impact this again we know our margins are set based on that calculation we did of 128 528 so the margins are already set for a 128 by 128 sized image all right and one thing you also may notice is that even though you have this second light map that if you were to render it you may see you know your image here would look all crazy ok and that might be annoying to some people so the way you change that is you just make sure the texture is only being applied for your original map ok and so that would take away that annoying imagery for you so now that we have this set up for the proper margin okay that we've calculated and we know that it's set up for a 128 by 128 image again we don't have to create this background image that I did we could just have it on this image does not matter this image in the background as we talked about in texturing is just a reference image it has nothing to do with your actual model it's just so you can reference and see where your islands exist on top of your texture image that you apply to your material over here now as far as setting up our light maps we are essentially completely done for this low polygon model there's really nothing else we need to do we have appropriate spacing here margins between our islands we've set up our islands so that faces that are on a single plane that are completely flush and flat like these here are in a single island that's really all we need to do now as we mentioned in the texturing course that there is the other method of texturing which for this scenario of doing these low polygon objects that have these single colors like such where we have this whole upper area being green and this being brown and there's really no actual texture to it we really should be doing this with the other method okay and the other method is a material only the material only based method just reiterate does not apply a texture okay so we just have a material and what we've done is we've essentially selected all of the upper triangles for the tree that we want green and we've assigned a material that we created here we assigned that material with a diffuse color of green and we did the same thing for the trunk we've selected the entire trunk and we assigned a new material by creating it here assigned it and set a diffuse color of brown okay and so we can do this with these low polygon models and you should do this with these low polygon models the main reason we're touching on the other method for you know actually texturing the models is because this is a basics course and we do want to focus on the basics okay and so we touch on all that but for the remainder of this video series we will always be using the material only method okay because that just makes sense and what's important about this is that we won't need to have to UV maps here okay just need the one UV map as you can see here and we do everything the exact same way that we just did in the video for the texture version except we only have one UV map if you appreciate the content you can help support this channel on patreon.com slash toxicity gamedev make sure you hit that like button subscribe if you want to see more there's a lot to come peace [Music]
Info
Channel: Toxicity Game Dev
Views: 14,205
Rating: undefined out of 5
Keywords: low polygon, modeling, blender, ue4, unreal engine 4, unreal engine, learn blender, learn unreal engine, level design, level design ue4, learn game dev, learn game development, learn to 3d model, lightmaps, lightmap, lightmap blender, lightmaps ue4, lightmaps unreal engine, lightmaps unreal engine 4, light maps, light mapping, game development, learn low polygon modeling, blender modeling, low poly, blender basics, game asset design, game, tutorial, design, lighting, bake, light
Id: yXi-e_ALnRs
Channel Id: undefined
Length: 18min 21sec (1101 seconds)
Published: Tue Oct 24 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.