How to Use Displacement Maps in Blender (Tutorial)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this tutorial i'm going to show you how to set up displacement textures in blender now i'm going to be showing you two different methods the first method is using the displacement in the node editor and so we'll be plugging up the displacement map into the material and then we'll be using the displacement node and plugging that into the material output and then we're also going to be using this adaptive subdivision and what that does is it adds more detail where you're close up so like right here you can see there's a lot of detail in these bricks but then as we get farther and farther away it gets lower detail you can see right over here it's a bit low detail but then if i just double tap the tab key to reset it you can see it's very high detail and using the adaptive subdivision makes the performance a lot better because that way blender's only going to add more detail where you're closer up and then the second type of displacement that i'm going to show you is using the displacement modifier to actually displace the mesh in 3d so i'll show you how to use a displacement texture and the displacement modifier to actually displace the mesh and then you can add the other textures and get a very realistic result just a couple quick things before we get started if you'd like to help support this channel some great places to do that are over on my gumroad store and my patreon page where you can get procedural materials artwork project files and the tutorial files and you can also get 3d models and assets things like that on my gumroad and patreon you can also join the youtube memberships so if you see right down there there's that join button next to the subscribe button and so if you join my memberships then you'll help to support me each month and you'll get some cool perks here on youtube and then i also want to give a huge thanks to sketchfab for sponsoring this video on sketchfab you can upload your own 3d models and preview them in your browser you can even view them in ar vr or on a phone or tablet you can also purchase 3d models and assets from sketchfab's model store you can even apply to sell your own models on the platform check out sketchfab with the link in the description all right now for this tutorial you can use any texture you want as long as it has a displacement map but i'm going to be using this 066 and this is on ambient cg so i'm going to be downloading the 4k jpeg and this does have a displacement map with the texture and the link will be in the description if you'd like to download this texture alright so here i am in blender and what i did is i just added a plane so i just press shift a and i added a plane you can add this to whatever object you want but for this scene i'm just going to be adding a plane and adding it on and then also right over here on the world i also just added in an hdri so that we get some very realistic lighting and i got this hdri from polyhaven.com so if you'd like to add an hdri or just get some basic lighting that will help to preview the material now to use the adaptive displacements you need to be in the cycles render engine now if you want to use ev then you can use the other method which i'll show you in a moment later on in this video but for the adaptive displacement you need to use the cycles render engine and then also right under the cycles render engine you need to change the feature set to experimental so now let's click right over here on the material properties and we're going to click on new and i'm going to call this texture you can call it whatever you want or just leave it blank and then i'm going to go right down here scroll down and you can see that there is these settings right here i'm going to go down right here and you can see that it says displacement and right now it's set to bump only i want to use displacement and bump so i like to use displacement and bump but just choose one of these ones and the displacement will work alright so now let's set the material and then we will also be adding the modifier so i'm gonna click right over here on the shading tab and then i'm gonna be using the node wrangler add-on to add in all these textures if you don't have the node wrangler turned on you can click on edit and then go to preferences and then right over here on the add-ons on the search here you can just start to type in node and then check mark the node wrangler add-on it's built into blender and i'll show you how to use it and then you can also save the preferences by clicking on the save preferences button right behind me if you want the node wrangler to be in all your future blender projects let's just close the user preferences alright so now that we have that add-on turned on i'm going to use a feature from that add-on and what the add-on can do for us is it can automatically set up all the texture maps now you can plug them in manually if you want to but i'm just going to use this method so with the node wrangler add-on turned on now i can select the principle bsdf and then i'm going to press ctrl shift t and then it's going to bring up blender's file browser and you can just locate to where your textures are so if you download the same texture that i'm using you'll get a zip file and you can extract the zip file and then inside the folder there's going to be all the texture maps now i want to use the roughness normal displacement and color we're not going to be using the ambient occlusion i'm just going to use these and then i can just click on this principled texture setup and you can see that it's automatically setting up the texture for us now if you don't know how to set up texture maps and you'd like to learn how i do have a tutorial link will be in the description on how to set up texture maps properly but it's basically just doing a few different things like this here this is just telling it that it's going to use the uv mapping of the object and then it's setting these all up and then this one right here this is the base color so the color space is going to be srgb because it's using color data but then all these other ones these are using the non-color data because they aren't going to be contributing at all to the base color and then you can see that it also sets up the displacement now again if you want to do this manually i'll show you how to do it so you're just going to press shift a and i'm going to search for an image texture so i'm just going to drop the image texture right here and then you're just going to need to click on open and you're going to need to open up the displacement texture so then right back over here on my file browser i'm just going to double click on the displacement texture and it's added it in and then also on the color space here just make sure this is set to non-color data unless your texture is contributing to the base color it needs to be set to non-color data and then i'm just going to delete the displacement and use this one because i'm showing you how to manually set this up so the mapping if you want to plug this in you could uh you don't have to basically the mapping here this is just telling it that it's going to use the uv of the object so if you've uv unwrapped your object it's going to use the uv you don't have to use this i'm just going to plug that in there just to ensure that it's using the uv map of the object so now we need to do is we need to add the displacement node and plug it into the displacement because right now this is yellow here you can see it says color and this is purple this is displacement so we need a way to convert this to displacement data because we just if we just plug this up like that that wouldn't work because this is yellow and this is purple so to convert it we're going to press shift a and i'm going to search for the displacement node now we can just drop it right in here and i'm just going to drag it down here and then we actually want to plug the color up to the height just like that alright so if we go into rendered mode now you can see that it's doing something because before it's just not doing anything it doesn't have any displacement if i plug the displacement up to the displacement on the material output you can see it's doing something it's kind of just like raising it up but that is not what we want we want it to just be popping up where these bricks are so why this isn't working is because if we tab into edit mode we have very little geometry and so this object doesn't have enough geometry to work with to actually get a good displacement so that's why we need to add the subdivision surface modifier because it will subdivide it and add more geometry so i'm going to click on add modifier right down here on the modifier properties and we're going to add the subdivision surface modifier now you can see it's starting to do something um it's a little bit weird though you can see that it's turning it into a circle because that's kind of what the sub surf does but if you don't want it to be turning it into a circle like that you can change this to simple and then that way it'll still subdivide it but it won't like make the edges smooth um and that is looking better you can definitely see it's doing something now but it is way too strong so there's a few things that we need to do the mid level right here on the displacement we can turn this to zero i just find that it works better without the mid level you could like turn it up or turn it down if you want to i'm just gonna leave it at zero and then the scale here this is how we change how strong it's going to be so one is way too big if we turn this maybe down to like 8.1 that's a lot better so we can kind of zoom in here now you can see that it still looks a bit low quality it seems to be working but like where these grooves are it's still kind of low quality so what we can do to refresh the adaptive subdivision is we can double tap the tab key what that does is it goes into edit mode and then it goes back into object mode so it's just a quick way to update it because we have the adaptive subdivision turned on it's going to be lower quality where it's farther away and then higher quality where it's close up and this is really useful especially for like a really big scene because if you have some object that's really far away it doesn't actually need to be that much detail and so it'll actually speed up render times and just make the scene more efficient so you can see if i go far away and then double tap the tab key you can see it's actually kind of low quality but then if i zoom up really close to these bricks and then double tap the tab key you can see that looks way better that looks super realistic you can see that there's like those grooves there in between the bricks and then of course you will need to make sure that the adaptive subdivision is checked because if you turn it off you can see it's not really working that well and that is because it doesn't have much geometry to work with now if for some reason you didn't want to use the adaptive subdivision but you did want to use the displacements in the node editor then you could do that you could just turn this off but then the viewport and render levels you would need to turn this up really really high so you can see i've turned this up to like a six now and that is better it still looks a little bit low quality and glitchy so one thing that you could do is you could tab into edit mode and then press a to select everything and then you can make the object context menu come up i use right click select so i hit the w key but you should just be able to right click and then you can click on subdivide basically you just need to add more loops and you could also do that again so just subdivide it again now that it has more geometry to work with it's going to be way higher detail and you probably wouldn't even need to turn these up quite that high so maybe just turn these down to like a four something like that maybe a little bit higher actually and there you can see now it's using the displacement without the adaptive subdivision i really do prefer to use the adaptive subdivision because it is really great it just makes it higher quality where you need it now on the adaptive subdivision there also is this dicing scale and this is telling it how much detail you want there to be so if you turn this really small to like a 1 or even like a 0.1 that's going to be very very high quality that's probably going to be too much high detail it might even crash your computer if you try to render it but then if i turn the dicing scale up to like a 10 it's going to be less detailed um you can see i'm like double tapping the tab key but you can see there's like some stretch marks or something right there so that's like too low quality but then maybe if i turn it down to a one that's like super high quality so maybe i'll go with like a five something in the middle maybe a little bit higher detail maybe like a three so you're just going to need to play around with this and get it to the amount of detail that you want all right so now i'm going to show you the second method of using displacements and that's actually going to displace the mesh and you can actually see the displacement in the viewport so for this method we don't actually need the displacement here in the material so i'm just going to select it and press x to delete and then i can just click on this displacement and press x to delete and then also we can turn off the adaptive subdivision we don't want that we still want to use the subdivision surface because we want to give it more detail but we don't need the adaptive subdivision and then let's go right down here on the material properties and then if we scroll right down here we don't need this either so we can just change this to bump only because we're not actually using the displacement in the materials now so we can just turn this back to bump only and then let's go right up here to the render properties now if you want to you can use this with ev that will work i'm going to leave it at cycles because i like using cycles it's more realistic but you could change this to ev it will work in eevee and then the features that here we don't need to use experimental so we can just change this back to supported all right so let's click right over here on the modifiers and i'm going to click on add modifier and then right down here under deform we're going to add the displace modifier now we want the displaced modifier to be underneath the subdivision so you can see if you click and drag right up here where the little dots are you can actually change the order of the modifiers but we want the subdivision to be first because first we want to subdivide it so it has lots of detail and then we want to displace it so right here you can see it says new so let's just click on new and then you can click right over here and this is going to take you over to the texturing panel you can also just click right down here and now we actually need to add in whatever displacement we want so right over here on the image or movie i'm just going to leave that as image or movie and then we can just click on open to open this up so again just head over to where your textures are and then i'm just going to double click on the displacement and there we go check that out it's definitely doing something it's a little bit strong right now but that is looking great so right back over here on the modifiers if we just click back over on this um you can change the subdivision so you can turn this up if you want more detail so i'm gonna turn it up to six it's very high detailed now and then right down here there is this strength and there's also the mid-level so the strength right here it's way too strong so i'm gonna turn it down to maybe like a point 0.1 and now you can see it's actually working really well so now if we go into rendered mode we can check it out and you can see this might be happening with you it really depends and this is because the mapping of the textures is different from the mapping of the displacement texture so this might be happening to you it might not but especially if you want to adjust the texture then you're going to need to fix this so in this case what i want to do is i want to use the uvs for the textures and that's what i'm doing right now it's using the uv mapping but then i also want the displacement texture to use the uv mapping as well so what i'm going to do is right here on the coordinates i want to change this to uv and that's telling it to use the uv mapping of this object so if you go right over here to the uv editing tab and you tap into edit mode you can see here is our uv mapping so i can like move this around and you can see that it's actually going to move around the displacement texture so i can like scale this down and if i scale it way down i can tab back into object mode you can see now there's just like a few bricks or i can scale it way up and now it's very detailed now if you're scaling this up really big so that you can see a lot of the texture then it's possible that the displacement texture may be clipping or endings and if that's happening then what you need to do is click right over here on the texture properties and you need to go right down here to the mapping and then right here you can see there is this extension so if it's set to clip then you're going to have this problem because you can see that the uv mapping is scaled bigger than the actual texture and that's fine but you can see that now you can only see the bricks in one area so to fix this the extension needs to be set to repeat and that way it will tile the displacement texture just like it tiles the other textures so there we go those are the two ways that you can set up displacement maps in blender i hope this tutorial was helpful and thank you for watching and again if you'd like to help support this channel some great places to do that over on my gumroad store and my patreon page and also the youtube memberships is a great way to help support the channel monthly so thanks for watching and i hope to see you in a future video
Info
Channel: Ryan King Art
Views: 233,284
Rating: undefined out of 5
Keywords: Ryan King Art, Blender Tutorial, Blender, Ryan King, Tutorial, textures, displacements, displacement maps, displacement textures
Id: xF-l5d80oCU
Channel Id: undefined
Length: 15min 39sec (939 seconds)
Published: Tue Aug 17 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.