Hexagon World with Geometry Nodes Fields - Blender 3.0 Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey folks welcome to this geometry nodes tutorial we're going to be starting to look at fields now on this channel which is kind of the new way that geometry nodes works i've not touched it yet because there were so many changes and new nodes coming in and it's finally started to slow down enough to where i think that anything which i teach you is going to stay relevant so that was kind of why i was delayed on this this video is kind of brought to you by skillshare more on them later on and in this one we're going to be making a hexagon world so this is completely inspired by this post by 80 level uh the christos stavros one just a very cool little project with all of these different hexagons being driven off a texture to give them different heights different like sea levels water different colors we're going to be going not exactly the same way this was all done with houdini we're going to be doing this obviously in geometry nodes and we're gonna be using uh some some different techniques to give us the different colors whereas now this was all driven off the height per instance that's something that we will be able to get to but it may not be until blender 3.1 but we just need to hold fire we've got a different technique to work on today and i'll show you what that is jumping into blender here i have got my geometry nodes workspace and we're just going to add an object any object create a new geometry news tree and i'm going to delete that group input so this is essentially just a container for our hexagon world i'm going to go ahead and rename this one to hex world there we go and now let's jump in here there's no convenient way for us to make a hexagon grid if you're familiar with surcharge then you may be aware that there is a polygon grid node that can do things like hexagon grids in various tessellations so you could do a hexagon of hexagons and we're going to be doing this with geometry nodes but we don't have the node so it's going to be a manual process hopefully that's right with you let's go into it so back in geometry nodes here the way that we're going to be starting is with a mesh line and this is just a nice easy way of working generating a bunch of points where we can set the position for them and this is something which is going to be you're going to get used to this workflow when working with fields instead of using attributes we're just going to simply calculate vectors and it's going to assign them by index so it's a really nice way to work if you haven't touched the fields branches yet then this is a good exercise to get into it with just to save us a little bit of time what i'm also going to do is i'm going to take my mesh line here i'm going to go ctrl g to group it and i'm actually going to just go ahead and delete from the group front those two options we don't interested in the actual positions of the line we will just be interested in the count itself so i've got one which i'm going to call count x i'm going to take another one which i'm going to call count y and i'm going to multiply these two together so think of this as making a kind of rectangle grid we have our x multiplied by our y and that gives us the number of points for the full thing right and all of our points are contained on this line so that's why we're multiplying them together if we want a 10 by 10 grid we need 100 points that's why we're doing this we're also interested in our count x being passed out because we're going to be using it in some of our calculations for actually generating the grid this is fine as it is here so just count as count y on the front multiply those together they go into our line and then pass through your count x i'm going to tab out here and i'm just going to call this one points just because it is our point generator so we have a lot of different options which you know when we're not looking at attributes anymore so our attribute sub menu is basically empty and instead what we're going to be doing is working on things like the index directly so we'll be creating vectors based on their relationship to the index for example if you want to position stuff in a line along the x-axis you may say that the x offset is just going to be the index so we go like 1 0 0 2 0 0 3 0 0 along that line so that's essentially what we'll be doing here let's take our index which is an input node i'm just going to drop it in here and i want to set the positions of my line so under geometry set position we can do this here so if i just add another node here the vector combine xyz you'll see what i mean so if i plug this into my positions i can now set the positions for example based on the x of uh so the index is the x position and we can see we have this line going up in x the way that a grid works this might seem a bit odd to be thinking about this but essentially we are going to be drawing a line like so this may have a number of points so like one two three four five and these indexes will actually be zero one two three and four right as we always start our index at zero and then we want our grid to go onto the next line and the next line so then it's going to come like so and like so and this will be 5 6 7 8 9 10 11 12 13 14 and that would be a three by five grid or sorry five by three grid so the way that we want to do this is that our x goes in the position zero one two three four zero one two three four zero one two three four right and then we'll manage the y separately and to do this there's a really simple math node formula is the modulo modulo on the math node so if i just set this to modulo and i set this to 10 then what we have is a line that goes 0 1 2 3 4 5 6 7 8 9 which is 10 points and then it'll restart zero one two three four five six seven eight nine and because we have this ten times right it's ten by ten grid it's just going to stack those things right we haven't done anything to the y and this is why we're passing out our account x as well just because i can pass that through directly and that's going to do the maths for us okay how do we get our y offset this time what we want to do is we want to take our index and instead of going 0 1 2 3 four five six seven eight nine or you know whatever in index order we want it to go like zero zero zero zero zero one one one one one two two two two two and so on like indexes but all of those that single row is clumped together nice easy way for us to do this take your modulo ctrl shift d so it brings the inputs and we're just going to divide it okay so we have our index now being divided by 10 so what happens is we have zero zero point one zero point two zero point three zero point four zero point five zero point six zero point seven different eight zero point nine and then it's going to go one when we get onto the next line and this is really useful because it means that we can use another operation called floor which just rounds down to the next integer so like 0.6 will become zero and this means that we will get that zero zero zero zero one one one one one and so on okay so divide and then floor if i plug this into my y there you go you can see what is going on there we have a bunch of points and then it jumps up to start the next line and the next line and the next line so far so good there's going to be a couple more things that we do but first of all i want to actually throw a hexagon on this so that we actually know what we're looking at previously the node that we would have used was the point instance node and in this case what we'll be using is the instance on points node it's a subtle name change but it has a few more options and it allows us to do a bunch of really cool stuff so this node has a green instant socket which means that we can actually instance geometry so if you generate geometry in the node tree you can instance it in the same node tree amazingly useful we also have a selection this allows us to say yes or no to certain points pic instance is it kind of an on or off we have an instance index so if you have a collection of instances then you can basically say like okay instance number zero goes on these points number one goes on these points number two goes on these points we're going to be using that later because we want our different levels like water sand grass stone snow and they're going to be our different kind of z positions and we're going to instance them in that way with this socket then we have our rotation and scale controls and these are on the node itself so it's no longer an attribute called rotational scale you just plug it into the instance node and you're good to go what we are looking for is a mesh primitive cylinder and i'm going to leave it all as defaults except the vertices which i'll bring down to 6 and that's going to give us a hexagon now i want to space these out a little bit more so that i can actually see them they're all overlapping at the moment and to do this we just need to add some multiplication into our maths here i could do this with a vector math node afterwards so that's in the vector vector math you will see me using the quick favorites so i just have math vector math and map range in here just because they're used all the time and let's just i'll play this all by one so now i can change my x scaling and my y scaling just on this vector math node now something that is going to be important is i want my rows to be like horizontal rows which means i want these to rotate slightly so i want these to be like flat edge against flat edge in their own row and you'll see why when we start to get them like really close up together so what i'm going to do is i'm going to rotate on just on the instance on points node rotation let's set this to 30 in the z and that's just going to rotate that nicely and now i can squeeze this in correctly here and we can see that is around about 1.7 the actual number is the square root of three if you want to know about uh hexagon derivations and making hexagons and things i will leave a link to a video about making them in shaders that i did before it's the same math so we're just doing the same math here just type into here in our x sqrt for square root open brackets three close brackets and that's going to be perfect there cool now what i want to do is have some control over this i believe it's 1.5 but i might want to tweak that later for the y value now we want every other row to offset sideways and again this is it's just all the same math that we use for making like fabric weave and knitting patterns and stuff like that in shaders if you're familiar with shaders and procedural shaders then coming into geometry nodes fields is going to be quite natural for you i have the floor value here for my y and this is essentially a row index right we have row zero one two three four and all i'm gonna do here is modulate this at two so we get zero one zero one zero one and i'm to add this to my x there we go so that is pushing it much too far out we only actually want to push out by half a step all we need to do here is make sure that we are dividing that modulo by two so just multiply it by 0.5 and there we go that's how you make a hexagon grid so nice and simple just a few little bits of maths to get things kind of weaving around as you want all right i want to now center this grid center it there's a nice easy way to center things and let's have a look at that so we're going to grab our geometry bounding box and drop this in like this and what i want to do is i want to find the the min and the max values and i want to add them together and then i'm going to halve it and i want to offset the position by that so it's quite simple just take your min max into a vector math node set to add we are then going to oops not on that we're going to scale this by uh sorry not 0.5 by minus 0.5 because we want to move it in the opposite direction and then we're going to use another set position this time i'm going to turn on offset which just means that we're pushing the current positions in a different direction and there we go so nice and easy now in this case it doesn't actually matter whether you use the add sorry the max or these two added together but if you're doing this on a more complex geometry which is not on that corner at zero zero then just adding them together makes that difference okay so we've got a little bit further now what i want to do is actually manually center this a little bit more so we've got it like in the general center which is great but you can see because of this kind of half offset it's not like perfectly centered what i'm going to want to do here is actually add 0.25 to my x so i'm just going to just because it's splitting the difference of that 50 offset right so we can take our geometry transform um and move in the x let's go this way it's not 0.5 it's 0.433 which is just a number to remember there we go that's perfectly centered now and the reason it is 0.433 so the radius of one of these hexagons i'm sorry i know it's a bit weird mass but the radius one these circles is like the center to the point the corner and that is a length one so this distance here is actually less than one um it's point eight six six there is you could just do the trig to work that out but um remembering it helps as well if you do hexagons fairly frequently you will remember those numbers the square root of 3 and 0.433 so we now have this centered exactly on a hexagon and that's very important because when we mask these uh you know we have this square of hexagons which is cool and all but we want a hexagon of hexagons so that we get the same look as we had on a cool little hexagon board thing so i'm going to make my hexagon grid a bit bigger let's go to like 5.0 there we go i'm just making sure that i'm leaving a point in the middle uh i have 250 000 hexagons and my viewport is very laggy because of this you may want to start out with a lower number something around like 200 perhaps let's go with that and then we're just going to make sure that we have if i reduce my y here okay so now what we want to do is create a hexagonal mask which is going to allow us to delete points which are outside the the temptation is to use the boolean but don't because the boolean is not going to work for itself we don't have any faces and secondly where you have intersections like where it cuts something it'll generate more points where you don't want them so what we're actually going to use is the geometry delete geometry and all we need to do is create a selection now for us to be able to see what's going on i'm actually going to leave all of these hexagons visible and we're going to plug it into the scale as we go because at the moment it's really difficult to actually debug a node tree and see things so let's just go ahead and add a texture gradient texture again this is one of the great things about fields we've got texture nodes inside the node tree there's a lot of stuff about fields which i'm kind of skipping over things like why do we have diamond sockets and why do we have dashed lines frankly it doesn't matter it doesn't it doesn't matter if you're using a vector the vector goes into the vector if it's a circle and it's a solid line that's like a solid continuous value like this minimum vector is going to be like as a constant vector whereas like this one over here because it's being driven by the index it's different for every index that's kind of the long and short of it anyway the point is we're just gonna be taking the factor of this and plugging it into our scale okay things have gone a bit crazy we're interested in the radial gradient which is a zero to one in a sort of polar direction that goes around in a radial direction and we can see that we have zero coming around all the way up to one now we want to do some math to this and again if you're interested in getting a bit closer to the maths the hexagon tile pattern video which i did for shaders that actually talks a little bit more about the maps and the trig and things okay so we've got the gradient texture we don't actually need a vector plugged in if it doesn't have a vector plugged in it will assume you mean the position i mean you can just plug in the position node right if you take the input position this is going to do the same thing but you don't need to so i would only bother plugging something in if it's like a different factor what i'm going to do is take this factor i'm going to multiply it with a math node by the number of sectors that i'm interested in which is sex because we're trying to make a hexagon so let's multiply it by six i'm then going to floor this so that i have zero one two three four and i'm also going to then add 0.5 because i'm not interested in the start of the vector like where this is zero angle and that's essentially what we're doing here we're generating the angle around the pole so i'm not interested in where it is pointing out horizontally i'm interested in where it points to the middle of each sector which is going to be like the 0.5 0. or 1.5 2.5 3.5 4.5 and 5.5 which is what we have now if i then divide this by six then what we have is something that we can multiply by our full circle right so we have if we multiply this value in here by two pi then that is going to give us the angle from 0 to halfway through this section and equally for this next one it's 1.5 so it'll be from 0 to 1.5 that's sort of what we're doing here and the reason that we do multiply and then pre-multiply post-divide is just because it helps us do the math right rather than needing to know what one-sixth is then we can just multiply work in whole values ones basically and then divide it afterwards we're going to now just take this multiply it by tau tau that's going to give you your angle make a little bit more space here and then what we need to do is actually turn this into a vector so if you have a triangle i'm just sort of doing this quite arbitrarily and you have an angle here theta and that's what we've just calculated right this number here is theta radians and we have a right angle triangle because we're interested in our x values and our y values so if we assume that we have a vector length of one so this hypotenuse is one meter this helps us simplify it but it also means that all of our maths is in terms of like multiplying and proportions and it just helps everything stay very simple right so our triangle has a hypotenuse lengths of one we have our x now y as our adjacent and opposite sides you'll you'll hear people talking about that when they're talking about trigonometry the adjacent or the opposite or the hypotenuse so if we have sine of the theta of our angle this equals the opposite side divided by the hypotenuse this value here is equal to sine of theta in our case the hypotenuse is one so we can get rid of it because we're just dividing by 1 and the opposite side is y let's replace that so in terms of our vector sine of theta we have beta is y and cos this might not be a surprise at this point is adjacent over the hypotenuse hypotenuse is one therefore we can just be left with the adjacent which in this case is x so you can just use this angle that we've generated put it through sine and cos and that will give us our x and y component of the vector all looking good so we have this let's grab cosine this one is going to be our x and sine is going to be our y let's make a bit more space and we're going to use a combine x y z in our x and y here we go this is going to give us our vector so this is a vector pointing out into the center of each sector like so and then what we need to do is the dot product i know i'm throwing maths at you but essentially this is how we can do it so we have our vector math node find the dot product we're taking our vector and the position vector so this is just our general overall coordinates and i can plug this in to the dot product like so and now you see if i plug this into the scale instead and i'm just going to use a map range node if i here we go reduce that a little bit you can see that what we have is a gradient from 0 at the middle going up and out so what this means is that we can actually use this we can basically say where is this less than some value and use that as our selection mask to remove points which are outside the hexagon that we're interested in so i know that was a bit of a bit of a trudge to get through the math there if you're not used to it but it does give us very accurate selection areas and a selection if you're again if you're used to shaders a selection is simply a black and white mask so what we've done is we've created a essentially a value per point and we can say is this greater than or less than a threshold and where it's less than we want it to say no and where it is greater than that threshold we want to say yes and then we're going to delete those points where it says yes that's essentially what we're doing here there's a nice node for this called the float compare floats so this one allows us to take a float in and it will output a boolean just a yes no so if i plug this in and here we go we're going down actually so negative values but you can see what's going on we're creating now a hexagon of tiles i'm actually going to leave this at -20 and that's basically just going to give us hexagons that are within this space cool cool so now we have all of our hexagons and they're masked and that's actually a large part of the challenge here let's talk about skillshare skillshare is an online learning community with literally thousands of classes these are in a range of topics from things like fine art to illustration and business management skills you're really covering all of the kind of professional skills for a creative individual who wants to elevate their work one that i've been following along with at the moment is do things tell people the power of personal branding by hamza khan so good for taking you from just you know from making the work that you make to engaging in that work with a broader community a broader audience and creating some kind of brand and brand presence around the work that you do and that's obviously so important if you're wanting to turn you know something into a into a living whether that is as a full-time creative individual or if you're just wanting to elevate your sort of your work ethic and go for things like raises you know having that personal branding is so important something that he talks about a lot in this class is storytelling and about how you're not pushing a brand you're not pushing a business what you're really trying to get people to engage with is a story you know trying to get people to connect with your story your brand's identity and those reason for being i've been working through this one and i've been really excited about getting engaged with the different exercises so i've done things like making my own website now which is in progress but it's on its way and yeah there's a lot of really cool stuff in here a lot of really thought-provoking stuff to get your teeth into if you're the kind of person who enjoys learning through this kind of video seminar then i definitely recommend this course there's so much to get your teeth into there's so much to look at and skillshare is all about that you know you just sign up to a class jump in it there's no adverts no distractions you can just engage straight off leave comments talk to the community talk to the instructors and uh yeah you can get to really push out some projects and just have fun with it have fun in learning in this way if this sounds like something that you'd be interested in then check the link down in the description as well as the pinned comment the first thousand of my subscribers to click that link will get a full month of skillshare premium all right let's get back to geometry notes and what we're interested in here is how we can now scale these and move things around and have a little bit more control i'm actually going to do this with empties because it can just be nice to have a bit of 3d viewport control makes it easier to animate if you want to do you know little turnarounds and things like that so then what i'm going to do is i'm just going to add two empties i'm going to add a cube empty here we go and i'm also going to add a sphere empty there we go i've got these two here i'm going to call the cube world and i'm going to call the sphere texture and these are going to control the density and height of the world and the density of the texture and position first of all we're interested in the world one so let's go back to our node tree i'm actually going to pin it just so i can click on other stuff without it going away and i want to bring in my world empty here to make sure that we're always looking at where this is kind of relative to our object we can set this as relative and now all we need to do is add another transform because i want this to not affect our offset there i just want this to be changing the scale of this so you can see if i now scale this up or scale it down you can see that this is moving our points accordingly now just to make sure that everything lines up with our hexagons i'm also going to plug this into the scale down below on the instance on points so now what happens if i scale this is the whole thing gets bigger and you can see this kind of jumping as it loses edges because of our mask right we're masking it within that 20 meter area cool so this is working perfectly i'm just going to leave that there just so that we can get things nice and visible and now what i'm interested in is controlling the height this is where stuff gets a little bit more landscapey at the moment we just have some hexagons in a nice little pattern what we were interested in is changing the height of them based on a texture you could use a an image texture not as of today but there are commits coming for the rest of the textures right now we just have things like noise for an eye white noise and gradients we'll be using the noise texture anyway today so it doesn't matter that we don't have that image texture but it will be added anyway in time first things first let's change this to 2d because we're only really interested in that like top down projection and for convenience i'm just going to turn off the detail next thing we're going to do is i'm going to actually duplicate my position and i'm going to plug it into the texture now i said before don't bother plugging things in because it's automatically going to use it however in this case we want to control the position scale and rotation of our texture with the sphere empty so let's go and drag that texture empty that we made before let's set it to relative and we want to do some things to the position vector for visibility i'm actually going to just plug this into our scale and i might also there we go just reset that instead of color let's use the fact so that it's even and we can see what's going on i'm going to move my two empties off to the side as well just so i can see them a little bit better so i have my texture and what i'm going to do is i'm first of all just going to add a bunch of math nodes and back to math nodes so let's just add the location that's the first thing to do next one is rotation so we're going to add a vector vector rotate set this to euler and we're just going to plug this into the rotation and then we can also set our scale which we can do with a multiply there we go all right now let's look at what happens when we do stuff if i move my empty to the right the texture is changing too fast so let's reduce the scale down to one maybe even lower here point three ish so if i move it to the right the texture goes left so i need to change this add to a subtract and now we can see this goes in the correct direction cool if i rotate it it's actually rotating the wrong way so let's invert that vector math sorry that vector rotate and now it rotates correctly and what happens if we scale it well again i want it to go the other way so let's set that to divide and now you can see that we have a nice little control following our empty awesome so when you're working with like positions point data for your textures you often feel like you're doing things backwards if you're using a controller in this way so just to be aware of subtract invert your vector rotate and then divide now we don't want to control all of the parts of our scale here we're only interested in the z component of our scale so let's go ahead and just join up our original value from the world one and i want to multiply this by a vector which control which contains the um the noise texture in the z so let's go ahead and add another vector math node just delete that one there and we're going to be multiplying by a vector combine x y z let's start off by setting this all to one just to make sure that we don't have any sort of loss there and what happens if we just plug in our noise to the zed it's all right it's getting there but we have a few more steps to do so first of all i would like to i want to set up my texture a little bit so let's use a map range which you'll find under utilities map range and i'm just gonna clamp it in a little bit so you can see where these go white when they're actually being multiplied by zero so i'm happy to lose some of them i'll go for maybe point point two or something is fine because we can always set our 2 min which is the actual value that gets multiplied out but i want to make sure i'm like touching the end of that noise texture we can then at the other end if i flip my input and output so sorry the the two min two max which is our output values here if i flip them around then i can do the same thing reducing my from max until i see that some of these are starting to go down to zero which is our two max value now and then i'm just going to set these back to the correct direction right now this is all looking quite bitty and to rectify this let's go ahead and scale down our world one which is going to give us a little bit more resolution and then i'll also scale up my texture one which is going to make this a little bit smoother so now you can see as we change this these all get scaled up now there is a little bit of an issue and that is that we have the same on the bottom and this is because our cylinder is not centered on its base it's centered on the bottom uh centered in the center we could always just use a geometry transform and move this up into z axis and that solved that when we actually come to make our own cylinders which we're going to be using to test like different materials in different places we're essentially going to do the same thing we'll move the origin to the base we can see we have a few flat patches so let's make sure that we have nothing coming out as zero and this is also going to look pretty neat i can do something like changing up my distortion maybe 0.5 just give it a little bit more interest can always set some detail if you want detail and again you could change your scales on here just make things a little bit different i'm going to set mine down to point one just so that my empty has a bit more it's a bit more so neutrally scaled there we go all looking really cool i like how this is coming out we're now going to do something which is optional on the example you can see in some of these that we have this sort of sea level hexagon i don't really know what else to call it where they have removed hexagons which are below a certain level in the noise and they have replaced or they have put in a hexagon inside which just sort of fits that whole area we're just going to do the same basically i'm yeah i'm just going to put in a hexagon i'm going to delete other hexagons so to remove hexagons we're going to use this selection input and i want to find hexagons which are below a certain value there's lots of ways to do this and you can always try and make things work together as much as you can i'm gonna do it a little bit more haphazardly because i'm not too concerned i want sort of different controllers so i can change the sea level compared to how many points i'm removing so i want that separate for mine what i'm going to do is i'm just going to delete certain points here so i'm going to go for greater than in this case 0.2 which is where we're clamping our map range and i'm going to plug this into the selection option so right now nothing except from these three gets deleted we can always increase this and you can see what happens there certain points get removed and you can set this however you want now you could also set it after your map range if you are inclined and you can also make this a little bit steeper by changing it to smoother step or you could even do something like stepped linear if you want this sort of terraced look which is a bit more a bit more minecrafty if you're into that so i might set mine to smooth the step just because it gives us a little bit more interesting variation and i'm going to set mine just in here about 0.2 something like that and now what i want to do is i want to create a hexagon that fits the uh that fits the board the way to do this is to find out the size of our hexagon points pre instance so let's go ahead and do that geometry bounding box i'll join this up i'm just using the uh the node wrangler add-on it all works and i'm interested in if i go into my z position so the maximum radius is going to be the x the x size so let's go ahead and use a separate xyz into my max value and i can find this x here this is our radius for a cylinder let's go ahead and use a mesh primitive cylinder vertices goes down to six plug this into a radius and i'm going to ctrl shift right click to get those to join together oh i plug that into the z for some reason i mean the x there we go so we can see that this is now properly like on those edges and if i was to do something like changing my less than here then you can see that this is gonna kind of match it fits these nicely i'm going to leave it at -20 which is fine for this also a little thing if you're not aware of fields yet if you want to inspect what a socket is putting out then you can hover over it it only really works for constant sockets the round ones because you can see um a specific constant value if i were to look at a gray socket uh actually in this case it is putting out because it's coming through a constant that does work but if you were coming through something like this then it would say float field based on the attribute position i'm interested in tweaking this so let's go ahead and set my depth to 1 and i'm going to move it up geometry transform up in the z axis by 0.5 it's going to bring us up into the right position and then i'm going to use another transform just because i want my scaling to be separate so i want to zero so you can see if i change the scale on this first one we lose that bottom position whereas on the second one we're now going off that bottom position so if i want this to be kind of within that space here we can see this is 0.11 and so what this is going to be is around about uh half the the scale coming out of here so all i'm going to do is i'm going to add to the the two min let's go ahead and actually add some of our stuff from the front of the node group so we're going to use a group input node now i'm just going to plug into two men to max these are our height min and height max and i'm also going to plug this one into a combine xyz so our height min goes into the z and i can just bring this up and plug this into my into this one here so if i go onto my object into my modifier if i start messing around with these you can see that we have this coming in like that we're changing the height of this and that's working out all right what i'm also interested in doing is adding a control for where these get taken away so i'm going to set it to 0.5 i'm going to plug this in and i'm just going to call this one erosion so i now have a control for where we lose our points into the c and i'm also going to use an add in here just for our sea level so i can have a controller again on that group input just to control sea level just in case i want to you know have no erosion and have my water level quite high sea level there we go so this is zero we can see that's fine and if we increase this then that is going to come up nicely all right i'll leave it at zero for now i'm gonna reduce my erosion a little bit and we can see you know sometimes you're going to want to bring this down just gives you as much control as you want really okay so i'm going to delete some points i'm going to increase my sea level just so it's not quite at those bottoms and there we go now if i was to start changing stuff like the resolution well that all works nicely and if i want to move my texture again all works nicely and it's really performant as well so one of the great things about working with geometry nodes is it all just kind of works quickly now ones if i change my z height just the z that can control the overall height and we can also control this on the max height value as well if you want if you want that there okay things are all starting to get a little bit crossed over and they re-root some of these now the next thing for us to do is to actually have different types of cylinder if we want to have water for our general like base one and then we're gonna have sand grass stone and snow to make up the rest of this of course you can use whatever textures you want whatever shaders you want and you can instance additional things on top if you want as well which i know they did in the uh the example that we're kind of going off here first things first let's create our cylinders i'm going to do this in a new collection i actually have one here called hidden which i'm just going to use let's go off to the side we're going to add a a cylinder and if i pop this open here change this down to 6. this is all fine so let's go with that this is fine as it is except from our origin needs moving up so let's go ahead and just grab said one there we go so that was cylinder number one we're gonna make four of these two three and four and conveniently they are different colors so we'll be able to add shaders as needed i'm going to go ahead and grab a collection input node sorry collection info node i can delete these cylinders and transforms let's plug these into our instances and i'm going to select my collection which is called hidden in mine there we go now this looks very cool but it's not exactly what we want let's go ahead and make sure we are separating our instances which make sure that all of our points are different we need to reset the locations and we need to pick this so this this option tells us whether or not we want to pick the whole collection or just a single item from that collection so turn on all three check boxes and now we have got ourselves a nice little array of hexagons we can get rid of this rotation from our instance node and this is all working nicely now right now it just goes like zero one two three four zero one two three four zero one two three four on repeat which is why we can see that this is a pattern here and we actually want to use the instance index based on our noise so go ahead and grab your map range i'm going to ctrl shift d on here i'm just going to remove those bottom two parts there i'm going to plug this into the instance index and you can see immediately this is working quite nicely if we're going from zero one two three uh the values that we want really are like zero to three point nine nine i wouldn't go over four because sometimes you can end up like cycling and picking your sand to go at the top of your mountains it can be a bit annoying but here we go so now we can just change our inputs to change the sort of distribution there cool so this has seemed to have done it in order which is nice so let's go ahead and just add some shaders now i'm just going to go into ev preview and we're coming along here so let's make sure we can see the whole thing let's add a shader we're going to add a new shader for the sand or something like this so that's just going on there and that we're also going to add a shader for the grass i'm just making these flat colors of course you can do whatever you want green for that i'm going to use a like a gray for a sort of stone patch where there's no foliage and i'm just going to leave that as white for the rest of it now what about our actual water well you can make a blue texture if you want i'm actually going to use the materialic one because my god the water textures in here is so good so let's go ahead and summon a material using uh in the glass and water category we're using the water from a lake now we don't see anywhere we need to assign it to our hexagon so let's go ahead material set material and i'm just going to grab that there and save so this is all working pretty nice i think this is basically done i'm just going to go back into my layout i'm sure we'll see something in a moment which i'm going to change but for now let's hide our inputs collection those original hexagons i'm going to go into rendered view i'm going to go and just grab one of these default hdris so i do just want to show you this water because it's so cool it's animated as well i don't generally get like material add-ons because i like i make a lot of materials but this one is so so good maybe do we have any stronger sun let me increase the water level as well just so that you can see it's like a volumetric one so you've got volumes you've got core sticks which are really nice and also they're like fake caustics so even if you turn off uh call sticks you still get them let's go in here damn it's so good i mean look at these cool sticks they're beautiful and the volume thing it just feels like being underwater and if you play it you can see that this is all and you get those like god rays coming through the it just looks so good it looks so good anyway so that's the materialic add-on it's by the same people who do botanic the like the popular foliage add-on anyway let me reduce that sea level just so we can see things again go with this okay one thing that you may want to do is bevel this so i'm just gonna add a bevel modify afterwards it's nice because it's kind of maintaining the um it's like maintaining all of the different objects as instances even though you're beveling it which is great and also because this is happening after the scale we're able to get a cons like a consistent bevel across everything rather than it being stretched according to how tall the point is if i move my texture one i think the bevel is maybe slowing it down yeah a little bit so if we move our texture empty you can see that's pretty performant i mean that's pretty pretty good on there you can change the size of this make it bigger make it smaller and obviously rotate it and do whatever you want to do and you know make one of these and tag me in it just go exploring these things are great we can also change the the resolution if you have if you make it too small and you find like here that you're running out of tile points all you got to do is go into your geometry node setup and increase your x and y count so change this up to like 500 and that's just going to basically make sure that your tile stays like bigger than your mask area obviously then i could make this smaller so i have more land to explore you will just need to be aware that your bevel if you have really small tiles like this may look a bit aggressive so you might just want to tone that down a little bit but again isn't this just so nice you can just go exploring it's really not really lovely and you can set the height of these things and which i would probably actually do with my world one so let's scale this up a bit what i'm actually going to do is i'm going to generally scale it up because this is hitting my performance a little bit here all right so you can change up your zed height on that empty and that's just going to give you a little bit more a little bit more variation in here which is always nice i'm not sure if it's just me but i feel like the noise in cycles x has got really bad recently like when you're moving around this is like it's being bruised that first pass is just not not pretty but anyway we can um increase our sea level a little bit all right i'm going to leave this as it is now and i want you to go and have fun play with these make your own world go and explore it all right so there we have it your very own hexagon world with all sorts of control for different things controlling the sea level controlling the amount of erosion that you've got controlling your sort of your maximum height and also just being able to control your textures so scale and your you know your world scale your resolution of the world here in essentially real time and in blender this is not houdini obviously we're basing this on a houdini project but don't have fun with it go and enjoy the new procedural tools that you've got with geometry nodes i'll see you in the next one [Music]
Info
Channel: Erindale
Views: 79,996
Rating: undefined out of 5
Keywords: blender, shader nodes, shading, beginner, procedural, material, nodes, shader editor, introduction, tutorial, eevee displacement map, eevee displacement node, blender pbr tutorial, blender pbr textures, blender pbr textures free, pbr textures in blender 2.9, Blender 2.8, vfx school online, blender tutorial, blender eevee, blender enviornment, blender easy, blender easy tutorial, blender cycles, intro to blender, blender 3d, b3d, learn, free, concept art, parametric, computational, design
Id: EboNtLKn_m8
Channel Id: undefined
Length: 49min 23sec (2963 seconds)
Published: Tue Oct 19 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.