Introduction to Microdisplacements - Blender Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

"I can't wait to try that!"

looks at memory usage

"Eh, turns out I can."

👍︎︎ 2 👤︎︎ u/helium_farts 📅︎︎ Sep 14 2016 🗫︎ replies

Hey Andrew, I've been playing with the release candidate as well and on my system it seems to break pro lighting studio, thought I should let you know

👍︎︎ 1 👤︎︎ u/CaseyBergProductions 📅︎︎ Sep 14 2016 🗫︎ replies

hmm, cant get this to work. I have 32gig ram and 980ti .Only gets as far as setting the displacement method. Try to render in vewport or f12 and blender closes. Using 2.78 rc 2016-09-02

👍︎︎ 1 👤︎︎ u/[deleted] 📅︎︎ Sep 14 2016 🗫︎ replies
Captions
of all the blender features that have arrived over the last five to ten years this is the most exciting thing at least in my humble opinion we're going to be talking about come on micro polygon displacement aka adaptive subdivision aka adaptive tessellation aka the coolest feature ever this is something which is uh I mean it's really really exciting something I've had my eye on for like two or three years since it was probably first talked about and it's finally here you can actually try it out in the master blender built which is which is really crazy so we're going to be talking all about it we're going to go over why it's such a game-changer how it actually works and how you can actually start using it right now so without further ado let's get into it let me hide my face here otherwise my face will be covering some of the words and you will not like that so first thing to know is that it's actually two separate features that are sort of rolled into one release so the first one is adaptive subdivision which we'll talk about in a second and then the next one is the micro polygon displacement which uses adaptive subdivision so just to yeah clarify there are two separate things so we'll discuss them both separately right now so the first one adaptive subdivision adaptive subdivision solves a common problem which you yourself have probably already experienced and that's the say you've got a scene like this you've got you've got three objects okay one in the foreground one in the middle ground and one in the background and they're both sorry they're all identical and they're all very high detailed well if you had the same level detail as you had here in the foreground and you had it in the middle ground as well as the background that would be a complete waste of resources because all the way in the background there you could barely make out the shape of the rock so you don't need to see the tiny little nooks and crevices and things because it's a complete waste of so what you normally do in blender right now is you select this first rock here and you turn up the subsurf modifier for this individual rock and then the same one there for the one there maybe you tone it down a little bit and then in the background there you turn it down even for even further now that's not particularly time-consuming if you only have this scene here with three objects that's not a big deal but say for example you had a scene with hundreds of thousands of rocks that's when things get really complicated and most artists just sort of you know they do a a few maybe in the foreground they crank it up the ones in the background and they just sort of leave it and they just deal with the fact that it's rendering detailed that you can't see because that's just how you've had to do it with cycles thus far so what adaptive subdivision does is it's this new feature which you'll see in blender 2.78 if you turn on experimental mode we'll get to that we'll do a hands-on thing I'll tell you all about it but you'll see there's this little checkbox there that says underneath render it says adaptive and then die sinks go so what adaptive does is it reads the image and it determines which objects need more subdivision based on its location to the camera so it'll read this one here and it'll say this one needs a lot of subdivision because it's very close this one here needs some but not too much and then the one in the background barely needs any and it does all that just by checking that one box so it's like set it and forget it and and it's awesome and the result is is that for this just between that and this it's two and a half times faster almost 88% less memory usage it's automatically optimized you don't have to do anything else it automatically does it for you and you actually get better details which will will dress later as well so that's why this is so exciting that's why this is such a huge huge deal because I mean look two and a half times faster I've left the stats at the top that you can't really see them but it went from almost a three minute render to a little over one minute and it went from a peak memory usage of over two and a half gig to two hundred and twenty megabytes so put it in perspective of a large scene normally like you reach a point where you can't render on your graphics card anymore because the scene is too complex well with this feature you can now because it has this optimization built into it that's why it's so so incredible to put it in aspect so it does it on a per object you know like in that example that was a perl object thing but it also does it on the object itself so it's not like it just comes up with one flat subdivision level for the whole object it doesn't on yet throughout the object okay okay as an example so say you've got this scene right here which has a doughnut shape it's one single object and it goes from all the way in the background all the way to the foreground here well standard subdivision which is what we have currently in blender it would do this you would subdivide it evenly across everything and you can see that way in the background there you got detail that's really not necessary okay well what it what it does to explain sort of how this thing works is it splits it up into individual pixels and for the sake of just visualizing this part let's say that these are the pixels okay these are the tiles for the foot for the mesh right so say way down here where my cursor is it would split it up like this and it would subdivide on this part of the mesh it would subdivide it that many times and it would do this for all these other tiles every tile on here I'm just for this one just this example it would subdivide that many times and then all the way in the background here or this one you can see that it would subdivide it the same number of times but because of the screen space its subdividing a much larger area the same number of times as this area here in the foreground so what it results in is something that looks like this so you can see way in the background there those squares are a lot bigger than the squares down here in the foreground so it's kind of like a like a like a weight gradient where it's uh eh subdividing really close to the camera a lot and then it's getting less and less as it goes out which is crazy right and then but look at it like compared to what we have currently look at that okay so to explain why this is such a big deal okay on this this example of a doughnut who really cares if there's detail or not because friggin doughnut there's nothing on it okay but if this was a like detail with crazy detail if this was a ground which I'll show you in a second this is a world of difference this is the difference between a render taking five minutes and using up you know 15 gigabytes of VRAM and then something like this which is extremely light renders way faster and it looks identical so I'll show you some examples in a second anyway that's adaptive subdivision and again it's not really anything else new that you need to learn all it needs in the future all you'll do is just check this little box that says adaptive and you will be sweet it'll be hits it's going to be huge trust me it's going to be huge alright so that is adaptive subdivision now we can talk about this second feature which is micro polygon displacement so micro polygon displacement uses the adaptive subdivision to displace the mesh at the time of rendering okay so currently the way that you do sub the way you do displacement in blender is in the modifier section whoops so you've got say you wanted to make this ground here right you would add a subdivision modifier to give it the detail on the level of detail that you want and then you add a displacement modifier underneath it you would add in the image texture here define the strength or whatever and and it would displace it and you would be able to view it in the viewport if you wanted to and you can see that it's just displacing it based on the number I sorry the level of subdivision that you give it right there okay well micro polygon displacement does a very similar thing it but because it is using the adaptive subdivision which we just talked about it's now able to do the displacement at the time of rendering I don't know if they are actually linked like if the developments length like that anyway so so what it's doing is is you've defined it already in the modify stack which is one subsurf modifier you've checked the little box that says adaptive and now in the material settings for this ground plane here you can see the ground planche is completely flat sort of a flat plane and in the material settings all you need to do is drag the output of an image texture you would add in your displacement image that you wanted to use right there drag it into the displacement output of the material output so if you've been using cycles you know since it started like five years ago probably you've always had that this displacement option here already so that's not a new thing but we haven't really ever used it or most people don't really ever use it because it's sort of like a grayscale bump map that doesn't really give you that much control over it it wasn't really ever fleshed out but it's always just been there like this glaring you know what if it's never really fully worked but now that it does it means that it's able to do the displacement at the time of rendering okay so this is the standard displacement now look at the render times at the top there four and a half minutes 13 gigabytes of memory okay because this is I subdivided this heaps okay now look at this okay almost no difference to it at all and look at it it is two-and-a-half times faster and 88% less memory crazy this is ridiculous you can see that the the peak memory use is now is under 1.6 as I want 1.6 gigabytes total which means you could render this on most graphics cars so you could the render times would be even less because now you're able to render it on on a graphics card so that's why this is huge so micro polygons are displacement is using the adaptive sub division active sub yeah active subsurface whatever you know what I mean it's using that across the plane and then it's applying the displacement at the time of rendering which is really cool but here's another thing you might not notice ok so between the two of these there's not much difference ok okay but if you look way down here at the bottom you can see that there is some tiny extra little dots of detail between them okay so it's actually more detailed and the reason it's able to do that is that as you know the distance to the camera close it and it gets closer and closer to the camera it's able to subdivide it at levels that are previously would not have been able to do because of the fact that like if you were to try and do it with the standard displacement you would have to subdivide it to extreme amounts to I don't know maybe 100 gigabytes of memory let's say because it would have to do that across the entire mesh because now it's only doing it for a tiny little section it's able to subdivide just that little area to extreme amounts of displacement and get even more detail so to show you an up close I zoomed in on just those areas here so standard one there this one here at two picks dicing scale which is the example I just showed you is that and then if you drop the dicing Scout you don't know what dicing scale is yet don't worry we'll discuss it in the practical example but you can increase it even more and get it out even more detailed so that's see that's the thing so to summarize you're not only getting huge savings in memory but you're also getting faster render times way faster especially if you're now able to render a scene on a graphics card instead of a CPU even faster you're able to build larger scale scenes like that marcin it would make it a lot easier without having to worry about the detail and you're getting higher detailed materials at the end of it so if you've ever like gone on art station you've seen somebody's material or some render or something of architecture or environment and you've looked at the ground and you thought like oh man it's so detailed how did they get that detail well v-ray and I think Maxwell render man a bunch of rendering engines have had this feature for years I don't know years maybe three years that's a rough guess I have actually I have actually have no idea but they've had it for a while so chances are the reason why many other artists able to make these awesome stunning looking scenes was that they had this feature a lot earlier and they've been able to make these hugely advanced scenes now it's in blender so as someone said on Facebook it's like it's the last it's the last advantage that v-ray has over over cycles because now cycles has this it's finally in it's finally in the big leagues I don't know if that's a you know overestimation or whatever exaggeration but anyway it's pretty cool stuff now let's let's do the demo because I'm sure you'll probably look at this near like alright how do I do it I get it it's a cool thing how do I do it so I'm here in blender got a new scene open up and before we start anything I do need to address the fact that we are using a specific release of blender which is two point seven eight this I think within a week's time of me upload in this tutorial it's going to be the official release but this is an early release candidate so if you're watching this at the time that it's released you'll need to download the newest build or mass or whatever it's called of blender which is this one right here once you've got that you'll go here in blender underneath feature set where it says supported if you change it to experimental you'll be able to see some new features the first thing is the down here underneath sampling know underneath geometry you'll find something here that says subdivision raped ok these ones right here that's how you know that you've got the right release okay you'll see those ones there and also underneath the material settings you'll find that you've got an option to change the type of displacement and also underneath the modifier stack here when we're talking about adaptive subsurf you'll see this little checkbox here that's how you know that you're using are the right new release ok so what I'm going to do is I'm going to I'm going to create make it keep it practical I'm going to make a muddy ground ok right here I'm going to make a nice muddy surface now to follow along I'm going to use some textures from polygon comm you're welcome to use procedural textures or your own textures if you have them but I do want to demo with something practical so I'm going on polygon we've got a new photo scan library here which of course is always cool because the renders come out looking really nice so I'm going to use this one right here ground tire tracks zero zero one now by the way you don't have to pay to use this you can sign up for a free trial account and you can download this right now so go ahead and do that so you'll want to download all of them and then go back into blender and we're going to split the view right here and I'm going to load in the node editor over here and go to new and let's first of all let's start by adding in the diffuse image texture so I'm going to go texture image texture connect it to the diffuse and let's find our texture which is this guy right here color load that in okay now I'm going to duplicate that just for the saving of two two seconds and I'm going to make this one the displacement 3k this one and this one I'm going to load directly into the displacement this new thing right here ooh fancy something I haven't done for a number of years because it's now finally finally working ah yeah so we're going to load that into there and before we go any further make sure that you select non color data very important because uh you want to do that for any texture that is not contributing directly to the color of the texture so a non color data okay so we load that in and if we were to give this a render right now we wouldn't see anything because we haven't got any light all right so I wasn't actually planning to plug it but for the sake of having some easy lightness and I'm just using Pro lighting skies but you can just add in a Sun lamp and it's the exact same thing where you won't get the reflections but you get the point okay so we can now see it's it's brown okay but there's nothing else really on here why aren't I selecting that up okay and the reason for that is we haven't UV unwrap the plane yet so I'm going to go tab you unwrap and excuse me for one moment I have to turn off this you probably didn't see it in my recording but my screen was getting getting yellow that efflux thing I keep forgetting it's turned on when I do the tutorial all right so if we can see it there but it's we can't really see it doing much like look at it it's just this displacement thing not really that cool Andrew you can see the difference that it's having it's just adding a slight level of bump now this is just the default bump map so it's kind of like fake bump mapping so it's just adding in some shadow but it's not actually displacing the the surface yet and the reason for that is that if you go to the material settings down here I showed you this just briefly before but you've got something here a new setting which says displacement so by default it's set to Bom which is like the equivalent of just loading this in as a grayscale bot map and feeding it into the normal input there basically but you've got a new thing here which says both true or bump so obviously if you set it to true that's going to be a different type of displacement if you said to both it's going to be using both of them now I've actually found that if you use bump it actually creates weird shading effects so if you set it to both or bump at least at the time of this release it might change in the future but I've actually found it to give weird shading artifacts so in what is going to keep it on true which is the new thing which is actually going to physically displace the geometry of the Mesha now if we have a look at this you'll see nothing you'll see that nothing has actually changed and the reason for that is that although this is doing the displacement at the time of its rendering it still needs physical geometry to displace and we only have four points for it to do that so you can add more geometry a number of ways one of them is to manually subdivide it like this this is the way I like to do it I just subdivide it by 10 because it's nice and easy and then I add in a subsurface modifier over here and this is going to be so this is if you leave that adaptive turn off this is going to be just like you would be using a subset of modified normally so if you go and you hit shift Z you can see that we've now actually got some changes so it's actually started to displace the actual the actual geometry which is really cool and if we increase this you can see that that gets more and more detail so it's just displacing the physical yet the actual geometry that you've given it so now let's use that new awesome feature called adaptive sub serve so if we check that little box there now this view here this value means absolutely nothing you don't really need to pay any attention to that whatsoever because even though if you change this up or down and it makes the corners around or whatever when it goes to render it's going to use something entirely different so don't worry about the view that I just set it to zero to remind myself not to pay attention to it now if we hit shift Z to go into render mode check this out boom all right so what it's doing here you might not be able to notice much but from the point of view here the points that are in the the foreground here are going to be more subdivided than the stuff which is oh boy I've gone too far way in the background ok now you can't really see much in in this example if i zoom out you can see what it's doing there so down there it's gone super detail and over there it's less detailed now how is it doing this how does it decide where is the foreground and where is the background if you're doing this in render preview mode it does it from the point that you enter into render preview mode so if I hit shift Z here it's going to basically apply it from here so you can see that it's if I zoomed way out here like here and another way to do it so you can hit shift Z and then go back into it that will refresh the view now so from there if i zoom all the way and you can see the detail that it's got now is really tiny another way you can refresh it in the way I like to do it is hit tab twice and it refreshes it so look at that isn't that really now if I going down here tab twice isn't this incredible this is a really cool way of working so you can change like like the t-tail point so it's like you're placing a camera and it's it's deciding it from where you are it's it's really incredible okay so obviously the standard way you would use it is with a camera so let's add in a camera here where is my camera oh it's all the way over there alright so I'll just hit ctrl or number pad zero to make it from there let's put this camera in a little bit closer right right about there okay now I want to be able to my toe no see the detail a little bit more or at least so show you a better example of it so I'm going to just split this view here for one second and I'm going to hit S on this UV square here and then type in the number two and that's just going to double the space that it's in right now okay now you can see that it's uh it's now it yeah so it's double the scale of the texture and it's because it's tolerable it's okay but you can see it's really raised so yeah so that's one other thing you'll probably think like when you look at this is like where's that that scale amount or that displacement amount which are probably used to if you use a displacement modifier let me get a dream for one second uh making tutorials it's a tough job someone's got to do it not me so ah yeah so you can control that by adding in a math node math node and then connect it between there to there and then you set this to multiply and this value here becomes the scale that you give it now if you adjust this you won't actually see it happen in real time because you need to refresh the view so if you hit tab twice now it's going to be refreshed you can make it more you can make it less which is what I want to do like so okay now one thing to note though is that just like if you were to add a displacement modifier the level that it creates you're like the level of the displacement is based off the real scale of the plane so if you are did what I just did which is to scale up the original plane like that you can see the dimensions there sorry here are eight eight eight the scale is wrong so you need to hit ctrl a and then apply the scale doing that will make all of these one but if you now look at the displacement you'll see that it's nothing so what we did was it was treating it as if it was like amplified by eight which is why when we removed this if I mute that with by hitting M it was really spiky but now that we've actually applied the scale it's not enough so essentially I'm going to use this multiplier value here to turn it up to I don't know what it should be maybe around four yeah three or four actually looks 2.5 that's a pretty spot-on it's not bad okay pretty cool all right now if you look at this and you go that's cool Andrew um but the detail is not not enough okay so there's a couple of things so if you're looking at it from the render preview right here it's going to be lower res than if you were to do a render so if I give it a render right now you'll see what I mean now the reason that it's doing it at a lower res is just like when you have a standard subserve you've got the view level and you've got the render level and the reason for that is that when you're previewing something you generally don't want to see it at the same resolution as what you would at the render time because it just uses up too much memory right so the it's doing the exact same thing but the preview range is basically hidden and it's hidden where I showed you at the start here down here in the render panel underneath geometry you've got subdivision rate and you've got something that says render amount one pixel preview amount eight pixels so what are these pixels the pixels are remember when I showed you the tile and where it would split like depending on the tiles on the image like the number of times it would split okay that was like a proximation but essentially like if each one of those tiles was a pixel this is deciding like how many times should ice how many times should I subdivide it if it's set if it's one pixel it means that every single pixel on here it's going to add a subdivision tiny little subdivision for every single subdivision or it's going to be a triangle or whatever you want to call it if it's set higher so say this was set to two it means that every two pixels it's going to subdivide it so essentially the higher value you set this to the lower res the displacement is going to look so if I have a look at this now you can see exactly what I'm talking about so if I increase this to six or fine maybe go even further you can see there's getting lower and lower resolution when I do that okay but if I set this lower you can see that it's getting higher resolution of probably what you used to with the subsurf modifier but yeah the lower you set it to the more I detail it's going to have now these two rates here are based on these amounts right here so if you want to like let's say like the gap between these is too high it means that the preview render rate is going to be eight times lower resolution than the final render so say I want to make them both the same or maybe I'll just make it a little bit less than the render so I'll make it like half the resolution now when i refresh this you'll see dun dun dun dun you'll see that it's now higher resolution in our preview render here and it's a little dark here so let me just turn up providing skies so we can actually see it a bit better okay there we go sorry bad serve it you guys having to squint looking at your screens okay so now you can see it's a lot more detailed and if you increase so so those two mounts there these two values here are based on the global values which were applied here this value here is if you want to change it for this specific object and this is really where you get to control like so if you this is just obviously one object and that's all we're looking at right now but if you had rocks you had trees all that kind of stuff some things need to be higher resolution than others so that's why you would increase it so say you've got I don't know let's say it was a rock or something you don't want it to be as detailed you increase this amount so I'd go alright I don't want that to be that detailed I'll set that to four if it was just a little rock and then I don't know tiny rock that you don't really want to see that much I'd maybe set that to fall but if it was something that I don't know was a big part of the scene I'd maybe just set that to one but ideally you shouldn't really need to change much because it should do it automatically and that is really the coolest thing about this so there you go oh now one other thing to note now I don't think you can actually see it for this example right here if i zoom in there you can't really see it let me actually just load up an example where you might be able to see this but there's something to note about the displacements and it's a problem that appears because of this because this feature is so cool you can actually notice a flaw in the displacements now what happened there hmm what is going on okay it's brilliant Oh hmm did I accidentally say ah whatever all right you know what let's just okay let's say for example that you had a scene the stone scene that I just had this so I couldn't get that working doesn't really matter all that much but what you would see is if you if you see if you look at the displacement and you can see a jagged effect let's try and get that there if I set that to 1 let's see if it actually does anything if you see a jagged effect on your displacement it's called stepping it looks almost like if the displacement was fed through a like a pixelation filter it looks really horrendous okay if you see that it's a limitation it's because you're seeing the displacement adds such a high resolution that you're seeing the limitations of 8j Peck okay so you actually you're reaching the far end of the displacement galaxy I don't know to the point that actually it's starting to show like the problems with JPEGs okay so if you see that you need to be using a different displacement preferably one which is so JPEGs are an 8-bit image it's still trying to load this in as extra geometry I don't know how it's going with it let's see done - done - done - done - done oh for goodness sake I wanted this to be smooth a smooth tutorial and instead I'm just just stuck I don't know if we'll even see it anyway all right well that's just while that's loading there so what you'll need is you'll need a 16-bit displacement which is what we've got on polygons so the standard displacement file is like a JPEG which is 8-bit but we've also provided the 16-bit ones there as well and it's it's still going so what you would do you know what forget it I don't I don't want it anymore you know when you're at a restaurant and they just take so long you're like you know what I mean if half an hour cancel that order but it's almost out of the kitchen it's not my problem I don't know who I'm ranting at right now I don't even think I've had that problem before alright so you would load in this one which is a tiff file a 16-bit TIFF file okay anyway I wanted to mention that because that's the problem some people will no doubt have you would see stepping things like that okay I'll set that back to three okay now the other thing to note is that if you were to render it at a higher resolution so say you did a preview render and it came out great then you do the final thing because it is placement so it's because the subsurface subdivision is based off the number of pixels it would actually increase the amount of detail and the amount of memory required for the scene so if you increase that to that you would see more memory usage required which is a crazy thing but it's actually it's actually really good so underneath here you've got max subdivisions which means that say I don't know you were rendering in it like 200% so I'd be like 4k image and it was just taking forever to subdivide you could decrease the amount of sub the maximum subdivisions to stop it from subdividing it to a tiny tiny tiny infinitesimal amount that it is unnecessary so that's what that final value there could be used for and I think I've pretty much discussed everything that is necessary for this tutorial so there is a couple there is actually some final closing remarks here after the demo time and that is that there is some limitations for this new feature and it's again this is just at the time of this release okay as always when things are first released especially when it's even the experimental build of blender not even the official supported feature set yet things are not complete yet so some of these things I'm sure will probably change in the future but right now if you've got two materials that are part of the same object if you have a displacement on one and a displacement on the other it won't smoothly do it between them so as an example this scene right here this is a material with a tire track down the middle here and then on the right-hand side we have a different material now I actually did something funny in Photoshop to kind of smooth it out but I rendered it once with the standard subsurf and I rendered it again with the displacement and then I cloned in or faded in the different area so you couldn't see it but basically on the edge there there was a huge gap like this huge chunky cutaway effect because it didn't smooth between the two displacements when it was on the same object it was like you cut it with a pair of scissors and then made the levels different it's hard to explain but that's currently a limitation you also have weird shading when you use the bump or the both mode I mentioned that before but I don't know why it does it but it's like the the normals get weirded out it's kind of weird Oh another thing to note here I didn't bring it up but yeah when you use like say you add a normal map you when I first started using it I thought something was broken because if you use a normal map mode and you plug it into the normal input it doesn't work it comes out black and the reason for that is the fault it's set to tangent space for the normal map if you change it to object space it works fine again I don't know if that's again a limitation or if it's going to change in the future but that's something to to remember make sure you set that to object space if you're doing it the other thing and this is a this is going to be a big pain going forward is that doesn't work with particle instances so in the example that I gave up the Mars scene with the hundreds of thousands of rocks if each of those rocks are just particles apparently it won't actually work for each individual Rock and calculate the amount of subdivisions I don't know why they died mean you could just apply the particles that's an easy way around that but it won't work with particle instances and the other thing and this is a huge bummer right now is it doesn't respect particle instances position on the mesh so in this example here we've got some grass and weeds over there again I had to to photoshop it so that it actually looked correct but right now so these are like particles that are sitting on top of the ground well what was actually happening was it doesn't know where the where the grass is like sitting on top of it so at the render time it rendered the dislike the ground on top of the rocks like the grass was underneath the ground because at the time of rendering the heights are different for the plane so I'm sure that's that's something that's probably going to change for the future but that is a little minor thing to mention as well but that's it guys if you found this tutorial helpful please give me a like that helps you know kick something back to me I like it when I like hearing feedback so give me a like click Subscribe if you want to see more tutorials like this one and if you make something awesome with the tutorial please post it in the comments on Blender guru I really like seeing what it is that you guys make after following tutorials so thank you for watching and I will see you again in the future bye
Info
Channel: Blender Guru
Views: 373,518
Rating: undefined out of 5
Keywords: blender, tutorial, cycles, microdisplacements, micropolygon, adaptive subdivision, tessellation
Id: dRzzaRvVDng
Channel Id: undefined
Length: 37min 2sec (2222 seconds)
Published: Tue Sep 13 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.