Trim Sheets in Blender and Unity - What are Trim Sheets and How To Use Them?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello welcome to this video in today's video i'm going to be showing you how to use trim sheets within unity um using two separate uv channels so we can have one for the trim sheet and one for kind of overlaying details on the top such as these this sort of emission ring and this kind of grunge map that goes over the top and you can see here in the kind of instance that we've got a grunge strength which changes the kind of strength of the grunge on the barrel we've got we can make it tile to make it more detailed or less detailed we can control the emission intensity of this ring on top and finally if we move the barrel you can see that the grunge map will move in kind of world space that means as we dot these barrels around the grunge will be kind of different and dependent on kind of each barrel move them over we've got our grunge here and finally um if i just undo all of this uh i'll very quickly go over how to make it so the emission from said barrel the emission from the barrels actually cast light into the scene on a baked light map yeah let's just jump straight into it this is the trim sheet i used for this example i got it on sketchfab i'll put the link in the description below and you just want to hit download download the 3d model and then just unpack that unzip it and you can get the textures out of it so the first thing you want to do is you want to bring in a plane and this is going to be our uh this will just we can get our trim sheet set up on this just to make sure it's working and then we can make the barrel so for this let's just um i'm going to make a new shader i'm just going to call this trim sheet 2 and make sure you've got the node wrangler add-on enabled which you can do under edit preferences add-ons and just search for node wrangler i'm going to click the principal bsdf and then press ctrl shift t to bring up our file view and i'm going to select all of these images and then click principle texture setup and that's not gonna work i've just added a new uh scene let's try that again so we'll bring in a plane get up the shader editor make a new material ctrl shift t modular wall textures select a lot of textures there we go that's brought in all of our textures and it set it up just how we need it and we can go over to material preview and we can see our plane here with our trim sheet on it and you can see that it's got this 3d effect even though it is just a flat plane so before i go any further i'll just give a quick explanation as what a trim sheet is so if we open up um our uv editor here and bring up kind of this image so you can see that this image has got a strip of like panels it's got this brass kind of copper wiring and it's got this kind of section which is quite nice and it's got these panels with the screws on them and if you look at the normal map for this each area is clearly defined and it's got um some height data and this corresponds to this here and we can use this to make low poly geometry have quite specific trim sheets and it just means that we're not having to do high poly assets for every single item so if i was doing a crate and a barrel and i i knew they'd have shared things like the pipes and these panels i could just do the crate and the barrel using the one texture instead of making a separate barrel and a separate crate high poly and then baking those maps to their own individual texture sets and this also helps with things like game engines where we can reduce the kind of use of textures and keep the file sizes low keep memory consumption low and just make it a lot more optimized by using this by using this kind of um technique and finally for independent developers obviously it's a lot quicker to be it's just quicker to do this uh to do it this way um that might not make a lot of sense to people if you're new to trim sheets but you'll see exactly how it works in just a second so we've got our plane we've got our material set up i know that's all working nicely i'm just going to drag this over here i'm going to go over to make sure i'm still in the uv editor i'm going to delete our plane and then i will add in a cylinder we'll go into front view and we'll just scale this down scale it up there and then do s shift said also control just to get more of a barrel kind of shape and i'm just going to ctrl a and apply the scale to that just to make sure we've got the scale right and then i will go over to the material tab and then i will add in our trim material to it so i go over to render mode you can see here that it's all just a bit of a mess at the minute i'm just going to shape that smooth come over here to our normals click autos move so we can see at the minute our uvs we've got this row of uvs which is the barrel all the way around you see as i move it around it kind of shows the barrel in different places and then we've also got the tops which are these so what i'm going to do instead um i'm just going to go back to solid mode and i'm going to just make the barrel look kind of a bit of a nicer shape so i'm going to grab the top and bottom faces and press ctrl b to bevel i'll chamfer it like this and then i'll i'll give it a kind of with the scroll wheel give it a nice smooth bevel got a cylinder like that now on the top i'm going to inset these faces i'm just going to extrude them inward so i'm going to press e and then right click to kind of leave them where they were i'm going to press s and z and just snap them in slightly like this okay so now we need to make geometry uh to map to our barrel here so the first thing i'm going to do is i'm going to just select everything and just drag the uvs off here and i'm going to put a seam just down the back here so i'm going to select this back edge loop uh i did that private alt click the edge loop right click mark seam and we want to mark and in facelike mode i'm going to select both these faces go to edge mode mark those seams as well so now and you don't need to make seams for everything you can just select kind of these edge loops and then you could press u and just unwrap just those [Music] and then over in the uv editor i'm going to press n and i'm going to use an addon called uv squares this is a free add-on you can download it for free over on github i'll make sure this is linked in the description below as well and what uv squares allows us to do is we've got this obviously round shape but we want it to be flat and square to match to our trim sheet here so i'm just going to click to grid by um shape and that's just going to flatten out our grid here oh and i'm just going to go over to material mode just so we can see what happens here so i've got our ring in and what i want to do is i want to map it to this brass area so i'm going to press s and y to shrink that down s y shrink that down a bit more scale it up on the y again a little bit and then sx and just bring this in s x let's go up so it matches and if it goes edge to edge there we go we can see now our top band has got this pipe on it if we want to we can press sy kind of take a bit more of the black that's either side of it in i think for now that'll do um well i've been flipped upside down there i was looking at it from underneath um what i'm gonna do i'm just gonna do the same again for this row of faces i'm going to get all of those and the same i'm going to press u unwrap to grid by shape r 90 and i'm just going to bring this down over here to the trim sheet press s y scale it in sx scale it in okay so we've got our metal barrel kind of the loop there and now what i want is i want in the middle somewhere i want to get these this strip of faces um so i put an edge loop in by pressing ctrl r scroll up and then i've got these faces here i'm going to press u and unwrap oh and then i'm just going to bring these over here they should fit kind of quite perfectly there so we've got this strip of detail here i think i just need to move these up slightly okay so now i'm going to get the top here again you unwrap and i'm going to put this to be kind of these these tiles here i'm just going to make sure to get the kind of the beveled edges in like that so we've got our panels um if we wanted to we could scale them up on the x to make them bigger panels or stretch around but i'm just going to leave them like that for the sake of this and then with our ring of panels here i'm going to press u unwrap a r90 and then i'm going to bring this over here and i'm scaling this up on the y so now we've got this panel here and then i'm going to get the ring of interfaces on both sides you unwrap and we can actually stack these on top of each other so shift them over grab them all r90 and then i'm going to put them here i think scale them up so that's just this inner lip here and then for the top and bottom what i'm going to do is i'm just going to bring them over scale them down and i'm just going to put them kind of i'll put them on top of each other and then just scale them down just so they fit on this plain bit here so now you can see that we've got this plain kind of top barrel top and i'm not a massive fan of this in a bit so i'm just gonna get those edge loops let's see let's um could always move them down here get some more of the metal work in does that look okay okay so i think that looks that looks okay and just for the purposes of the demonstration it doesn't really matter too much um so you see we've got our barrel here and this is this was so much quicker than making um this is so much quicker than making sort of a high poly version because you can imagine a world where we did this not with a trim sheet and instead we had our barrel and then we extruded this out slightly and then went to bevel extrude this out slightly and then we grab these then we bevel them and then we grab so each interval dual vases and we had to like insert them and then extrude them out and then bevel those and then do all of this detail work with booleans and then make the pipes and wrap them around and then bake that to this object anyway whereas with our trim sheet and this isn't even one of the best trim sheets i've seen there are others this is quite cartoony it's not hyper realistic but i mean for this it works quite well um so you can see how quick i made this barrel just from this one trim sheet i need to save save that in a sec so and i mean we could do the same thing we could move that over now we could get a crate just make a crate the same size let's make sure the scale is applied make sure we bevel the edges could inset all of these faces bring them in extrude them inwards got our faces here so then we could i don't know we could unwrap this just put a seam in here mark same and then we could have unwrapped this grid by shape scale it down scale it up give our barrel the trim material and we've got this pipe detailing going around put the face just over here somewhere you can see that it's just such a quicker way of working but anyway that's not so you can go kind of crazy with these trim sheets and if you want a tutorial on how to make trim sheets then let me know in the comments and i'll i'll do a tutorial on how to actually make your own trim sheets um but for now we've got our got our barrel here we've got a trim sheet so we can save this out i'm gonna the first thing you want to do before you save it um if you go on to the unity hub make a new project um i'm gonna do this through the hdrp you could do it through urp but the shader graph may be slightly different depending what nodes are available in the urp the shader i'm going to show you i made it in hdrp so if you're going to use it i'd probably suggest making a new project there and then that'll bring you into and then that's going to bring you into kind of this default hdrp scene um just for simplicity's sake i'm just going to delete all of these barrels because it'll get confusing just delete that so i'm just going to save this object to make sure it's in the center of your scene i'm just going to save it and i'm going to save it in a new folder within my unity projects hdrp which is uh this project here should make a new folder called tutorial i'm going to call this tutorial barrel i'm just going to save it as a blend file directly in my unity project actually before we save it um i almost forgot one of the most important things uh we want to come over to the vertex the the object data properties tab here and underneath uv maps we need to add three uv maps in and the first one i'm just gonna call uv zero the middle one i'm gonna call uv one this one i'm gonna call uv2 and this one i'm gonna call uv three so if i click the little camera next to the uv3 it's gonna render the uv layout for those because i made it in because we only had one when i unwrapped it it copies that to all of the other ones the reason we have to make three extra ones is because unity uses these two channels for global illumination and baked um light maps and stuff so we can't use those within unity we need the fourth slot here um we need to fill those in so that they're for the model then we can put our trim sheet uvs here on uv3 now if i go back over to uv 0 click the camera and then for this one i'm just going to do a traditional unwrap so i'm just going to press u press unwrap and then i'm going to get this and i'm just going to grid by shape and we'll do uv pack islands just gonna a bit more of a margin move that over so you can see that it's gone all messed up because the uv here is completely wrong for the trim sheet but if we click our uv channel here we click the little camera go back in you can see that this is maintained our trim sheet uvs and this is kind of the messed up uv so now if i hit save or if you haven't saved it yet go to file save as save it just directly in your project folder over in unity we'll let this compile so we'll find our blend file here and i'm just going to drag it into the world just so we can see it you can see that at the minute it's using the uv channel 01 it's using uv 0 as its uvs and what we want to do is we can come over here to our barrel and in the inspector i just want to make sure there's no rig attached there's no animation because it's a static object and i'm going to click generate light map uvs and that's going to send it's going to automatically generate the light map uvs in those are the uv channels which we aren't gonna which one we aren't using and i'm just gonna hit apply okay so we've got our barrel um it looks all broken and wrong that's fine we're going to fix that in just a second the next thing you want to do is you want to bring in the texture maps for your trim sheet so we can just drag them in to the project here and for our normal map just make sure that's flagged as a normal map we've got our barrel and we've got our textures so now we can open up our we can make a new shader graph now we can make a new shader in shadow graph so i'm just going to right click go to create shader hdrp and then we'll just do a lit shadow graph i'm more cool i'm just going to call this one tutorial barrel and i'm gonna open this up okay so what we want to do is first of all let's get our trim sheet texture working um so we can see that within um so we can see that within unity so i'm just going to create a node it's going to be a sample texture 2d node and we could do these as properties if we want to swap the trim sheets out and but just to keep it simple i'm just going to drag the textures directly in so there's our modular wall and you can see uv 0 here we want to change that to uv 3 which we know which back in blender that's uv 3 that's our trim sheet uvs so we'll swap that to uv three and we can plug this into the base color and down here in this main preview i'm just gonna right click go to custom mesh um and i'm going to find the circle cylinder i'm going to right click custom mesh and just type in cylinder we've got a cylinder mesh here so we can see our barrel kind of in this little preview um so i'm going to select our sample texture 2d and press ctrl d and just drag this down and for this one this will be the normal map so we'll drag the normal map in i can go into the normal slot and under type we'll choose normal and we'll do a just going to collapse that and collapse this just to keep it a bit more organized i'm going to ctrl d drag in our metallic map which i believe is that one and we'll drag that into metallic and then finally we're going to press ctrl d bring this over and we're going to drag in our roughness map oh no not finally we've got one more actually but we're going to bring in our roughness map make sure that's default and then we're gonna drag out from there and we're gonna type in invert colors i'm gonna invert all of the red green blue channels and put this into the smoothness map that's because uh this is a roughness map unity is using a smoothness map and a roughness and smoothness map the complete opposite so anything black here needs to be white um to get the same to get the same effect which we can see up here and then we've got our um oh no this is our metallic map which means you drag our metallic map up here that's our metallic map and then we have a mission map which we're not going to use and we've got an aomap which just ctrl d and we can drop our ambient occlusion map into this and then put that into ambient occlusion it was a little bit messy but you can see what i've done so we've got our smoothness map we've got our ao map we've got our metallic map our normal map and our base color map so if i just save this asset right click create i'm going to right click the shader graph sort of asset there right click create material i'm going to call this the tut barrel i'm just going to call this the took barrel instance now if we drag this onto our barrel you can see that there's our barrel we're using the trim sheet texture and it doesn't look amazing let's see why that is it might be our normal i'm gonna swap that back to be a normal map and i'm going to uncheck normal i'm going to put that back to default up there will that fix that module default tangent okay i'm not sure where that's red what i'm going to do i'm just going to drag the normal map just into the kind of graph and then i'll just plug that into normal and then make sure this is set to uv three we save the asset go over okay that looks a little better okay so there we've got our um barrel it's quite shiny uh what we could do is with our roughness map here which we've turned into a smoothness map um after our invert colors we could add in a clamp node which it's just like a colour ramp in blender we can plug this in let that compile so we've got our clamp node here um we could maybe just bump up uh tone down sorry the s the rough part so we'll just put 0.25 in all of these so that's gonna make anything that was completely sort of mega shiny just not as reflective and then we can tone down the kind of smoothness here we saved that asset look there you go our barrel is a lot kind of nicer to look at now so if you were just interested in how to get trim sheets working in unity then that's kind of how you do it if you're just interested in the you the trim sheets and you don't want to do anything fancy on top of that um you can even skip this step and just have them in the uv slot one um but we're going to just take this a bit further and have that tileable kind of grunge over the top of it using the other uv channel so if we just go back to our barrel here i'm just going to collapse all of these down just to make them a bit i'm just going to collapse all of these down just to make them a bit more organized i'm just going to drag these just kind of down here and out of the way we could even right click group the selection and just call this our trim sheet sort of area drag these out of the way and what we are going to want to do is we are going to want to keep track of our roughness map because that's where we're going to add in our grunge so i'm just going to make a oh create a node up here and i'm going to make a preview node i'm just going to add our smoothness map into the preview node and then back into the smoothness and that's just going to help redirect that node up here just so we can get access to it from up here we don't have to keep on coming down here and dragging it up um okay so the next thing we want to do is just to show you kind of how we can implement the other uv channel which is the full kind of the proper unmapped channel this one this one here so we've got our barrel it's just fully unwrapped and then we've got our um the tops and bottoms here and if we want to what we could do is just so this tiles on its y-axis so that's tiles across the seam if we use a tiling texture uh we can just do that so kind of edge to edge it fills the uv sort of space and i'm just going to press ctrl s to save that go back into unity okay so that shouldn't have changed anything it's just it'll just adjusted those uvs automatically so here in photoshop i've made a an emission map which is just black with white um over kind of the uv so this is the one from earlier we'll have to um remake one here so what i did for this is you can export uv layouts here by selecting everything and then go into image sorry uvs and then export uv layout and then you can save it as an image uh what i find quicker for just quick and dirty stuff like this is just on a windows computer you can press um shift windows key and s and that which brings up the snipping schedule you just drag out try and be as accurate as possible and get the full square and then come back over into photoshop just ctrl v and then just scale this up to match your square texture this is just 10 24 by 10 24. um so then i made two ellipses ellipsis drag that over and get that in there and then lastly we want to make it black underneath it so now this is going to act as an emission map and it'll let us put an emissive kind of ring on the top and bottom of the barrel i'm just going to save this as a png just into our project folder call this um tutorial emission map that should appear here tutorial tutorial emission map we can just drag this in and then we want to take that into an emission node and we can drag out from here get a multiply drag this into the color make sure our sample texture here is using uv 0 press the plus choose color and we'll call this emission color set this by default to sort of an orangey color whatever you want and we'll drag this into the multiply drag this into the emission then we want to make an intensity in our emission color we just want to put mode change that to hdr and then drag the intensity up and then we can press the plus make a float and call this um emission intensity just set that to a default of one for now and then we can drag that in plug that into our intensity here drag that into our mission if we save this go back to our scene so you can see that our barrel now as well as the tile map which is used in uv 3 we're using the unwrapped top and the bottom to put this little emissive ring in and it doesn't look great because of uh it's not very bright here so this is where we can bump up our emission sort of intensity to control it and we can also control the colour from here as well if we wanted to do something a bit more funky and you can see that that's on the bottom and the top as well and a good thing about this as well is it will contribute to global illumination so the floral be able to get a pink bit of um glow and you can do that by marking this as static if it's never going to move this barrel is just a piece of scenery you can mark it as static and then the floor will get a bit of a pink glow on it um so i'll do that for that one press ctrl d and i'm just going to duplicate this just so we can see kind of the the next kind of step i'm just gonna bring that up so we've got our two barrels two barrels here so if we want to put something over the top of these again that ends up being quite simple so let's put a bit of grunge over the top of it so i'll put this link in the description below there's a free 512 by 512 grunge texture which you can get here on textures.com i'll just go into your downloads folder and go back over to our assets and you can just drag it into the scene i've already got it here in this folder but you just drag it into whichever folder you want and then back over in the shader graph what we want to do is uh just move this kind of down here and out of the way bring this over here so i'm going to drag our grunge map in now for this one um the first thing i tried and i'll show you kind of the issue i was having if we get a position node change this to absolute world drag that into a tiling and offset node we can use uv slot zero have our tiling and then got our offset here and if i bring the out into the uv slot and then make a new vector2 called grunge tiling and just give this a default of one and one bring that in drag that in there i'm gonna bring this out here and call this a uh get a multiply we can create a float up here and we'll call this um grunge strength set that to the value of one and i'm actually gonna set this to a slider a value of one uh sorry with a value of zero but with a minimum of one and a plus of one and drag our grunge strength in plug it in there and now from our previous roughness map or smoothness map we can do an add add b drag out from our multiply map drag that into the a and then finally drag this into smoothness we'll let that come that shader compile so should be done so if we click save over into our asset here and go on to our the instance of the material we've got our um and that's the old one go to the instance material here we've got a grunge strength here so we can bring that up and this is going to control that kind of that grunge map uh we can also tile it on the kind of x and y if we want and control our grunge strength yeah we've got a tutorial barrel here so we can holding that shift we can just get a bit of finer control just to implement a bit of kind of variation and now if we move our barrels along you can see that that grunge will kind of change depending on the world and for barrels it's probably less of an issue and but you can imagine that if we had a wall and we want to break up the variation on the wall that would be quite good because it would kind of tile across the walls so now they're marked as static and if we go over to light and we can hit generate lighting that's going to bake our lighting okay before you waste time trying to bake the emission i forgot that you've got to scroll down here to advanced options and um hit bait to mission and now if we bake our light in uh you should see that this emission should cast a bit of glow onto the ground so there you can see that we've got our barrel on the ground and the light is kind of cast down onto the floor now because we marked them as static that means that if we move them that light is just saved onto an image on the ground uh so it kind of has to stay there now um obviously if you move it you can just re-bake and it's not a big deal and if you want to change the color again you'd have to rebake so that's kind of how that emission can kind of give a nice sort of effect out onto the ground and you can see here that there's some light leaking through from the one on the bottom so yeah there you have it different ways of using trim sheets within unity um and kind of get them into blender and get them all set up within shadowgraph using two kind of uv sets so you can have tileable kind of stuff over the top of them to kind of break up the repetition and kind of make each thing unique even though it is using a trim sheet i hope you found this video useful if you did it'd be great if you could like the video down below and subscribe if you want to see more content from the channel like this like i said if you want to learn more about trim sheets and how to create your own there is already great stuff out there on youtube if you want me to cover that here make sure to let me know below and subscribe to see that content as always the project file including the textures and the trim sheet and all the files will be over on my patreon which is linked in the description below but for now thanks for watching and i'll see you in the next one bye
Info
Channel: Dan Pos - Game Dev Tutorials!
Views: 624
Rating: undefined out of 5
Keywords: unity tutorial, unity trim sheets, unity sci fi game, trim sheets, unity environment design, unity environment art, unity shader graph, unity hdrp tutorial
Id: ZMrVjhcgCDU
Channel Id: undefined
Length: 39min 17sec (2357 seconds)
Published: Wed Sep 01 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.