Tutorial 4. Introduction to VOPs

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Oh for this fourth tutorial we're going to look at the Vox node or to be more precise the attribute pop node and I'm going to show you how you can use it to create a low polygon little planet with natural surfaces and variation and tree growth very simply this is a fairly advanced node so I'm not going to cover everything that would take me hours so we're going to look at the basics it's quite early to get into this but I think it's so powerful and so useful that it's worth introducing you to early on and you're going to be able to do a lot with it so let's start by dropping down the geometry node now we're going to put in a sphere because we need something to work with here we drop in a sphere and let's make it a polygon we've got a nice even distribution of points over the surface I'm welding cruces the frequency hits make it 10 now we hit tab and take a four attribute drop the attribute fob is a vector operator and what allows you to do is take the components on your object and edit all those components at the same time it's actually a variation on shader Network so if you work with shaders before you'll probably find a lot of things in common in fact it uses the same network as Houdini does for its shaders so we'll be covering that again later on we open it up you'll see what we have in here is another network only instead of running from top to bottom we're running from left to right we have a menu on left which represents different attributes which I want to manipulate and on the right we have the outputs if we look at the attribute pop top level you'll see that it's running over points you can change this so you could ask your attribute Bob to run instead over primitives or vertices and there's actually a variant on the attribute table which you can use for manipulating volumes where now though we're going to look at points and the principles of the different types of attribute pops are the same so let's open it up and look at the various attributes and compare these to the geometry spreadsheet you'll find this alongside your scene view I refer to this so often that I usually make a window for it so that I can keep it open so let's split the pane top bottom and you'll see you have a copy of the geometry spreadsheet here I can pull it down because we only need to see the first few points and then go back to our scene dia now the general tree shape spreadsheet shows you the attributes on all the different components of your geometry the first one is points which is what we're working on now but there are also values for vertices primitives and detail which is a special kind of attribute that's attached to the entire object so you already have one detail attribute current object now if we go back to points let's connect up the sphere because we don't have anything in there at the moment now you can see that the px py and PZ have values and there's a value for every point these represent positions of the points which is pretty straightforward so if we were to move the sphere these would change so let's scale it and see the point values change at the moment these are the only attributes that we have I'm assuming that most of you will have worked with shaders before but in case you haven't I'm going to give you a quick tutorial on that using math to manipulate values if you hit the tab menu inside the pop node you'll see you have a completely new menu of nodes which could be a bit overwhelming however a lot of them are very specific or they're not relevant to geometry so a lot of these nodes are designed for shading so there's actually a fairly limited number that you will use 90 to 95% of the time so we're going to look at these first of all I'm going to drop down a constant node constant is simply a set value so it defaults to 0 which we can plug in to one of the attribute outputs and I'm going to plug it in to CD which is the Houdini symbol to represent color so it has three channels RG and B and you can see them here and because I plugged in a single value it set that value in all three channels so we have 0 0 0 now if we change that value it will increase it so if we bring up 2 1 1 1 we now have white however a color you would expect to have 3 individual values so let's turn it into a vector a vector is basically a number that split into 3 so you're looking at 3 different fields and this is exactly what we want for a color so now if we make the red a value of 1 and keep the green and blue at 0 you'll see we get a red sphere we can start mixing these so that's made the blue one is well then we get magenta this isn't a terribly intuitive way to input it so we actually have an option to input the color directly now when you're working with shaders or with mobs you can start manipulating these colors so let's try multiplying two colors together I'm going to put down another constant it's gone I'll just type in constant quicker and change that to a color and now but don't multiply node multiply node we'll just keep adding input so you can keep multiplying as many color as many values as you want together so now we'll put the output into color and you'll see we once again have black because if you multiply anything by zero the result is zero if we start increasing these values you'll see we're approaching our original color again so for the result of the multiplying node you will get each of these individual values so multiplied by each other so 2 by 0.18 one point six by point zero seven five and two point one by point six one six [Music] we also can add these members together so you add two values together you will always get something brighter unless one of them is negative of course so we're now looking at a brighter value than the original one when you multiply two numbers again provided you're multiplying by something less than one you're usually going to come out with something darker so now let's look at some of the types of nodes that you might use day to day in your pops first of all we have the combined modes nodes these include your adding your multiplying so this is how you would blend together two different values for more than two values with some more complicated ones here and like maximum we'll always look for the largest of the two numbers that's coming in color mix is quite a nice one so we can put our two colors into the first and second inputs and then play around with the bias which will blend between the first input and the second input the next useful set of nodes are the convert nodes most of the time you'll be looking at float to vector vector to float and this will allow you to convert through from a single component value such as 0 to a vector such as 0 0 0 which is the sort of thing would need for color or position next we have the math nodes which we've touched on already anything that you can do with two numbers you can do in Bop and you can achieve some really interesting effects with these for example if you take the sine of a value you can start getting values that move between 1 and minus 1 instead of a straight linear value but again this is something that would be looking at in future then we have noise which is a lot of fun and we're going to look at that in more detail in a minute and patterns which again we'll look at in a minute and finally we have the utility menu which contains bind and bind export which allows you to create your own attributes to attach to your points and we'll be looking at that later now I'm going to delete what we've done so far and look at some of the things you can do with the position node so at the moment the position that we have coming into this node is the same as the Perdition position that's going out of the node which is the same as a straight line from P to P but we can start to do some things with it now let's try adding let's type app there's a variation on the add node called add constant which allows you to just input a value for the second number so you can see here that it's added one to all the P values you can see them changing down on the Left and what we're doing is moving the entire object by one in all directions what's usually a lot more useful when you're working with position is to work in the direction of the normal and there's a node to do this so if we type in we get a node called displace along normal and that's what missing and instead of adding r1 we want to have a constant value and we put this in terment so now each number that we add is being added in the direction of the novel if we turn the novels on you can see this so we're going a little bit further along that normal line now every time we add some more to it we don't have to keep our attributes separate either we can start mixing them up so for example if we take our position attribute and plug it into our color we now have the position value represented by a red green and blue which can be really useful to see what's going on it takes a while to get your head around the idea of seeing position in color you see the bottom left corner is black because all those values are less than month it's one of the limitations of displaying numbers in the color is that all values under 0 are displayed as black now we're going to take a look at the noise nodes so it's type in noise and you'll see there's quite a big collection of them the simplest one to work with is the anti alias noise which gives us a nice soft cloud it requires as a bare minimum physician input which tells it whereabouts in 3d space the points are sitting so if we hook that up to our position and then put our noise output into color you'll see that we're getting a cloudy output an awful lot of it is black and that's because as I said everything underneath zero is represented as black and the output of noise is actually well we can see here so if we look at the colors we click this will see the maximum value is not point three and click it again and the minimum value is not point three one the easiest way to fix this is to use a node called fit range type in to fit the top one that comes up so we'll plug that in and you'll see we've got four values here this is the values going in and out and this is the values sorry this is the maximum minimum going in and these are the maximum minimum coming out now we want to take our values going if we looked on here so our lowest value is not - not point three one so that's our source and our highest value is not point three eight and we want to take that range and squeeze it into 0 & 1 so that everything is visible in our color so know you'll see there are almost no completely black points it can look like the noise we're seeing is wrapped around to the surface of the sphere but in fact what we're seeing is a sphere shape cut into a 3d volume of noise this is a bit clearer if we start playing around to the noise so we can offset it now you can see it's moving now if you imagine the sphere as a sphere of light inside the smoking-room it might be a bit easier to imagine what you're seeing so the smoke is moving across the sphere and it's just picking up the intersections we can change the frequency and we can change the strength and we can work on the roughness which is it's like a second level of noise on top of the first very simple one which gives you a bit more detail you're not getting much resolution this because there isn't a lot of detail in the sphere so there aren't actually that many points to work on if we go back to our sphere and increase the frequency to 20 you can see a bit more detail let's rank it right up to a hundred to see how it looks so now you can see that there's a lot of detail in the noise the only reason it looked blurry to us is because the sphere was quite low resolution isn't going to be slow so I'm going to take the frequency back down the output we're looking at here is one D which means it's a single component and the result is black and white but we can change this to 3d noise so each color channel is being acted on individually and now that we've got three color channels we can also add this to our position so let's plug it into the amount of our displacement along the novel so now you see that all the points are being offset by different meds this is probably a bit much so what we want is a way of turning it down a bit a nice node to use for this is the mix node the mix will let you have two inputs and it will allow you to scroll between them so you can use more or less of either one so for this one we actually only need the input of our noise because our second input we want to be zero so no influence at all and exactly in terment so the bias is taking us from the first Pitt input which is zero so you'll see that's back the way it was and the second input which is no influence at all so this way we can pick exactly amount of displacement that we want let's go back to 1d noise now because it makes things a bit simpler to understand so you can see the areas that are white have been offset by more than the areas which are black now let's look at some of the other types of noise there's a variety of noises here but actually the easiest way to access them is using the unified noise node which actually contains all the different types within one so let's plug our position in here a lot more options here because there's a lot more to cover and I put my noise there are a huge number of settings here so take a look at few of the different noises and probably the easiest way to show you this is to look at the unified noise help documents which has illustrations of lots of different settings that give you interesting results so if we open this up that's grilled down so you can see there's some really interesting stuff that you can do with these noises each of these has the settings that we use to achieve it you can create more complicated noises by taking the output and performing maths on it or combining two different noises as well I think it's on point in the future we'll have a tutorial just devoted to noise like that for now another set of options that's quite interesting are the patterns so you'll see here there's some more artificial shapes that's for example look at the stars something that distinguishes patterns from noise is the patterns work on movies rather than positions what we can do is take the p value and plug it into UV and what this will do is take the first two components of P so it's expedition and Y position and use it as you beasts so let's look at how that would display so you can see effectively it's as if we're projecting it in the z-axis it's only using the X on the wire I'm going to jump ahead a little bit and put some movies in here and by default movies work on vertices that's nearly always how you'd want them to work but because we're working with points here we need them on points so we'll plug it into our points and let's go back into attribute Bob and plug our you reason and now if we make changes to projections here you'll see that it affects the way the image is split let's go back in and play around with our stars increase the frequency and make a few are random and in the same way as we use the noise we can plug this into our displacement as well so we get some interesting effects no we're going to go back to our nose and use it to actually create something so delete the stars I've the output by noise into color and into our position let's increase the frequency a bit until we've got something that might look a little bit like a planet to get our colors rather than using the three dimensional noise which is a bit hard to work with we're going to use a color mix node which we looked at briefly earlier instead of plugging in our primary and secondary colors this time we're just going to use the ones that are inside the node so if we plug or take out fitted noise and put it in the bias that's what blends between these two colors and then stick this in the color output see now we're getting two colors and we want the low areas currently pink to be blue because this is going to be our C and we want purple areas to be a kind of sandy green this is going to be our land there isn't a lot to anguishing the two colors at the moment so if we play around with our flip values we should be able to change that so let's try bringing these values a bit closer together makes this point too so you'll see that by bringing in the inputs too closer to a single number we're establishing a threshold we don't want it to be a completely sharp line but we want it to be a lot closer than it is at the moment let's try 1 point 1 it's just starting to look a little bit more like seeing land noise is probably a bit random at the moment so if we take the roughness down a little bit we want to make our land higher than C and give that a nice sharp offset as well so we'll take the up value from here plug it in and we don't want to offset it by quite as much as that and animate our sphere little bit lower resolution that's try 16 and finally one our edges to be hard so we're looking at intentionally low polygon object so here at the moment we're displaying our edges of smooth well change them to flat shaded and we'll check keep plot where shaded so that you can see the edges on them let's play around with our settings a bit more here we go so now we've got a little planet with some islands on it back to the noise and tweak the frequency a little bit bigger Islands there now we want to try growing something on the island to do this we're going to create an entirely new attribute from scratch so if you look at our spreadsheet now we have three different attributes we have position color and our UVs which we plugged in earlier now we want another attribute which is called P scale this is a very special attribute that you can create manipulate within Houdini which can be read by different types of nodes and it's basically scale per point the points don't have a scale so you wouldn't see that normally but if we're using those points for something else it can be really useful to have a scale attached to them so I'll demonstrate first of all we want a bind node the bind node will either bring in attributes from outside or will allow you to export new attributes from the BOP the one we want is bind export because we are creating a new attribute and at the moment let's just try plugging in again our fitted noise so we the bind the P scale is one dimensional value so it's simply a single value we have to call this value B scale all lowercase and that way Houdini knows what it is I know this doesn't sound like a very procedural way to work to have to know the names of values that do things but in fact this isn't this is fairly unusual within hoody most of the time we'll be creating our own names for attributes and then reassigning them elsewhere so it's simple float so we can leave that as it is the default zero which is what we want and we don't need to hook this up to anything because this effectively is an output node if you look in the geometry spreadsheet now you'll see we now have an attribute called P scale now let's give it something to do I'm going to give you a quick preview of a node that we'll be looking at soon which is the copy node copy two points and what this does is takes an object which we put into the first input and a group of points in the second input and it copies one instance of each object onto those points so in the second input we put our sphere and we use the points from that sphere which switch them on to remind you look like that now each of those points now has a value called P scale this anchored input I'm going to put one of the trees from my favorite ring in the first tutorial so I'll node and load up one of my trees I've saved it as a Geo which keeps a color information which is quite nice to have and then we plug that in quite so what we're looking at here it's lots of copies of trees placed on each of the points and scaled by the P scale value so Houdini will look when it uses the copy two points note it would look to see if that P scale value exists and if it does it uses it for scale so now each point has its own scale attached to it these trees are actually rotated incorrectly let me just fix up okay so now all the trees are sitting on the surface of the sphere we're only seeing the trees because the copy to points isn't taking the original input original object as an info it's just using its points so now we need to merge it with the original sphere again we can see a whole lot together now this is probably overkill on our trees so we want to reduce those values a bit and to maybe add some randomness to the trees something else that is happening that we don't really want is the trees are being tinted by the color of the object underneath so you can see each tree is just a flat color that it takes from the point we're going to copy two points you'll see there's a list of all the values that are being copied from the points and we can add or subtract from these a little hat symbol will remove a value so if we type in the Hat and then CD for color so you can see that's the same as the attributes color values hit enter now it removes a color value and it's using the original color of the tree let's go back into Bob node and see if we continue at the trees a bit I'm going to do this by adding another noise that's offset slightly so copy and paste that and to combine them I'm going to use a master node called min which takes the lowest of the two values and this will ensure that our tree values are never higher than the input which means that where there's water the water will keep those values below zero and we won't get any trees growing there this is only for a skill so let's let's take that I see output fit plug it into our find note and now our trees are much smaller still pretty even though so I'll turn up the frequency so if we get bit variation into Messer if you want to know what's going on it can be helpful just to temporarily plug this into the color node now you can see what is that's actually driving those values there's a lot more randomness going on there original color back in unless financing off of it we're getting some odd touches here and in fact what you're seeing is because these values are less than what less than zero you're having negative trees growing inside a planet which isn't really what we want so we want to clamp everything to make sure that nothing is ever less than zero so we use another math node called clamp and now our lowest value we ever get is zero and you can see that the inside-out trees have gone so now you can see how you can use a pop node to create a huge number of different effects and something quite organic from our noise something else I want to cover quickly you can promote parameters so that they are visible on the top node if it's a something that you might want to change often so say for example our amplitude of our tree noise which controls the overall height of the trees we might want that to be available to somebody who doesn't know much about props so we want to be able to promote that parameter we want to be able to access that quickly so what we would do is middle mouse click on our amplitude node and go to promote parameter and we get this little nodule here which you can actually click on and give it a name it's currently called amplitude which isn't bad but let's change it to tree grass and we'll give it a range currently the range is minus one to one which isn't very useful let's make it zero to ten now if we go up to the top node you'll see that there's a parameter called tree growth with a slider so now we can interactively change the size of the trees on our little planet one last thing I wanted to show you is the VEX code that's been generated by your bop so a vector operator is actually simply interface for creating vex code on the fly and you can have a look at that code so if you go to the symbol on the top left of the parameters view and go to vex Bop options view of Xcode you'll see that everything you've just written is it contained in this bit of code which is actually very simple considering the amount of nodes that you had to set up and if you're someone who's more comfortable writing the code then you could do this by hand and in fact there are some situations where it's easier to write the code than it is to try and do it within a pop node for example if you're using loops it works much more easily index but we will go into that later it's not something that you need to worry about now now that you have your completed planet you might like to try plugging in some different shapes because Houdini's procedural anything that you have applied to your sphere can be applied to any object so let's try changing it to a grid great far too low res so that's a little bit like a hundred columns look what's up there we go so now we have our trees growing on the surface of a grid or we could have a sphere sorry a box aren't officials box is pretty distorted because we're pushing the position of the vertices that more divisions it's quite interesting so in a game situation you might imagine that you package up this little group of nodes here into a tool or a Houdini digital asset and allow the user in unreal or Maya whatever objects are being created to put in their own surface so we have here a planet entry generator I hope you've enjoyed today's tutorial if you're unfamiliar with using maths to manipulate colors and positions and attributes then I would recommend that you spend a good bit of time trying out different nodes and seeing what kind of effects you can get I'm playing around with noises and as I mentioned also taking a look at some of the examples in the unified noise documentation I'll put a link to that below please subscribe to my channel and see you next time
Info
Channel: houdinikitchen
Views: 17,869
Rating: 4.9834371 out of 5
Keywords: Houdini, Houdini Kitchen, nodes, VOP, attribute VOP, point vop, attribute, manipulation, VOP network, Vector Operator, add, multiply, mix, color, position, pscale, little planet, copy
Id: kJ-JGlM3KsQ
Channel Id: undefined
Length: 43min 17sec (2597 seconds)
Published: Mon May 20 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.