Blender Tutorial: Micropolygon Displacement Basics Part 1/2

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
I hate space travelers here is an exciting three update to a critically acclaimed space the effects video course for blender by Eddie burrows and me Alexandrov after watching the tutorials you'll be ready to take your space art to the next level because we'll be talking about micro polygon displacement very awesome teacher and more and basically there are different names for that picture micro polygon displacement or rendering adaptive subdivision and desolation and basically these three things are completely interchangeable alright so this tutorial is divided in two parts this is part one keep watching okay so we're going to start with Michael and displacement basics like a quick introduction then we can explore the terrain hide maps and the procedural terrain using the displacement after that we'll take a look at generative modeling using displacement and some procedural noises and another way to use displacement that we'll explore in this tutorial is adding this surface details which is perhaps one of the most popular things people do using displacement and finally we will talk a bit about optimizing memory usage because this placement can crash your computer okay so let's get started with the metropolitan displacement basics it's kind of an introductory look into this technique so later on we could move on to the beef but we started by adding a tube of course and setting the feature set of cycles to experimental because right now the adaptive displacement feature is available only in the experimental set and now I'm going to come down to the performance tab and set the start resolution to 512 this will make the viewport more responsive during the update and now I created the new material and called it displacement and obviously to be able to preview our displacement we have to switch to the rendered view port mode that's what I did here and let's go over to the environment tab and just for the sake of making a beautiful picture let's create the sky texture the strength two maybe three okay technically this doesn't relate to displacement but it's like our cube is floating in the sky nice and now I come over to the material settings and we can change their displacement type to bump true or both in a moment I will explain what it means let's switch to the node editor press shift a select texture noise texture and right away I'm going to plug it into the displacement socket as you see the effect is quite subtle and our displacement mode is bump so what I'm going to do here first is are the converter math node insert it over here and set it to the multiply mode and let's increase the value and see how it affects the bump technically it just makes it appear stronger so let's increase the amount of details set it to 5 and the next thing that we can do is just switch to the true displacement mode tdd move and we see nothing Congrats because we have not enough geometry to displace we have to subdivide the cube to create the source material for the displacement so to speak go to the materials tab what we can do is just add a subdivision surface modifier and increase the amount of subdivision levels I'm gonna pressure that to enter their rendered report mode I'm slowly increasing the number of subdivision levels and now I can see how the procedural noise texture is displacing the geometry and take a note that we don't use the adaptive subdivision yet right let's switch it back to the bump mode and to refresh the viewport press tab two times while hovering the mouse cursor over the viewport and you can switch it back to true it tap two times or alternatively you can set it to both are they setting this kind of self-explanatory it will use the true displacement as well as the fight bump for now I'm going to set it back to true because there will be controlling the bump separately and let's switch to the node editor and add converter mask node and set it to subtract mode we need this now to balance the inflation that multiplying out causes I set it to 2.5 because that's roughly the half of the multiplier value housing the values usually works really well for some reason and by pressing Tab two times you can refresh the viewport and now you see that the displacement no longer balloons the object it maintains the volume of the initial object all right awesome what I'm going to do next is demonstrate how a deficit of division works so I'm going to move these nodes over here and press shift a go shader make share also I'm going to add the emission shader get a shader emission to drag it into the second socket but before let's add the wireframe node and connect it to the mix factor and this one goes into the second socket of the shader and now we can see the wireframe let's shrink the pixel size set it to zero point zero zero two look as you're moving kind of closer to the object we don't see that the polygons change their size and that's normal behavior for the subdivision surface modifier but that's not efficient by any means because we when we are far away from the object the polygon size becomes too small in vice versa so I'm going to add the array modifier to demonstrate this concept and let's set the count to something like I don't know 50 position camera this way so these bowls converge into horizon line oh and one muscle English move the array modifier to the top of the stack by pressing this button and now we can enable adaptive subdivision and watch this after we enable the shed box the amount of subdivisions on the object is calculated based on the distance from the camera so the farther away object is from the camera the less subdivisions it will have once again to recalculate the subdivisions you can select the object and hit top two times like this tab and then tab NH recalculates isn't that ingenious so these adaptive subdivision thing is really the way to optimize the displacement based on the distance from the camera and those the pixel size in this observe modifier you have this dies in scale parameter it's kind of a counterintuitive but the higher this parameter gets the less subdivision levels will be applied to this object during the render I'm going to set it to 2 it means that this object will be subdivided two times less then if it was set 1 and in the render tab we have this generate global settings right now in the preview we have 8 pixels we can set it to 4 pixels to up the resolution of the subdivision we can even set it to 2 effectively double the amount of polygons and this marks subdivision parameter of this the controls this maximum number of subdivisions let's set it to 8 so right now the preview set to pixels and render to 1 let's unify it let's set 1 into both dots that means that the size of the polygons will equal the size of the pixel I'm going to select the mix trader and press m to disable the wireframe rendering and one more thing that I really want to show you is bump how we can control BOM separately from the displacement lets press shift a select vector bump drop which over here and connect the output of the displacement to the height input of the bump node and this node should go here in the normal input of the diffuse shader and now you can manipulate the strength and by setting the distance and the strength higher or lower you can control basically the bump separately from the displacement which is very handy of course and you can press M to disable the bump node and enable it back to preview the effect of the bump okay now if we press that and the wireframe rendering mode you'll notice that our cube is still subdivided that's because in the subdivision surface settings we have changed the levels but if we have activated the adaptive check box this thing doesn't influence anything because the subdivision is calculated during the render based on the Dyson scale we have Oaks now let's explore for how some ways of using displacement in blender and the why number one which comes to my mind is terrain height maps we have applying here let's hit tab to enter the edit mode then press U and select unwrap that will unwrap the plane simply unbelievable and now let's go to the materials tab click on new button and let's call the material displacement impression shipped a selecting texture image texture and on the open button I have two textures and this polar first one is the Terran heightmap exported from world machine and the second one is just a color map worlds machine is amazing software to create landscapes as well as exporting various maps like a height map it's paid but it has a free version if you want to try it okay so I'm going to select this terrain height map so you can open and right away I'm going to drive the color output into the displacement input some person shifts that to enable the real-time viewport and to preview any particular node in the node editor you can hold ctrl shift and click on this node but you should have the node Wrangler or don't enable to do that okay and I'm going to click on the diffuse node to bring back the preview of the diffuse shader and in the modifiers tab I'm going to add the subdivision surface just like we did in the previous section of this tutorial let's also don't forget to enable the adaptive checkbox and what else should we do right in the materials tab we should enable that true displacement method instead of the bump now we are ready to do some fancy displacement let's just add the mass node right after the image texture set it to multiply I'm going to click on this value type 5 oh it's too low let's type 55 and hit tab 2 times to refresh that visualization of the displacement and now we see gorgeous mountain and you know what I'm so excited about what machine about Gleaner about coffee let's add the math node set it to subtract and type something like 22 and a half once again that's 1/2 all the value in the multiply node but I think in case of this mountain we can set it lower basically I'm gonna need to align the base of the mountain so to speak with the plane position and make the displacement work outwards in the render settings we can experiment with the subdivision rate for example we can try setting it a bit lower like a 2 pixel or if you want faster previews and fatter calculation you can set it to 8 but I'm fine with 3 pixels or 2 pixels because to detailed enough for me is a compromise between quality and render time right now I'm adding yet another image texture click open navigate to textures folder and this time I'm going to pick terrain color and unsurprisingly drag it into the color flood of the diffuse shader and now we see super beautiful mountain isn't that impressive that we took just one polygon and we displayed the whole thing out of this polygon micro displacement really rocks especially when coupled with a good diffuse texture and the last thing I'm going to do is add them bomb node connected over here as you've noticed I didn't use the grayscale height map I used the color map instead the reason behind this is that I want to add the small scale bump to the snow as opposed to the large-scale details of the terrain height map before moving on to the next step I would like to disable the diffuse color by holding shift and dragging across this line that will allow us to preview just the bump here's a quick comparison between the null bump version the bump strength set to 0.5 and finally the bomb strength set to 1 I decided to use the color map to generate the bump map but perhaps the best practice would be to use the height map so let's plug it into the height input of the bump right now we barely see anything because we have to increase the strength or the distance of the bump let's try it again the strength to ten or maybe even to 20 and you can see that it doesn't help so much let's bring it back to one and modify the distance instead to set it to two let me crank it up to three I would even try six and see how it looks and it looks just alright so if you feed the height information into the bump node it really allows you to compensate for the lack of the details in the displacement especially if the subdivision rate is set to a higher value like three all right so the idea is that you can get away with the higher subdivision rate like three pixels and bring the details back using the bump map with the terrain height map used as an input but as I've mentioned before I have another kind of plan I'm going to use a lower subdivision rate for the displacement and that means the higher quality so probably we won't need to plug the height map into the bump we are going to implement the finer details instead let's go get up to the height since back to 0.1 because 6 was way too bumpy all right guys let's drag the color back to the diffuse shader and keep on talking also we can try inverting the bump and see if it somehow looks better in this particular case I think that the inverse bump trades Sharper details of course from the logical standpoint it's a little bit weird that the snow looks indented but on the other hand I love the visual sharpness of this effect so I'll leave it inverted so the plan is to keep the subdivision rate sufficiently low let's set it to 1 and that will give us a lot of geometry to work with a lot of polygons and a lot of video memory used we'll talk about that in a moment but for now let's try making an render so let's come over to the render tab set the resolution right now it's set to 1920 by 1080 pixels oh my goodness the subdivision rate is set to 1 pixel and the resolution is pretty high that may be problematic we'll see about that ultimately it depends on your video card now one person's ear on the numpad center of the camera view and shift F to enter the first mode and I'm using WASD keys like in first-person shooter to navigate the camera and press and render button it renders super fast actually and we get this which is gorgeous and it apparently took a gigabyte of video memory let's double the resolution and see what happens because the double resolution will mean four times more pixels so I'm typing in 200% let's now hit render and wait for inevitable let's wait while it calculates all the stuff normal so no and bam we have an error here it says to the error out of memory that means that we are doomed oh actually we aren't we can set the subdivision rate higher to 3 pixels for example and then we'll save us some video memory in the end you make the decision whether to use 1 or 2 pixels for the subdivision rate based on many different things namely the resolution the available video memory and what part of the screen the object occupies but be careful to not burn the computer ok so by using the height Maps exported from world machine taragan view or other software we can get this amazing result by using the micro displacement feature of blender and look at this planet in the background is the planet from chapter 2 of space we fix see everything looks better with the planet and the cool thing number 2 that we can do using the adaptive displacement is procedural terrain once again let's get started by creating a plane and now let's come over to the materials tab new material I like to rename stuff so I call the displacement in the node editor let's hit shift a to create a new texture noise texture drop it over here and connect it to the displacement socket I'm repeating some steps that we need to do to actually activate the true displacement so set the displacement method to true now let's switch to the rendered mode so we can actually see the displacement and finally of course let's open the modifiers tab and hit add modifier add subdivision surface let's switch it to the simple mode so it won't smooth out the geometry it will just add polygons and hit adaptive now we're good to go we can start playing with the displacement texture so let's add the math node click here and select multiply and let's put some value in here like 5 now we can press tab 2 times to refresh the displacement in the viewport ok let's make it even stronger let's set it to 7 and let's add yet another math node so let's subtract and set it to the 1/2 of the multiply value so let it be point 5 now if we compare the position of the plane before and after the displacement will notice that the plane stays roughly at the same position see no shenanigans happen whatsoever it's been predictable it's kind of good ok let's add the color ramp node and insert 2 just after the noise texture and by driving these flags we can control the contrast of the noise don't forget to refresh the viewport by pressing Tab 2 times what I'm going to do now is crank up the amount of details I'm setting it to 7 and hitting tab and now you notice sets we have much more detailed representation of the noise and as a repression that a black flag to the right some clipping is occurring I think this is pretty cool thing we can use it to our advantage with clipping and what else can we do to manipulate this noise is hit ctrl and click on these lines so we have created yet another curve thingy and it will allow us to find you in the noise in a really really cool way we can also select the interpolation method for example switch to base spline instead of linear and this will make the transition between the colors more gradual more smooth agitate once you have this basic set up we can add vector mapping node and also hit shift a add includes texture coordinates node drag regenerated output over here and connect it to the vector input of the non texture this will allow us to control the location of the noise to get different variation thousands of them obviously we can also adjust the scale of the noise for example set it to two it will mean the smaller pictures of the landscape or vice versa let's set it to 0.5 for example and now we have a bigger more pronounced features oh my goodness it's so convenient to generate the look of the geometry using the material nodes blender developers thank you so much and let's try yet another feature I have duplicated the noise and plug it into the distortion socket of the previous knowledge texture okay and let's add another color ramp and by manipulating this color ramp we can relay that distortion very small touch that goes a long way and of course you can imagine a lot more things that you can do using this simple technique and by the way we don't need these nodes because these nodes are pretty much the same what I'm doing here is I'm tweaking the matting and I'm hoping to get a brilliant result and share it on Twitter and whether we tweet ok let's talk about bump go shift a vector bump and drag this right into the height input and hook it up to the normal input of the diffuse shader we're good to go now we can start experimenting with the strength of the bump for example let's set it to two I created this helpful little picture to illustrate how this placement interacts with bump so what we can say just by looking at this picture is that bump is very important yeah it's very important especially if the subdivision rate is higher like seven pixels so they have frequency details from the bump map kind of compliment the large scale details created by the displacement let's move on to the next one tada number three generative modeling I love how it sounds maybe it's not exactly generative modeling okay guys so I created this cube and I press tab to enter the edit mode I'm pressing W and so I can subdivide smooth after that in britain t to open the tool shelf and I'm smoothing out so you may ask why not sphere hmm the subdivided cube has a much better much even topology that's why and I'm really now following the routine steps I'm adding the subdivision surface modifier setting it to the adaptive mode now I'm coming over to the materials tab crease the new material opening the node editor ollege stuff let's do a thousand times a day and it's so boldly but nothing we can do here we just have to repeat some things over and over again that's how it works okay I'm going to add the Voronoi texture this time to demonstrate how we can manipulate the large-scale details on the object in other words the basic shape of the object let's do it this scale of the portal annoys let's start with two and of course let's enable the true displacement in the material settings to see the difference and to really start modeling let's also add the math node and set it to multiply usual business as well and let's add it dropped over here to multiply and click and drag or just set the value now press tab two times the object has taken a stone like shape we can make its features even sharper for example let's set the value to seven and of the subtract node set it to three point five yeah then half of seven three point five this is not arbitrary of course we can do without the subtract node but this helps to keep the volume of the displaced object and the original object roughly the same in now I'm pressing the F key and the set key to scale the stone on the z-axis and I'm doing the same for the x-axis you can squeeze it and push it and do whatever you like with the shape of course if you are using the procedural noise to model this doesn't mean that you cannot use the other techniques and I'm fascinated by how quick we can experiment with the shape for example let's set the scales of three and bam this is a whole different story think about it just by playing with the procedural three noises we can shape our object previously before blender 2.78 we could play with the displacement modifier but this stuff is really much better all right I created the mapping node and the texture coordinate node and look at this we can do it one value like the explication and we have a different kind of object instantly we can take it a little bit further by combining a different noises it's odd the mix RGB node and let's also add the noise texture and connected to the second circuit of the mix RGB node also I'm going to add the color ramp and for now just to preview their second socket I'm going to set the factor to 1 next I'm going to create some crazy variation by adding a few different color stops by holding ctrl and clicking I'm not aiming for some particular results so I'm just randomly setting the contrasted colors and after I'm satisfied with the result I'm setting the mix mode to the add like I said before now we just have to press tab two times to refresh the calculations and the setting looks pretty good this is a pretty good base for the stone or for the asteroid or for the sponge and no let's set also the subdivision rate the pre grade to one as well as the render rate this means that the polygon size will equal the pixel size and this I should say this is a pretty detailed representation of the displacement isn't it you can use this displacement techniques for creating awesome asteroids and many different things and if you want to explore kind of a deeper inside of the forth the displacement modifier you can watch procedural asteroids chapter from space view Peaks very similar workflow but has very notable differences like the dark side of the force has some notable differences from July tide well alright the next way to use the micro polygon displacement is obviously to add this surface details in previous example we talked about the large-scale details and in this one it will be rather medium scale or even high frequency details okay so as usual we have this subdivided sphere here we can create it by adding the cube person charges or the edit mode W and then subdivide smooth a few times or alternatively by adding the subdivision surface modifier and applying it literally we have thousands a way to create subdivided cube in blender one of the greatest features of blender let's enter the rendered view port mode and start the displacement ball rolling let's get to the node editor press shift a select texture image texture a couple of seamless textures in advance we'll show it to you in a moment let's hit open let me get you the folder with the textures and let's hit this preview icon and now we see the little thumbnails we have load our displacement and a little bump these textures are seamless so if you're going to tile it you want notice the theme surprise I like to emphasize this this is crucial to have similar textures before you will apply it as the details as the displacement details because otherwise the ugly things might happen plus it open and if you have the knowledge rather than enabled now you can hold ctrl shift and click on the node to preview this node often so much more convenient to work with isolated one node then to try to distinguish what it does by looking at the spaghetti monster material and so on which much more convenient let's add now the texture coordinates node and the mapping node connect to generate the output over here and this one goes into the vector socket the texture now looks like it's projected from one direction let's turn the box projection on circular projection won't work anyway you enable the Box projection mode but three seams are not from our texture this seams are from the box projection itself even if we increase the scale we still see the seams fortunately we can just increase this blend parameter and the seams are gone that's also why we needed to have the seamless textures because when we slide texture like this or increase its scale the seam will inevitably appear down can hold ctrl shift and click on the diffuse node and connect the image texture to the displacement put keep top two times and the planet starts to look pretty small like a planetoid or or even a spherical asteroid this doesn't bother me at all let's add the math node to the to multiply as usual just because we want to control their strength of the displacement and if you set very high it will get completely messed up and look very very small let's keep it kind of balanced I'm going to set it to 1.2 something like that and to reduce their balloon effect I'm going to also add the math node set it to subtract and 0.6 oh look why because it's half of 1.2 I'm not even sure if it matters though after we are finished with a displacement part we can enhance it with the bump or with the normal map hit shift a vector bump connect the image texture into the height input and connect the normal to the normal input of the diffuse shader now what we can do is try increasing the distance of the effect but this looks a bit over-the-top for me I'm going to set it to something like 0.2 you can view the node and enable it back by pressing M and the difference will become completely evident if you zoom in a bit now you can really appreciate the bomb details they help aren't you and don't forget to refresh the calculations of the displacement by pressing tab and tab again and I think this is just a temporary feature I suppose it's in some next version of the letter the displacement will be updating automatically please will be even more convenient and someday all the tessellation will be completely real-time like it happens now in unreal engine for example e for real time stuff alright now I'm going to show you a cool trick let's add the mix RGB node right after the image texture and duplicate all these nodes connect it to the second socket now let's click on the scale and drag it down and stretch it all the way to the right this will really increase the scale of the texture let's set it to 3 just to round it up let's get in closer now we can really see the difference I hope what we can do to add this bump map details to our initial texture is just set the mix mode to add goodness gracious so many surprises in this tutorial so it is simply unbelievable in some case you might want to use the multiply mode but not today so let's get back to add mode with the strength of the effect related to 0.3 this is one very small but very handsome space ball made using micro polygon displacement you can learn more about this planet in this space they fix elements update but for now let's take a look at how we can optimize this for close-up shots because memory problem when using displacement can be very serious for example if we zoom in to the surface of this thing and try to render it out we can't intertribal very fast question then we can say blender technically now the camera view encompasses just a little chunk of this planet but if they adapt displacement algorithm will supply the whole planet anyway so if we set this dream rate for example to 1 and try to render it out by the way the resolution is 1920 by 1080 pixels so we can't please dreadful error it says out of memory Pam we're done one thing that we can do to overcome this limitation is to use the CPU compute instead of GPU compute if you decide to follow this route don't forget to go into the performance tab and set the tail size to the 32 or 64 slower number but that is a pathetic way to deal with this problem let's do it like the real nerds go back to the solid viewport mode by personal jet now let's jump over to the modifiers tab to do what I'm going to do next is add the mask modifier what's this modifier does it allows us to hide the part of the model based on the various group selection let's come over to this tab and add a new vertex group by pressing the plus I can call it a mask for example usually I insert some kind of joke here about Elton John whatever go to the modifier tab and select this mask as a perfect group you can invert it by pressing this icon but I won't do it now let's just press tab in the viewport to enter the edit mode and obviously we have to have these objects selected before doing it now unfortunately C key for the brush direction and selecting these polygons basically these are the polygons seen by the camera also I'm going to hit that to see the wireframe and select the polygons as well and when we have this tongue inspected it we can maybe deselect the unneeded polygons by hitting alt and drag in the selection looks pretty good to me now let's go to the object data tab and hit this assign button this means there's now this polygons have the weight of one we assigned these polygons to the mask vertex group and assigned the weight of one to the various vertices now we have to move the mask to the top of the modifier stack and voila this is quick and dirty and cheap hack this will allow us to render this chunk of the planet efficiently let's give the render button now and hopefully you have enough video memory to render it without a hitch and still have to render it out you can see that it took a 170 megabytes at - the right one but it's totally worth it once again often it's better not to push the displacement to simulate the smallest of the details use it for the overall shape and do the rest with the bump map and other textures all right bye stroller I hope you enjoyed the process in this tutorial we have covered four ways to use micro polygon displacement in planar terrain hide Maps export it from world machine or seed roads rain generated modeling just imagine what kind of custome bodies you can create also we just scratched the surface of this planet in the part 2 of this tutorial we'll take a look at even more fun stuff like this doodle so 5 more displacement tips to go stay tuned to the other tutorials from the space the effects elements free updates by eddie burrows from cg masters net and me Gleb Alexandra from creative shrimp comm takes place to the next
Info
Channel: Gleb Alexandrov
Views: 255,033
Rating: undefined out of 5
Keywords: micropolygon, displacement, tutorial, blender, blender (software), tesselation, adaptive subdivision, 3d, vfx, spacevfx, space, mountain, heightmap, world machine, landscape, planet, procedural, basics, introduction, essentials, creative shrimp, blender tutorial
Id: hlh9rrjG29k
Channel Id: undefined
Length: 34min 6sec (2046 seconds)
Published: Mon Jan 23 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.