[VEX for Algorithmic Design] E19 _ Noise Basics

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

cool set up!

👍︎︎ 3 👤︎︎ u/rknghrs 📅︎︎ Jan 16 2021 🗫︎ replies
Captions
[Music] [Music] hello this is stranger horukawa and this is the 19th episode for vex for algorithmic design and the topic for this episode is about the basics of noise and this is the topic that i'm going to talk about today starting with explaining what noise is and then starting from pearling noise which is the most basic one then go to simplex noise and then do some exercises for pulling noise then i'm going to talk about the concept of periodic noise how you can use it then explain about the flow noise which is the combination of a fully noise plus a period periodic noise then i'm gonna explain about the vector field related noise which is called curl noise and i'm going to explain a cellular related noise such as volume noise alligator noise and voronoi noise and how you can use them now let me first explain what noise is when you say noise and computer graphics it is often mean as gradient noise it is mostly used for procedural textures in computer graphics in order to create a texture such as a cloud like textures or a marble like textures and so on which is kind of a brother to a random values but compared to the random values you you do have some control over the pattern you can create by selecting various noise related algorithm together with several parameters for same as random functions a noise function needs you to set a seed value in most of the cases this seed value for the noise is location based values such as position or at p attribute and houdini and let's say you have a 2d grid like this and you want to use the center of each cell as the seed for the noise function and here's the reason why the noise is called as gradient noise that is because when the location uh for the seed used with for the seed is close enough then the value is also going to be close the closer the distance is the closer the value you get out of the noise function using the location for example if you if you cut the result from the noise function like the value 0.1 at this location then the neighboring value will be really close to this value such as like point two zero zero point one five or something like this and next to the neighboring to this one will be close to this values so something like point three point two point zero or something like that and same for the other cells the cell which is close this one like this one will be close to this value as you can see that by said having a far distance between these cells if the location is far enough then the value will get out of the noise function will get the difference between the two values will be bigger but when the location when the distance between the two value is close then you get a small differences and that's the main principle for the noise function and most of the noise function available in houdini shares the same concept the difference between the various noise function is that they use a different algorithm to generate each of the numbers and i'm going to briefly explain each of the noise function what kind of what types of values will produce and how you can use them but just by understanding the concept how the noise function works uh how the distance and the value is related then you can use any kind of noise function pretty easily and for many purposes with a lot of flexibility since you now have a understanding how the noise function works for example you'll be easily be able to create a wavy surface or see ocean-like surface pretty easily using noise functions now i'm going to start by explaining the pulling noise and how we can use it which is one of the most basic noise function which was uh founded by a ken perling in 1985. and by understanding how you can use this pearline noise you'll be able to use other types of noise pretty easily now the basic purling noise accepts three types of parameters one is in 1d one is in 2d or one is in 3d as an output you can output either a flow value or a vector value and each of the value for x y and z for the vectors will be in the range between zero to 1 and also for the float which is in 0 to 1 as well and just like the random value you can use each of the location as a c value and you can output a different value for each location and the difference between the randomness is that the closer the distance is between the points then you get the closer value either float or vector now we're not going to go deep in how the pedaling noise algorithm works you can if you are curious how this algorithm works you can go to the wikipedia for the pulling noise and see how it's being defined basically it can create a smooth wave like pattern and i'm just gonna show you how you can use it and how you we could use it for many purposes now let's go to hoodie and start by creating using a pearling noise i'm going to create a geometry node and then start with a really simple setup i'm going to create a grid then show the wire shaded let's also set the resolution of this grid to 50 by 50 by setting the rows and columns high res enough now the name of the function that i'm going to use now is called noise and which is the most basic noise function you can use in houdini which is a pearly noise based function so let's try to use this and if you look at the parameter set there is you can use a either float or vector value or vector 4 as an input and as an output you can either output flow value or vector value in computer graphics flow value is mostly used for gradients and vector is often used for the directional value now let's see how we can use this i am going to create a point wrangle to control each of the point on a grid connect with the grid and let's name this paint noise basics and first i'm going to calculate get the result of the noise value by using a noise function and the point position of each point on a grid as a parameter since this is a vector value now uh the the result of the value should be in between zero to one now what i'm going to do is to use this value to change the y value of each point of this grid and see what happens and this is the result you get out of a noise function and use it as a height value and you can see that the height is gradually changing based on the point position compared to the randomness it has a smooth connection between the neighboring point in terms of the height and that's the kind of a main benefit of the noise function based on the location you can smoothly create a gradient based values now currently the size of the mountain and the position of the mountain is kind of affixed and you cannot do anything with it uh with these setup but there by changing the location of the main point that you have inputted as a parameter and also changing this the distance between each point you can control the size of the mountain or the location of the mountain as well so let me show you how you can do that first of all as i said by changing the distance between the neighboring point you'll be able to change the the value differences between the points as well and you can easily check that out by changing the resolution of this grid parameter and if you change these on row you can see that the values next to the grid have more differences compared to when the value was in 50. you have less differences for in terms of height but if it's like seven you have more differences in terms of height for the naval points now you can procedurally control the distance by not changing the original geometry itself by just multiplying the input right here i'm using the at p attribute which is a point location but multiplying this by some scalar value you'll be able to easily scale down or scale up this location value and by doing that you'll be able to control the size of this wavy mountain let's see how we can do that okay so i'm gonna go create another point wrangle and control connect with the grid let's name this noise scale and what i'm gonna do is simple uh first of all i'm going to create a variable called val and then use the noise function just like we did last time and change the y value for the each point with this value and what i'm going to add now is the multiplication to this point position let's name this scale and promote the slider so you can control this value let's also change the a range of this slider value the float slider value between zero to say five okay now currently the scale value is equal to zero so as a result by multiplying with the location you all the point will be converted into 0 0 0 location now by slowly raising this up raising this value up you can see that you have more big wave big mountain wave starting to appear and compared to the compared with the value when the scale was equal to 1 which is the original location of the noise value you can see if the scale is smaller then the height difference between the neighbor points is much smaller than before and making this scale small and smaller you have less and less differences between the neighbors and that is making this big mountain wave but instead by increasing the value is that you have more differences between between the neighboring points and you see more jittered mountain like this so by just changing the multiplication the for the location inside this noise parameter you'll be able to control the size of this yv mountain and this is one of the essential technique you need to remember when you're going to use noise function now you can also control either x direction or y direction or z direction as well by multiplying at p with a vector value let's say you if you want to only control the x direction smoothness or scaleness then you can say scale and for the y and z you can say 1. now by doing it by changing this parameter you are only changing the smoothness or the size in x scale and by raising this up only the x scale x directional distance is changing if you multiply this then the difference the the distance between these two values so two points in x directions going far and as a result you get a lot of differences between the points in extra x neighboring if you make it lower you have more smoothness in x direction so on so by understanding how this multiplication works you can control the directional value in terms how the noise scaling works which could also be based on uvs or any other parameters now let me make this back to a single scale value so that x y z will be affected by this single value the next essential technique that i want to show you is how you can shift or move the mountain the whole mountain location to to other position currently by changing the scale value you can change the size of the mountain but you cannot change the location of the model itself now in order to do that it's pretty simple you just need to think that this is a location based seed so what you just need to do is to add a additional put location value as an offset now let's try to do that i am going to copy this noise basic let's name this noise shift then i am going to create a vector value called as offset and let's just change the x value for now so i'm going to create a parameter called shift for the x value and for the y and zero y and z value i'm gonna set zero now what i'm going to do next is to add this offset value to this noise value parameter so adding a current p position with an offset value now this is the shift value and let's try to change the range between 0 to 10. if i change the shift parameter you can see that the whole noise is moving in x direction and that's how the shift works currently i'm adding the x value to the current point position as a result all the noise value seems like it's shifting to x direction so if you move this x value to y value for the shift as a parameter then you can shift it to y direction since y direction is upward on so it looks like it's changed it's creating like a water like wave and if it you move to the z direction then now it goes to a z direction so one of the technique i use often is if you use a if you want to use a 2d grid with the noise value something like for the purpose to create a wavy like surface i'm often set a shift value to the y direction to create a animated wave so you can you can see that you by changing the y since the 2d grid doesn't have a y direction there's no every location and y is equal to 0 in this grid so by shifting these y value for the whole geometry it just changing the whole wavy looks okay so by setting some time based parameters like dollar t for the shift you can create like water like animation pretty easily now what i have just explained is the essential stuff when you use a noise function any kind of noise function which works for most of the noise function even if the algorithm is different and by understanding this essential i'm going to show you several examples or exercises how you can use them for different practices but before doing that i would also like to show a houdini noise function called x noise which is based on the noise algorithm called simplex noise which was developed by the same person called came pearling kind of a updated version of pearling noise which is said to create a better result than the pearling noise so let's see how we can use that as well but mostly the way it can be used is same as the noise function that i have just introduced you can check the set of parameters and output you can use with this x noise function which is called which is for the simplex noise algorithm and pretty much it's the same with the noise function that i've just introduced if you look at the description here the simplex noise is very close to fairly noise except with a sample of simplex mesh rather than the grid and this result less the grid artifacts so meaning you it this uh noise function can create a more smoother result than the noise function so if you found out that the noise function is creating some glitches then using x noise might help you but most of the cases using either one is just fine i think it doesn't give you much differences in most of the cases in my opinion or in my experience now i'm going to copy the grid then i'm going to copy one of the code that i'd right here so i'm gonna copy this noise scale let's name this x noise so what you need to do is instead of using noise i'm just going to rename this to x noise and that's pretty much it it just do like what it did in noise function so using either noise function x noise function is okay i think when you want to use this algorithm since it had said that the simplex noise is a better version of failing noise maybe using x noise instead of noise is better in most of the cases i guess though i myself use a a lot rather than x noise i tend to forget this x noise existence but since now you know that this one is a bit better maybe you can use this instead as a default noise function now let's try to do several noise related exercises how we can use noise for algorithmic design let's start by creating animated surface together with a box being copied to each of the point on a surface and then use a noise valley for the scaling value as well for the those boxes on the surface well i am going to create another grid let's set the rows and columns to really high like maybe 100 to 100 maybe 50 50 is fine okay and then i am going to create a point wrangle and do pretty much the same things as i did previously i'm going to name this noise wave surface and first of all i'm going to create the noise value by creating first of all creating a float variable called val and use the noise function with a point position on a grid then i'm going to multiply this with a parameter called scale and then also add with a shift value which i'm only going to change the y value so i'm going to create a shift parameter for the y value and for the x and z i'm going to set it to zero okay and then i'm going to promote those parameters two parameters one for the scale one for the shift now after i have created this value i am going to change the height of this each of the point by setting the y value using the value that i have just created now this value is in between zero to one so in order to control the height the maximum height i'm going to multiply this by some additional parameter called height okay now if i raise this height up you can control the maximum height of the noise value and then i can change the shift as well as the scale now let's set the range for each of the value i'm going to go to the edit parameter interfaces for the height i'm going to say it's from zero to five and for the scale and shift i'm gonna keep it as it is okay so by raising up the height value you'll be able to have more differences on each of the mountain okay now i can play with all the parameters that i have created now what i want to do new what i want to do next is to create a animation for this surface so just like i did previously i'm going to set some time related parameters for the shift value with this one which is used for the y value i'll i'm adding to the point based position now uh it could be either at a dollar t or a dollar f i'm going to use t for this one now if i play it we'll create an animation let's also toggle this real time toggle and if you want to make it faster you can multiply this t by some value more than one to make it faster now let's also color the surface based on the height or the noise value so i'm going to create a additional parameter for this each of the point other than the height value so i'm going to create a parameter like a noise valve i'm going to store this value that i have created to this noise value attribute as a float now let's create a color node and connect it with this surface and change the color type to ram from attribute and use the attribute that i've just set which is named as noise valve now you can set some colors you want to set in between zero to one currently it's set from black to white will give you uh some gradient from black to white for the surface based on its uh noise value now uh maybe i can set the left one to something like blue and the right value to be something like red and let's make this a range like these okay so the lower part looks blue and upper part looks red now okay now next thing i would like to do i would like to set a p scale as well to each of the point and use it for controlling the size of the box which is going to be copied to each of the point and what i'm going to do go going back to this point wrangle i am going to create another parameter called p scale and use the value itself as well now if i look at the geometry spreadsheet what the values distribution is which is either noise value or p scale you can see that the range is is indeed in between zero to one but there's not uh the value there's no value which is really close to the zero or close to one it's mostly the values in between like looks like in between 0.25 to 0.75 and this range also makes it different with the random value random value will evenly creates a value between 0 to 1 but when you use noise related function you get a value in between something above 0 like 0.2 0.3 to something like point 7.8 and it is explained here when on the noise vex function page the noise is in the range between 0 to 1 with the median of 0.5 the distribution of the noise depends on the dimension with higher depending dimensions approaching a gaussian distribution of noise values so if you want to expect the value 0 or value 1 when you use a noise value then you need you actually need to remap the value that you have created out of a noise function so let's say the minimum coming from this noise function might going to be 0.3 and the maximum is going to be like 0.7 then what you need to do is to first clamp this value by 0.3 and 0.7 so the value which is smaller than point three will become point three and the value point bigger than point seven will become point seven now after doing that you can use the fit which is the remap function and currently since i have used the clamp the minimum was always going to be 0.3 and the maximum is going to be always 0.7 0.7 and then change the new range to zero to one so that you have more chance to get uh the value in between the real value in between zero to one you have more chance getting the value in zero or one in this case so i have used this uh clamp and fit function for the p scale so that you you have a possibility that you get a zero value for the p scale or one valley for the p scale and let's check that out going into the geometry spreadsheet and for the p scale at some point you have one the maximum one value and you also have like point nine 3 2 1 and 0 as well so that's one of the technique you can use okay now that we have set a p scale value to each of the point i am going to create a box not this one box and use a copy to stop copy to point stop node to copy the point copy the box to each of the point now let's also scale down the base box size to something like point two five okay so the lower the the noise value is it the pc goes close to zero so the bar you cannot see the box anymore the operator go value goes then if the value goes close to one then it will you'll be able to have original size of the box being shown on each of the point and if you play this you'll be able to see the animated box on the animated surface and you can also change how the noise being distributed by changing the scale changing the height or changing the speed like this okay so this is one of the simplest example you can use noise to create now let's try to do another exercise previously i was using a location of the grid as the parameter for the noise function now what i want to do next is to use the 1d scalar value for the parameter for the noise as a practice so let's see how we can do that so first thing i like to do is to create the line facing upward let's also set the links to 5 and set the number of points to 50 so that you have a bunch of points you can modify now what i'm going to do now is to create a spiral curve out of this line by changing the each of the point location and each of the point location has its point number starting from 0 to 49 if you have total of 50 points and i'm going to use this point number as the parameter for the noise function and use it to control the thickness of the final pipe geometry created out of this curve first of all let's try to create a spiral curve out of this straight line like using a trigonometry the basics of trigonometry so i'm gonna name this spiral thickness noise spiral thickness now first thing i am going to create a angle variable which i'm going to use to control the location of each point based on the trigonometry so to do that i'm first going to retrieve point number then multiply this by some step angle value now i'm going to use a radians and inside the radius i'm going to create a parameter to control the step angle and let's set the range of the step angle between 0 to 90. so if i set this to 30s and the first point will have an angle zero the second point will have an angle 30 and the third point will have an angle 30 by two so 60 degrees and convert it into radians like this okay now i am also would like to create a parameter for the radius of the spiral curve so let's set it as a float value like this let's set it to some value now it's time to change to each of the point position if you remember uh you can change the you can set the point location and circle and circular by using cosine and sine and in this case by changing the x and z coordinate by using cosine and sine you'll be able to change the xd plane coordinate as circularly so for the x i'm going to use cosine and for the y i'm going to keep the original y position out of this point original point position then use sine for the z and for the cosine and sine i need to change i need to use the same angle so i'm going to apply angle to cosine and angle to sine now also if you want to change the radius you can multiply the radius to the cosine and do the same for the sine for the circle now as a result you'll be able to create a spiral curve like this and by changing the step angle you can change how much you it's been twisted and you can also change the radius as well now let's set a p scale attribute to each of the point for the spiral curve so that i can use this p scale attribute to change the thickness of the pipe that i'm going to create later so i'm going to create a noise value i'm going to call this attribute i mean the variable valve and use noise function and i'm going to use a pt num itself to use it for the c value which is the scalar value and also i am going to multiply this by some scale related value to change the range of this the size of this pt num okay and i'm what i'm going to do now is to apply a key scale attribute with directly with this value that i've just created using noise now let's promote the scale value i'm going to start with the one now if i look into the geometry spreadsheet the p scale and say everything is 0.5 so there seems to be no differences so let's try to change the scale to something lower see what happens and you can see there seem to have much more differences start to happen okay so let's try to use this p scale to change the thickness of the pipe which is going to be created to this curve okay so i am going to use a poly wire in this case and use the division like 12 to make it smooth and then for the wire radius i'm going to use the expression to read the p scale at each point using point expression point expression function and looking at the self node by saying dot dot slash plus op input dot zero so this is going to be the pass for the node the current node and then for the second parameter i am going to use dollar pt which is which means equivalent to at pt num in vex then i'm going to use a p scale attribute at zero position now so this is kind of a result what you get out of this value now seems like there are a big difference between the neighboring point numbers in terms of the size so by changing this scale you can smoothen out the differences based on the point number or if you want to make more differences you can raise these scale up at the end it will become just point five okay well maybe something like point one five is good uh overall the thickness looks a bit too thick so let's try to multiply additional parameter called thickness to use it as a maximum thickness value since value is in between 0 to one and let's by changing this thickness value you can control the base thickness value like this okay and probably you might also want to clamp the minimum and maximum since uh the range of this p scale is currently in between 0.12 0.2 which looks a bit a bit off small ranges in it there's not much range for this ah that is because i have used this thickness so maybe it's better to check by having another attribute like vowel to directly store this noise value and see to its range now the value range ends in between 0.7 to 0.28 so maybe we can do another clamping that we did previously for the p scale so what i'm going to do is first clamp this value by 0.25 2.75 as a minimum maximum then i'm going to use the fit to remap this value which should be in between 0.25 and 0.75 now 2.0 to 0.1 1.0 now that you have more thinner and more thicker thickness available for the pipe okay now now what i want to do next is to create an animation so this thickness will move upward or downward based on the pt number so what like we what we could do is to create a shift value that we did for the wave surface as well for the wave surface we have created the shift value for the y direction but for this one this the input for the noise values is scalar so we can add a additional scalar value for the shifting so i'm going to name this shift as a new parameter and i'm going to use some time based value like dollar t now if you play so you can see that the the thickness is changing by going downward you see that the thinner one is going downward creating animation like this additionally if you want to color this you can add additional color node probably in between this and then use the ram form attribute and use ball and then change this with some color gradient you want to use the noise value can also be used to output vector values so in next exercise i'm going to show you how you can use the vector value as an output value specifically i'm going to change the color of the surface by using a noise function since the color can be expressed using vector x y z or rgb so first i'm going to create a grid and then let's change the rows and columns to 50 by 50 and what i'm gonna do it is to apply the color to each of the point using point wrangle with a noise function okay now i'm going to name this noise color now it's going to be pretty similar to what we did in order to output the flow value uh in order to output the vector value you just need to create a vector variable instead of flow variable in order to create a vector noise value so so if you want to create a color value as a vector value first you create a vector at a variable like this and then use the noise with for example using p as a seed value then we can update the current c d attribute for each point with this color to set the color of each point on the surface and you can see that the color is smoothly changing based on the point position and you can also multiply this point by some scalar value like making a scale parameter and making this smaller you'll be have you'll be able to have more smoother changes by banking bigger you have more randomness starting to appear okay you can see that these the color is a bit too blurry i mean too light and that is because it's pretty related to the the range of the noise value that has been created by using this noise value if you look at the range of this each of the rgb it's in between 0.2 to 2.75 so same as the float output it will create x y z as a vector value but each of the x y z coordinate will be in the range between somewhere around 0.25 to 0.75 so let's try to clamp this color value as well uh in order to make the contrast and of the color a bit higher okay so what i'm going to do the process that i'm going to use is pretty much the same the clamp can also be used for the vectors and the fit can also be used for the vectors as well so what i'm going to do is pretty much the same as we did before you first set the minimum and maximum to clamp the value so that the value less than 0.25 will be clamped to 0.25 value more than 0.75 will be clamped to 0.75 and then use the fit which the minimum ends 0.25 and the maximum 0.75 and remap this into point 0 to 1. 0 as a result the contrast of the color becomes a bit higher and this still should work on any surface other than grid if you try to use a sphere instead let's make this as polygon connect it right here let's also raise up the frequency so that you have enough points to color this up maybe a little bit more maybe 220 okay and let's also make this scale a bit bigger i'm going to change the range of the scaled from 0 to 5. okay looking good now what i want to do now is to animate this color changing and to do that what i was doing previously is to create a shift value for either x y or z coordinate but the problem right here that we have right now that all the x y and z coordinates is used for each of the point in this case if you if we are using a sphere so if we just try to change the y value as a shifting to animate the y value then you probably have the animated color value but going from top to bottom or bottom to top which is going to be a bit too artificial for the animation so let's see what i mean first of all i'm going to make this outside as a variable let's name this pause and multiply in the current position by scale and have this position applied inside the noise as a parameter then what i'm going to do now after creating the position i'm going to change or i'm going to add the shift value to only the y y coordinate of this position so we creating a chf shift okay now by moving this one you can see that the color change is happening vertically in y direction if i use at a dollar t the color is moving from top to bottom like this so there is some direction you can see out of this change in some of the cases this is fine but if you want to have all the colors to change gradually without any directional information then what you need is an additional axis to use it for the shifting now going back to the documentation page for the noise function you can actually check that you can use the vector4 as an input as well and output a vector value so currently we were using x y z as a position seed which is this one but we can add additional uh axis as an input for the noise and for the additional one the fourth parameter for the fourth coordinate we can use the shift to animate uh the noise value uh addition to the point position in 3d so let's try to do that i am going to create a vector 4 vector 4 value after i have created the point position based value which is the vector three so i'm going to create like a v a variable called v which is a vector for value and create a vector4 value first three will come from the position so position pass dot x plus dot y pass dot z for the x y z value and for the fourth value i'm going to use this shift value okay and this one and then i am going to use this v value that i've just created as a parameter input for the color noise if i by doing it if you play it you can see that all the color start to change without the directional information now that is because i'm using the fourth parameter and all the xyz is kept as it is so there is no position change is happening you're just changing the value for the fourth value which is also another essential technique you want to remember when you are dealing with a 3d geometry and together with some additional shifting value probably for animation now as a last exercise for the purlin noise i'm gonna show you a bit more interesting way to use noise to create an interesting surface specifically i'm going to create a ripple like effect on top of a surface using noise function now the base surface could be anything so let's try using like taurus and let's have enough points so that we can change the point coordinate in high detail so let's give the rows 100 and the columns 200 okay that looks good now first thing i would like to do is to create a scalar noise value out of a using each of the point position as a parameter for the noise uh function and just to mention all the things that i'm doing here can be replaced using x noise as well so using either function is fine noise or x noise now let's create a point wrangle since i want to use the point position as a seed for the noise parameter and also i would also like to create an animation so just like i did for this coloring i'm going to create a vector4 as a parameter okay so starting by creating a vector 3d which is coming from the position so current position multiplied by a scale value to control the smoothness of the noise okay then also create a vector4 value for the final parameter value let's call this p and set position x position y position z and for the final one i'm going to create a shift just like we did for the coloring now i am going to create a flow value as an uh variable then use noise to create a scalar noise value using v as a parameter now we can quickly check the distribution how this value is being applied for each of the point by using this as a color value so i'm going to update the color using its value okay so it is now being shown as black and white maybe i might want to have more mountains by scaling this up so let's set the range for the scale to zero to five okay now i see more pattern now what i want to do here is to out of these values i want to create a ripple like pattern uh by extruding or moving the point coordinate up and down like a ripple wave now to do that uh one idea is to change or use this value as a angle for the trigonometry okay meaning i can use a sine function and inside this sign as an angular i can use this noise value and use this result as a value to move this point to the normal direction okay so let's try that out so first of all we need to convert this value into something can be useful for the angle and currently the the range of this value is in between 0 to 1 so we need to convert this or remap this into a angle friendly value so if we want to let's say if we want to use a sine function then the for the one wave it's in between zero to two pi okay so if you just if you just want uh one single wave using this as a angle then you need to multiply this value by pi multiply by 2.0 then this value will become in the range between 0 to 2 pi then we can use this as a angle for the sine and we can update the value itself with the new sine value now the sine value will have a negative value as well so everything which is negative become really black if you try to use it for the colors now let's comment this out and let's use this value to move the point coordinate to the normal direction so the normal coordinates normal coordinate can be retrieved by accessing to at n so modify the current point position by adding the normal direction multiplied by the value will be able to control the point coordinate now it seems like the uh the size of the moving movement is a bit too big so we can we need to control this by multiplying some values to this final value here let's name this height so i guess it should be less than one somewhere like here and you can see that the point is starting to deform based on this sine value which was using this noise as a angle now since it is just one single wave it's a bit hard to see what's going on here look it just looks just looks like a random wave pattern so uh by adding a more wave numbers to this angle ova might be able to see more differences or more able to see more ripple like effect to add more ripple numbers or wave numbers what you just need to do is to add or multiply some numbers it could be integer numbers to this one to have to control the number of waves you can use so 2.0 but multiply by pi is equal to one wave so if you multiply by two you have two wave numbers so let's have a parameter as an integer called wave number and by increasing the wave number you start to have a lot of wave happening start to happen now currently the normal uh of the first surface is a bit uh weird so we can fix that by creating a normal node after this and maybe the wave height is a bit too strong so let's reduce this one let's also see what happens here now you start to see more ripple like effect on a surface like this now maybe we want to have more resolutions on this source so let's give like 500 to columns and 252 rows now we start to see more clearly what's happening here okay that looks good now let's try to increase the range for the wave numb something like something like 0 to 30. and if i raise this number up you can see more waves is happening more ripple waves is starting to grow now more you have more glitches you get so maybe keeping it smaller like 15 or 10 might be a good okay and by moving this shift you can change how the ripple been changing based on the noise and this noise value is used for the angle value for the sine wave and the sine wave is creating this kind of ripple effect so by combining several uh simple equations you'll be able to create such a really interesting pattern on a surface now let's try to use a time based value for the shifting and see how it's being animated like at dollar t all right looks really interesting and changing the scale you can change the scale of the ripple pattern making the scale bigger you have more smaller ripples small scale value will create a bigger ripple pattern now these were the exercises for purling noise and this exercise can also be applied for many other various noise functions so please try to remember what we've done here the everything we've done here is pretty essential now the next noise that i would like to introduce is a periodic noise which in fact is the same purling noise based noise but the difference between the noise that we've been using and this periodic noise is that by using the periodic noise you can create a tithing like pattern a seamless pattern which can be connected like a tiles to create an infinite a scale of the noise value and if you look closely you can see a same pattern repeatedly being created and this periodic noise is available uh for pearling noise but also for many other various noises i'm not going to go into the all the other periodic noise patterns but i'm going to explain how you can use this periodic noise for the pearling noise then you'll be you'll have an understanding how you can use it for other types of noise as well now for example if you have a grid like this and the size of one by one and first thing you need to specify in order to use the periodic noise noises to set the size for the x y and z coordinate for the repetition for the tiling steps or tiling size now it and it has to be in an integer so if you want to use all these um grid as one tiling pattern then and this if this is x coordinate and this is y coordinate then in order to use a periodic noise you have to set the px to 1 and py to 1. and addition to this you also need the location information as a seed to use as a noise valley the pearling noise value so same as uh for that kind of parameter it's the same as the one that we have been doing using so each of the location of the grid cells matters to change the value so say if you have a 0.1.2 or point 1.3 something like that by having the information p x equal to one and p x equal p y equal to one and by extending the input geometry currently the tiling that you have is equal to one to one but if you have input the tiling or the grid size like two by one like this the value you get here is the one you get the same with the one that you get here in the one by one tile so all these values that has been created like these is being copied right here and all the others as well and the value next to this one which is right here is going to be a smooth value a gradient value which is the difference is small in terms of this distance so this is how this periodic noise works it will create a tile the seamless tiling pattern tiling noise values based on the size that you have set for x y or z for a three dimension which could be useful for many purposes so i'm going to explain uh how we can use it and what will be the good practice to use it for let's first look at the documentation page for the function that we're going to use which is called sp noise which is to use a purlin based algorithm to create a periodic noise and addition to the parameter weight that we'd be using which was a position based information like x or vector value or vector 4 value we need to add additional p x p y p z or p t as an integer value which is going to be the size of the periodic tile size in x y z or w direction or in this case called s t meaning maybe a time based value i guess now let's see how we can use it on houdini let's start by creating a grid and i'm going to set the rows and columns to 50 by 50. then i am going to create a pointer angle so that we can control we can create a noise value for each point i'm going to call this p noise tiling okay and first of all i'm going to create a value for the [Music] tiling size which is going to be a integer size okay so i'm going to name it as rep or tile size okay start let's start with one now i am going to create a float value variable and call a p noise function and let's use the at p as a noise seed value and for since this is a vector 3 value and we need to set x y set x y z tiling size value so i'm going to copy this one three times to set the style size for x y and z okay now i'm going to use this value to change the height of each point by setting the y value by coordinate for the point with this value multiplied by some height as a maximum value okay and raise this up maybe i need more range let's say 0 to 10. okay and if i raise this up you obviously see some repetition happening on a x direction for 10 times i think and also if you look closely to the z direction there is also some small wave happening to the z direction and it's happening 10 times as well and z direction and why it's because why it's ten times is because the size of this grid is equal to ten so if i change this to five five five then the repetition becomes five by five that is because i am setting the tile size as one okay so let's make this back to 10 by 10 and if i change this tile size to 2 then the tile size become two by two by two so if we are using ten by ten grid then in total you have five by five tile so this is one tile and this is another tile and you can see a clear repetitions between this one and this one and this one and it's repeating for five times in x direction and also five times in z direction and if you change this to five now you have two by two tile pattern one is this one and one is this one and one is this one one is this one and it's repeating smoothly so this is how this periodic noise works and let's also check this seamless seems less seamless connection by setting the color as well so i'm going to create another attribute called call with this file value and let's use this value attribute to change the color using ram from attribute reading the color attribute and then let me check and let's change this color range let's say from red to blue so that you might be able to see more clearly the repetition pattern maybe i won't have some black as well and white on the right edge so you can see there's some similar pattern right here and right here right here and right here so two times on x direction and two times on z direction same for these black patterns and so on now as an advanced exercise using this periodic noise let's try to create a three-dimensionally tiled pattern which you can repetitively expand in x y and z direction as a geometrical pattern a three-dimensional geometrical pattern and to do that i'm going to try to use a volume this case so first of all i'm going to create a box as a base geometry and let's set the size to 2. okay now i'm going to create a volume node to convert this box into a volume let's set the resolutions of this volume to something like 50 and also name this density value as density as a scholar value it's fine i'm going to use a volume wrangle and this is where i'm going to use a periodic noise to create a single tiling geometry tileable geometry or repeated ball geometry okay and let's name this key noise 3d power now let's first create an integer value for to determine the tile size i'm going to name this tl ts chi file size okay now let's set the tile size to say starting from one now since the box size of this one is equal to two and i always want this box to have a 2x2 tiling for some reason so in order to do that we need to multiply this ts by the point position to use it for the random seed i mean the noise parameter as a seed so i'm going to create a position value which comes from at p and multiply by ts okay so if ts is equal to 1 then you just keep the same size as the current point which is you'll be able to have a 2 by 2 tile if the ts becomes 2 then you need to have a total four by four by four box in order to have a two by two by two tile so to do that you need to multiply this two value with p so that the minimum maximum will be in between minus two to two in other words the bounding box size is four by four by four so that's kind of reason why i did this here now let's create a noise value i'm going to make it as a float value and i'm going to directly use it for the density later so p noise and position and we have a three values three vector values so i'm going to use ts for three times x y and z you can also change the value for y or z or x uh if you want to change the number of tile tilings on x y or z direction but for now i'm going to use this all the same now i am going to set the density for each of the voxel by applying this value itself now let's also promote the tile size so that you can control you can see that it's controlling the size of the tiling let's keep it something like two now what i want to do out of this volume is to retrieve the polygonal surface out of this volume so there are several ways you can do it one way is to use like a volume surface node or convert node what i'm going to use is a one node called convert volume okay which will convert this surface or volume into a surface using this iso value so i'm going to set the iso value somewhere close to 0.5 since the median of the volume is 0.5 now you can already see that this is already a tiled geometry which is in 2 by 2 by 2 tile so by increasing the density of the volume and also increasing the tiling number right here you can create as much number of tiling as much possible like this but what i want to show you is to trim out the single tile out of this geometry then use it to repeatedly copy in x y z direction for your purposes because uh setting the high value for the density uh it might not be a good idea because it cost you so many cpu process okay so what i'm going to do next is to use a boolean node and together with the box which has the size equal to one one by one by one and use the operation something like intersection between the surface and the solid with the intersect and as a result you'll be able to get this intersected surface like this and this is actually a repeatable surface for the top part or left part on the front part so let's try to check that out okay so to do that first next thing i'm going to do is to create a grid which has the size of one on x direction y direction and z direction now i'm going to quickly create that using a attribute wrangle three mute three mute triangle and let's change this to detail to run once i'm going to create a three loops three nested loops to create a number of points on each coordinate x y and z now this is for the x now for the second nested one this is for the y i'm going to change this to n and n and for the third nested one it's going to be used for the z axis i'm going to change this to t t and t and then create a point using i n and t as an x y z coordinate set i n t all right and promote those xyz slider and you'll be crea be able to create a grid 3d grid which has the size one by one by one for each cells all right now what i'm going to do i'm going to name this 3d grid is to copy use copy to points to copy this single tiling geometry to each of the point and see if the geometry connects seamlessly and if i do that you can see that it sure is connecting the geometry smoothly without any glitches it looks great now let's keep the size a little bit smaller and let's try to change some parameters that i have set here like the tile size still keeps you the more tile size you have you have more complex geometry for single tile less you have more simple tile like this and probably it will be interesting if we could animate this geometry as well using some shift related value like we did for the noise exercises now to do that we could instead using a vector 3 we could use a vector 4 value by adding a shift value to the force coordinate okay so i'm going to first create a shift parameter let's call that load shift okay and then i am going to create a vector4 value after we have created this vector3 value by combining this position for x y and z and then the fourth value i'm going to use shift then instead of using this position as a seed value for the noise i'm going to use this b that i've just created and let's promote this shift value and change this to a time based value okay it's a bit hard to see the changes now let's see if i have done correctly okay well since we have used the v value or the vector full value we need to add one more tiling pattern or tiling size pattern and since this uh force value the shift value is is a different make have a different metric uh the xyz is a position based one so using ts makes sense to control to use the same value but for the fourth one it's on the different matrix it's a time based value so we could change this to some different value if we change this to one then the range of the repetition of for this time is in between 0 to 1 meaning if we could create a value for if we could create a time based value when the frame is it and the first frame make this shift value zero and if if if it's at the 240 then make the shift as one then we can smoothly repeat the animation as well by using this periodic noise so let's try to do that by setting this shift value which is this one to value related related to this frame value and it's always in the zero to one range so you can do that by first of all have this frame current frame value and divided by a frame end which is this 240 and there is a as a result you'll be able to get a volume between 0 to 1. and this in result will be crea will create a smooth animation from end to first now let's check that out now it's a bit too slow so let's reduce some sizes or for this one [Music] and also i'm going to reduce the size of the sim single volume let's say 30. maybe the time is a bit too slow so i'm gonna set to 60 and you can see it's changing the value from zero to one it changes a shape up just a small bit maybe the tile size or the repetition size for the fourth coordinate might equal to one is a bit too small maybe we could increase that as well but you can see that it's smoothly connecting the animation from end to first okay so let's go back and let's have another parameter like and tt which is going to be the time based size time size starting from 1 and i'm going to use this t t or time size to first to this shift value okay and also right here for the repetition number which result if it's if tt is equal to two then you have a range between zero to two and the maximum range or tile size will be equal to two okay so if i raise this up something like floor you have more drastical changes based on time by increasing more you have more changes makes the speed of the change faster if it makes this smaller then you have small changes but still keeps you the repetitive or you have a smooth connection between end to first because it is it has the same concept it is still a periodic noise see works pretty well now that i have just explained the periodic noise i the next thing i would like to introduce you is the mixture of the noise and the periodic noise which is the function called flow noise which is this function called flow noise now this is the flow noise that we're going to use and the difference between the noise that we've been using is that this is basically a non-periodic noise the only difference is that you have a second parameter which is called flow and this is the only parameter which is a periodic which is between 0 to 1 and you cannot control the size of this periods it's all it's fixed to zero to one so you can consider that this is kind of a small variety of p noise a periodic noise you can actually uh by using periodic noise you can actually set the the period the size of the tiles to non-periodic as well by if you go back to the p noise function and for the px py pz it says integers and if you set the pxpy pz to zero then it which will create this direction as non-periodic if you have more than one then you have you're going to set the periods or your petitions but if you set these values to 0 then it means it will give you a non-periodic values for this specific coordinate so you can consider the flow noise as a this kind of if you are using a vector three inputs together with a float value for the flow parameter then it's pretty much the same as this one being p x p y p z equal to 0 and pt equal to 1. if you go back here that's similar to this value here so just by understanding this parameter differences the the result you get is pretty much the same between the periodic noise and this flow noise and this is pretty useful when you quickly want to create a noise pattern non-periodic noise pattern but based on the time it goes back to the original or goes back to the first frames noise pattern by just using the second parameter as a repeating value so most of the case what i use this for is to use the second values for the time based volume so that the you have a repeated animation repeatable animation or gif like animation so let me show you one example uh using this flow noise to visualize something well this time i'm going to try to create a some vector field using this flow noise animated vector field so that it can repeatedly animate it even if goes from end frame to the first frame it smoothly connects to the first frame okay so i'm going to first create a cube or a cube and then i am going to create a volume node let's set the sampling divisions to 50 and also i'm going to set the rank to vector so it will be a vector volume i'm going to name this to velocity any name is fine i would like to scatter points to this inside this volume so i'm going to set the initial value to 1 and i am going to scatter some points inside this volume okay and i'm going to use this to visualize the volume trail later now i am going to create another volume wrangle connected to this volume let's name this flow noise trail or vector field now the usage of the flow noise is pretty much the same as the noise function you just have additional parameter for the periodic value so first of all i'm going to create a i would like to use the point position as the seed for the noise so i'm going to create a pulling position based on the current point position and let's have some multiplication to control the scale of the point position okay and let's also set the range from 0 to 5. all right now next i would like to create a shift parameter which is going to be animated so shift f shift okay and i'm going to use it as a flow value now i am going to create a vector value named as direction with a flow noise function and for the first parameter i'm going to use position and for the second parameter i'm going to use this scalar shift value float shift value and as as a result you'll be able to get retrieve a vector value which the x y and z coordinate is in between zero to one so it will give you some uh um some positive directional vectors at this point now let's try to visualize this first i'm going to update the velocity value with this direction okay now i am going to change the shift and see if things are changing maybe i would need to change some scales okay so something is happening here right now what i would like to do is to change the i mean visualize the vectors on the volume using volume trail and connect the point to the first input and volume to the second input and now you can see the visualized vectors now i can i still see the volume as well okay now looks like these and by changing the shift from zero to one you should be able to change its animation and but since the second parameter is in is the periodic value and it's in between 0 to 1 range so by changing this shift based on the timeline or frame based value by changing this to 0 to 1 then you'll be able to create a repeatable animation so to do that you can divide the current frame with end frame like we did last time and if we play it it should smoothly connect from end frame to the first frame now currently since all the x y z coordinate is positive so it's going to a similar direction which is a bit boring so let's make try to make this a bit more omni-directional to do that one of the way you can think of is that the range of this flow noise is in between zero to one and the medium is 0.5 for all x y and z so meaning if you sub the subtract this by 0.5 for each coordinate then the range of this flow noise the result of this equations will be in between somewhere around point minus 0.25 or minus 0.5 to positive 0.5 maximum okay for all x y z coordinate and as a result you'll be able to see more omni-directional flow pattern like this now it became more interesting and by changing the scale you'll be able to see a scaling differences or have some turbulence like floor pattern now if i play this you see there's no glitch between the frame and and the frame start it smoothly connects from end to frame that is because i'm using this flow noise for the shift which is in between zero to one as a periodic size okay you can do the same things with the uh p noise as well by setting the shift the fourth coordinate to one and all the other coordinate to all the x y z to tiling size to zero which will create the same effect like this one but we just want to make the last parameter or last coordinate to be periodic then using flow noise might make more sense which is more easier to use now the next noise function that i would like to introduce you is the curl noise function which is also based on the purling noise but it only ex gives you a vector value as a result and it is often used to create a vector field related values and it's going to be much easier to create vector field like compared to the one that i have just tried using flow noise so let's try to create a another vector field using this curl noise function now i am going to copy this set that i've created for flow noise okay so i have this box and have this volume set the sampling divisions to 50 and have it set as vector velocity and created a scatter of points inside the volume and also for this one this is the one that i'm going to change using coil noise so i'm going to name this coil noise let's also remove all the parameters that i've created here let's create this clear this code up okay now let's start using curl noise to create a similar flow based uh value or noise first of all i am going to create a position value as always so based on the position of the each voxel multiplied by a scaling value okay let's start from one and then i'm going to i would like to animate this as well so i'm going to create a created as a vector for value as a final final input okay and use position x position y position z for the xyz value and for the first last one i'm gonna name it as shift to control the force coordinate now i will upload update this velocity now i need to create a directional vector using curl noise okay using this value that i've created right here okay now i am going to update this velocity using curl noise oops using this direction that i've just created okay now let's also create uh let's also promote the shift value that i hear let's have t as an input and for the scale i'm going to set some range between 0 to 5. so that i can control the size of this flow vector value now if you joined visualize this one it gives you more cleaner more smooth flow a vector field compared to the one that i've created right here you see that there the the smoothness of this flow is not that smooth enough compared to the one that i have right here okay so it gives you more clean vector field and which is because created from the two uh cross product of a two purling noise which makes it really smooth like this if i play it you can have a smooth animation like these now this one is not this curl noise is not periodic so you have some uh ending the the connection between the end frame and the first plane is not connecting smoothly but other than that it gives you more clean floor value compared to the flow noise or normal noise value if you want to create a repeatable floor animation then i would suggest using periodic noise but if you want to if you don't care about the rip the smooth connection between the frames from end frame to first frame then using uh this method using this curl noise makes more sense to create a vector field create more turbulence like field like these looks really good all right yep and you can control the speed by multiplying like t by some other values to slow down or make it faster as well the next noise function that i would like to introduce is the one of the cellular based noise function and which is called volley noise and when it says mole noise in houdini there is three types of rolling noise available in houdini as a function one is using an euclidean distance one is using manhattan distance and one is used chebyshev distance in terms of inner algorithm each of the distance method using a different method to calculate the distance between two points now in most of the cases when we imagine the distance between two points we are using this euclidean distance and i'm going to explain this morally noise based on this euclidean distance now the way worley noise works is that first of all you give a bunch of points positioned as an input as a sample then as a result it will create a various seed points on a space randomly something like these and then what you get as an output is four value or two of full value which is called in between f1 to f4 which is the distance between each of the point on which you're going to use as an input and the closest seed from that point closes distance to the closest point in this case the closest for closest distance between the the pick points on the grid and the seed point is this one and this is going to be f1 and the second closest is going to be this one f2 and third point their distance is f3 and fourth distance is f4 and by adding all these values together you can actually create or ocean-like landscape for each of the point uh if you use it as a height value at each of the point which is pretty interesting and if you dip subtract f2 by f1 if you do the subtraction f2 minus f1 then it will create some boundary between the seed points like a voronoi pattern something like this which you can retrieve this boundary position at 0 y value equal to 0 and other points having some value more than zero so if the point is on this border you get value zero with this calculations by using this characteristic you can also create more like a cell-like uh pattern as well using this noise wally noise now as i said in terms of oily noise you can choose three types of distance measure measures measuring matrix metrics now the one that i'm explaining here is called euclidean which is calculating the distance the direct distance between the points to point okay straight but if you choose something like manhattan distance what you get is the distance by adding the [Music] z coordinate or y coordinate and x coordinate and add in adding this distance together with this distance so the distance will become x plus y in this case if if it's in 3d then you have one other coordinate as well at z so this is the manhattan distance so it's go the distance when you calculate the distance using manhattan distance the distance became longer than the euclidean distance and there's another distance matrix called chebyshev distance which if you want to calculate the distance between these points then the distance will be a distance between this line and this line right here so this is going to be the distance for the chebyshev distance if you're calculating the distances between this points then the distance will be this distance and that's the chevy shaft distance so based on those um different base different distance metrics you what you get as a result in terms of f1 f2 f3 and f4 is going to be different and as a result by adding all these numbers you'll get different kind of pattern same as this one and let's see how it looks like by checking it out in houdini and see what can it be used for first i'm going to create a grid let's make it really high-res to have enough sampling points to use it for volley noise okay and then i am going to first test out the f2 minus f1 uh using a simple parameter set for the wally noise so i'm going to use the point wrangle and i'm going to name this w noise cell now let's check what kind of parameters we could use and if we look at it first of all when it says position it is basically the same things as what we were using for the seed for the noise it's going to be the position value to calculate the noise value so it's going to be the main thing could be float or two floats or two vector2d or vector3 or vector4 so any dimension is okay in this case and when you when we have this and a characters uh before the name of the input it means it's this is the output parameter which is you can just input empty variable to these inputs parameters and by calling this function those parameters or those variables will be updated with this function so you have either seed f1 and f2 or seed f1 f2 f3 f4 just like what i have explained and you can also make this noise periodic by adding some period x period wide or period x y z or period x y z w as an additional parameter to make it as a periodic uh noise for this very noise so it's this single uh w noise which is a using a euclidean distance for the whirling noise is pretty um flexible in terms of creating many kinds of many types of noise values using the wall-e algorithms volume-noise algorithms it could also it's good to know that you could create a periodic noise out of this same function as well okay i'm going to try what the really simple parameter said first let's try out this one since we i what i want to try out is the f2 minus f1 to see the border of the cell and maybe we could also use this seed as well if we look at what this seed is it is the number of a seed points which uh indicates the uniqueness of the cell so maybe we could use this seed value to change the color of the cell or something like that okay so let's try to use this parameter set and as an output it this is just this is the void function it doesn't output anything so we can just use it as it is and what we need to do is to prepare these output parameters as a variable okay now by understanding what parameter set is let's first create a output parameter variable first of all integer seed and float f1 and f2 now let's call a w noise and for the position value i'm going to use p for the point location maybe i can also multiply with some scale value to change the size of the p okay and also for the second parameter i can set this output parameter seed and f1 and f2 for the third and fourth parameter now as a result and all the values seed f1 and f2 should be updated so let's try to see how it's been how or what kind of value we get okay so if we just try to use f1 in this case now we don't see anything that is because i haven't set the scale yet so let's make this larger and it looks like we have some kind of voronoi like divisions that is because it is actually a voronoi pattern because we are just using the first closest point distance uh to show up the height now if we just use 2 it becomes a bit more complex and we cannot really see what the characteristics of this one out of it directly now if we subtract f2 by f1 just like i explained now it you see some border start to see some border on the y equal to zero positions which indicates the border of the cell and these one are the cell itself and each one is having a different seed value in this case which is i'll put it from this one and if we see how it looks like we can create it as a flow value and put it as store the c value to this attribute maybe set it as integer and you'll see this really high number either on negative or positive and this is the unique number for each of the cell indicates the the unique number for each cell okay so what i want to try out next is to use this seed value to change the color for each cells now currently the value is too big and turns in turn in order to use it for the random seed so what i'm going to do is to change the attribute to float and multiply this by some small decimal numbers something like this and make these values small enough okay like this probably del this is good enough now i have set the seed for each of the point and if the cell is the same it should share the same seed value like this now i can use the color node to color each of the point based on this seed value so i'm going to use random from attribute and use seed okay and as a result you can see that each of the cell which is divided by this border is being colored differently like this okay so i think analyt you can kind of use this rolling noise and then analytically like this as well and if i change this back change this height back to f1 looks like this and you can see it you can also clearly see that it's changing its color based on its cell right i'm going to make this back to f2 minus f1 now this is to show the characteristic how this wally noise works now uh let's try to use this to create some interesting uh shape like an ocean surface animated ocean surface and let's also make it like a periodic uh in terms of animation as well now i'm going to create another point wrangle connect it to the grid let's name this w noise surface now going back to the parameter set and what i would like to use next now is a position plus a shift value for the animation so maybe using vector 4 might make sense and i want to make it periodic as well for the last shift value and all the others all the position could be non-periodic so i can set uh the period related value to zero only the last one could be set to some higher more than one value okay to make it periodic so probably i could use the last parameter set and i would like to also test this f3 f3 f f1 f2 at 3 and f4 value as well by adding all these values you'll be able to get a really complex surface shape out of this whirling noise so let's try to see what happens okay so let's remember that we're going to use this one now we need a five parameter set uh one is seed and one and the other four is f1 to f4 so seed and then float f1 f2 f3 and f4 okay now let's create a position value out of a current position multiplied by some scale value that we've been doing a lot today okay let's stop by one now i'm going to create a vector full value having these position as x y z value and then for the last one i'm going to use a create a shift value so let's name this shipped somewhere else like float shift chf shift and probably i could have a time size or time step size as well for the periodic size as well as an integer so let's say time size is called chi time size okay and i'm going to multiply this to this shift right here and have this shift being applied to the force coordinate for the vector4 okay now everything is ready i think we can call this w noise first input is going to be this uh vector 4 value and the second value is the seed and f comes f1 f2 f3 f4 now uh we also need to set the periodic uh noise periodic um size for x y z and w now for the x y z i want to make it non-periodic so you can set zero for x y and z and for the last one i can set this t size which i have set right here okay which also indicates the speed of the animation as well all right now as a result we'll be able to get these f1 to f4 so i'm going to add all these values together i'm going to name it as a w vowel is f1 plus f2 plus f3 plus f4 and i'm also i'm going to apply this value to an attribute called call to change the color later now i am also going to update the height of the point using this value so that'll be well and maybe probably i would like to control the height as well using some parameters i'm going to create another parameter called height as a slider now everything is ready i'm going to click this one to promote all the sliders and see what would happen by changing these values okay so first of all the scale changes the scale of the pattern straightforward just like other noise value and the height is changing the height of this noise value and changing the shift value you can change its animation or you can change its variation by changing the z or w coordinate and the time size will change the speed of the change if you have higher value the change from zero to one is drastic if it's one it's really slow okay and by since this is the periodic noise if you go from zero to one and go back to zero it will smoothly connect so i can make this animation based or frame based by dividing the current frame by the frame end which will create a volume between 0 to 1 and based on the frame value and as a result by creating an animation plane and animation it smoothly connects from end to first and i can increase the speed by changing the time size okay so it already looks like an ocean surface now so let's try to make it a bit more like an ocean by changing the color based on the noise value i'm going to change this to ram from attribute and i am going to use the attribute that i've created named as call which should change the color but we need to check what's the range of this color value by adding all f1 to f4 so let's go back and see the geometry spreadsheet for the color and let's go up and see the minimum is around 0.5 and the maximum is about about 3.5 so let's say for the color range the color attribute is in between 0.5 to 3.5 all right now it looks more like the ocean surface now let's make it blue light blue on the middle and as a result it really looks like an ocean now if we play it we'll create a repeatable ocean like surface and if you want to make it bigger and if we want to make it repeatable you can create this surface repeatable by setting the repeat size or tiling size right here instead of zero which is pretty useful i think okay which creates really interesting surface like you see here all right now if you remove one of the values like f4 it will create more simple surface like these if you delete this one create more simple one if you have just f1 and we can becomes more like a voronoi surface by adding all these together you have more detail for this cellular noise value which gives you really interesting surface okay so that's how the worldly noise can be used or work now let's also check other types of falling noise using different distance metrics like the manhattan distance and the chebyshev distance so a lot and but the parameter set is pretty much the same for all the other woolly noise-based noise function so what i'm going to do is to copy this part together with this grid right here like this and then i'm going to name this first of all i'm going to test the manhattan noise so i'm going to name this mw noise surface okay so what you need to do is just rename this w noise to mw noise and that's just it in order to use the manhattan noise you just add m as a result you get something like this more like a landscape or mountain landscape a bit artificial low poly but looks like a mountain landscape so let's try to color this out in different colors set now uh first of all i would like to check the maximum and the minimum for this color value it looks like it's in between two point five to six around six so let's set this value to 2.526 and then let's change the color set color gradient starting from maybe green and then change the this one to something more yellowish or more something like these and make it more like a dark red and became white to make it like look like a snow all right and let's see this being animated yeah well it's a bit uh artificial in terms of the angle but looks interesting it does look somehow like a landscape right interesting now let's also try another distance matrix which is called chebyshev matrix okay so i'm going to copy this again this time i'm going to rename this to cw noise surface and as you can imagine what you just need to do is to remain rename this m2 c that's it okay now it looks like these and let's also check the minimum and maximum of the call value so that is from 1.099 to 2.7 so let's say it's in between one one two three so one two three and let's change the color again i don't know what kind of pattern it's going to create so looks more like a mechanical chip like a pattern so let's make it like blue on the left side and red on the right side makes something like ambiguous pattern looks like um lores gan generated image if you know what you mean if you know what i mean from a deep learning okay well still interesting could be useful for something i haven't used this for myself but could be useful for something maybe using some mechanical like network or something like that now the next noise function that i would like to introduce you is the one called alligator noise which generates a similar pattern compared to a wally noise but with different parameter set which is pretty useful if you want to create such an ocean like a surface like we did last time with the volley noise now this noise function doesn't give you much of the analytical information like the whirling noise did like the border information or the seed information but if you just want to create a ocean-like surface like you did with the wooly noise by adding all f1 to f4 um maybe using alligator noise it's much easier so let's see how we can use this now if you look at the parameter set you can you first of all you need to have a position which is same for other noise function and the simplest one is without any parameter other than the node positions now if you want to control more you have a value like turbulence rough or at 10 attenuous i guess and other for the other parameters you can also use this period x period y period z to make it a periodic noise as well just like a volume noise so i would like to try out uh this value or maybe this volleyball probably i'll use this one to use it for the height for the ocean wave i use making it at a periodic noise so that i can copy paste on a grid to make it really large surface afterwards by creating just one tile and let's also see what kind of uh difference you get by changing these three parameters turbulence rough and at 10. i'm going to copy the grid from the volley noise okay and i am going to create a point wrangle let's name this a noise okay and then i am going to first of all create a position value at p multiply by scale like we did last time okay now i am going to since this is on the grid so i kind of i don't need to use it as a vector 4 but maybe i can just change the y value as the shift value in this case if you if you're using a surface like sphere then using vector 4 to change the shift value for the animation might make more sense but if you're working on with the 2d uh which in this case on xc plane then the y coordinate is not used so in that case i can use the y coordinate as a shift value so i'm just going to use this as a shift value like i did for the other grid okay now for this one i'm going to set f f divided by f and okay now since i am going to use the um time or the periodic for both the scale of both position and for the time scale i'm going to create two parameter to control the size for the tiling for the position and size for the time okay so and both have to be in integers so first of all i'm going to say pause size or p size chi cos size and t size c h i time size okay let's start by one for now okay now i'm going to set the grid size to one okay so that i'm going i can make this as a single tile geometry or single tile face okay now what i'm going to do i'm going to maybe bring this up after creating this p size and t size and i'm going to for the position i'm going to multiply this with a p size and i'm going to multiply this y value which is going to be used as a time shift and with the t size this okay now it's time to create a alligator noise value using a noise and first parameter i'm going to use a key size i mean the position and for the second parameter a second third and fourth it's going to be the periodic size for x y and z so the x z will going to use p size and what a y i'm going to t size so p size t size p size okay now comes the a specific parameter for this alligator noise one is turbulence one is roughness and one is attained okay so let's create that and turbulence is in integers so let's name the term chi curve and for the rough volume roughness value it's going to be float chf rough load the attends also a float chf 10. okay now we can say turn rough now let's promote all the parameters that i have set okay so for the position size keep this one for now okay for the roughness set it to something like this and continues to uh 0.5 and turn width 1 for now okay now what i'm going to do is to use this value that i've retrieved for the height of this plane so at p dot y is equal to val and maybe multiply by some height value for the maximum to set the maximum height okay and if i increase this one you should be able to change the height of this plane like this and it should give you the repeatable set a tile set on the side on the front side and if you played it it will it should give you a periodic time animation now it's a bit the style is a bit too big so let's make this maybe i should make this skill bigger in times of range let's set it to 0 10 as a range like this okay now i see a tons of repetition now maybe i shouldn't add this uh multiply this scale after all in order to make it repeatable i guess so let's not have this one but instead use this position scale to scale up okay looks good i'm going to remove the scale value here and the height seems a bit too high so let's make it smaller and maybe in order to make it like as ocean wave maybe we need to look at this uh part so let's make it negative right here now start to create something looks like maybe surface but it's not uh yet close so let's see what we can do with the parameters we have here attend curve and height if we increase the turbulence it looks like you can add some details small details on top of the previous one so it seems like this is iterative value to add the turbulence value okay looks good let's keep this three and the tenuous it seems like you can change the extrusion height so let's keep this something like 0.5 and for the roughness you can change how rough the pattern is going to be so which is i might want to keep it as something like 0.4 now i can also also make this size a little bit bigger like this and also set the height smaller okay now it looks more like the ocean starting to look like ocean surface okay now i'm going to apply i'm going to create an attribute called call and apply this value as it is i store this value from the a noise alligator noise now let's go to a geometry spreadsheet and check the color value for the maximum and minimum and it's it is around zero two point seven so but this point seven i guess it's coming from is this one isn't it if you make this one then you have from zero to point five okay okay it does does look like it's um affected by discontinuous it seems like the maximum could be point seven or point eight so let's just create a color node which is in between zero to one to use the color attribute call attribute to change the color set to make it look like an ocean so starting with the white and then use it used light blue darker blue more darker blue and then finally black okay now let's bring this up okay now if i animate this one looks more rough and if i increase the time size it will give you more random animation but still repeatable all right it looks good now changing the roughness you can see a bunch of things happening maybe it you can relate this to a wind the strength of the wind tenuous the depths the turbulence i guess it's also related to the wind if you want to relate this as a c ocean surface okay now that looks good now what i would like to try out it to check if this is repeatable in position as well in terms of x and z so what i'm gonna do is to create a grid which is which each point should have a distance equal to one to one so to do that i'm going to create a point like four by four and the number of rows four by four probably five by five okay which should creates a size equal to one for each edges or each point distance now i'm going to delete the primitive and keep the point now let's try copying the base surface base ocean surface to its points and see if it's repeating it looks like it does it cleanly makes a repeatable surface and it is animating as like this okay that looks satisfying all right it's a bit slow since i have too many points for each grid maybe i should reduce this now the last noise type that i would like to introduce you is one of these another cellular noise which is called voronoi noise which you can retrieve a similar value compared to a volley noise but in addition to the wally noise you can retrieve the center of the cell as a point position and you can also set a parameter to change the jitterness or randomness of the seed position so that's kind of a difference between the volley noise and the voronoi noise and the more annoying noise you can retrieve f1 and f2 which is the same concept as the volley noise but you cannot retrieve f3 or f4 so it's a bit hard to create as ocean-like surface with this voronoi surface but instead you can have a bit more analytical information in terms of foreign using voronoi algorithm so the value that you're going to retrieve out of this voronoi noise is pretty much the same as the volume noise i'm going to i'm not going to explain the basic algorithm for this one instead i'm just going to show you how you can use it in houdini as a parameter set or as a function and use of use some of the voronoi noise specific values for some purpose now let's start by creating a simple voronoi pattern using this voronoi noise okay so i'm going to start by creating a grid again let's set the resolutions to something like 200 okay now i am going to create a point wrangle let's call this b noise basics and the voronoi noise is called as v noise as a function for vex and here are the set for the parameters here the parameter set for the v noise and going through you can see that there is another position which we were using the whole time the new parameter introduced here is this jitter which controls the randomness on x y and z coordinate or in x y z w coordinate and as an output similar to a wall a noise you can get the seed value or f one and f two and as an addition you can get the position one in position two which is the seed point position for f1 and f2 for position on position two now you can also make it periodic as well by setting an integer value so the new stuff new parameters introduced here is this jitter and this point position for the seed the center of the cell okay so let's see how we can use these so first of all we need to create a output variable for the output parameter one is the seed just like what you did in the woolly noise and f1 and f2 and also the vector position one and position two which is for the seed position seed point position i'm also going to create a variable for the jitter which is going to be used as the randomness okay so i'm going to create it as a and you can control the jitter for x y and z difference separately so i'm going to create three parameters or maybe i can use chp and call jitter okay so that i have x y z value separately being able to control now let's try to use this voronoi noise since this is the void function there is no output out of this voronoi noise so we will just do just like the voltage noise so first of all i'm going to set a point location maybe multiply by the scale as well to control the size and then comes the jitter and then seed f1 f2 and position one position two as an output parameter and that's it okay now what i would like to do is to see if we have any value retrieved and by changing the height value for the point using f1 just like we did for the volley noise and it does what does seems like a similar things to a wally noise but as you can see this is currently looks really um artificial looks more like a square grid now you can change this by using you can make this random by changing this jitter value if you set the x value to 1 so makes only the x coordinate random so you can see that on x direction the val the position of the seed point which is the center of the each of the cell become random if you make the z value as one as well then the for the z direction it becomes random as well now we don't have a y direction for this one so setting this one to one doesn't really make shouldn't make any change but it's yeah i kind of did maybe it also changes the height position the for the point which also changes its pattern so it does make sense and the range for x y and z is in between zero to one for these jitters uh when i have tested uh when i have tested only work uh in between zero to one so that's the range and if you if you make it one then that's the maximum randomness you get just like we did for the wally noise if you subtract f2 by f1 you get the similar cell division and you get the border on the zero position on the y direction like this now we could also create a seed value the attribute from the seed multiplied by some small decimal numbers and use this to color the cell random from attribute denies let's use seed to change the color like this now let's also try to use the one for the seed position either position one and position two let's try to use this position one and see how it looks like now i what i'm going to try is to add the point at this position one which creates a bunch of points on this space and these points are actually the center points of each of the cell now it's a bit hard to see which one is which so i'm going to apply a attribute to this point the same seed that i have right here so set point at rib 0 seed pt with dfc okay now we'll give you a bunch of same colors for each of those points i'm also going to set some groups so that i can separate those points later so set point group zero i'm gonna name this maybe seed by one now what i would like to try is use a delete node to only choose the seed point and delete non-selected for the points so that you have you'll be able to get a bunch of points like this now what i want to try is to use a voronoi node that we have in houdini and use this to create a voronoi fracture and if we get the similar voronoi divisions like this one okay so let's see that i'm going to create another grid which have the same size but have a rows and columns two by two okay and i'm going to connect this grid to the first input to the four like fractures and for the second input i'm going to use this center point of the seat at the point location for the seat okay now it gives you this kind of voronoi pattern now i will also like the color with the same color that i have right here okay what's this one so i think i can do that by transferring a copy sell points attributes so to piece primitive i'm going to copy this color oops maybe not instead i'm going to copy the seed value okay now let's color each of the primitive using a random from attribute and same seed value okay maybe that was wrong okay the reason why we get things like this is because we have so many duplicated points on the same location so i'm going to use the fuse to merge all the position all the points which is in the same location now we have like 177 points okay and the color looks like this now i would like to compare this one with the one that i have generated right here and see if there's a changes in looks like it's pretty it's identical see so it just proves it just proved that this voronoi noise will create a same voronoi pattern and by using the seed points that i have got here together with this voronoi fractures okay so this is kind of an analytical purpose that i've just done here uh could be used for an analytical purpose it's pretty neat that you can create a center of points as well as this woolly based noise value at the same time now that we understand how this voronoi noise works i'm going to finish with some final exercise using this voronoi to create a partition the voronoi partition on a volume using this volume noise and it could also work with the volley noise as well okay so let's try to do that first i'm going to create a box okay and then let's set the two volume to the let's create two volumes out of this box okay one is called as seed which will store all the seed values of at each voxels so i'm going to name this seed i'm going to create another volume and this one i'm going to call this density which have all the values calculated by the voronoi value of voronoi noise now i am going to merge these together and as a result you'll see two volumes being merged together like this now you can use now use volume wrangle to access both of the volume at the same time in in single volume wrangle which is pretty useful so i'm going to use a no v noise what volume now uh in terms of the parameter so there's a lot of things to do so i'm going to copy the one that i've written here somewhere around here okay copy this one and paste it to this voronoi volume wrangle okay and let's promote this one and set the jitter to one by one by one now and also set some scale maybe set the scale range to from 1 to 0 to 3 for now now what i would like to do now is to apply update the seed value first from the volume with the one that i have right here so i'm going to use seed now by doing it you'll be able to fill in the seed volume with the unique seed information which has a range between some negative really big numbers to positive really big numbers okay that for the uh volume density it doesn't have to be in between 0 to 1 but could be in any range but it's a bit hard to see the range but if you want to check it out what's the maximum what's the minimum for the volume you can go to a geometry spreadsheet to the primitive and go to the intrinsic and then you'll be able to ch check the volume related value like check this volume max value and volume min value to see what's the minimum for the seed and that's the maximum for this seed by looking at these intrinsic primitive attribute and there are some other volume related values i'm gonna go not gonna go into that one but uh it's good to know that you you know what's the range for the minimum maximum for the seed okay now what i would like to do now is to use this seed information to create a partition in between the cells and use it as a create a wall as a partition okay so let's try to do that using another volume wrangle okay like this and let's name this partish artisan wall now what i mean by partition is that if this is the voronoi cell then what i would like to do is to visualize this border as a 3d surface okay and the rule here is that the voxels each voxel in this location this location has a unique different values so if the c for the seed value for this one might be like something minus three and the c value for this one might be minus or positive 4 and this one could be seed equal to like 10 and so on so in order to determine the border what you can do is to ch see the differences between the neighboring seed so at this voxel positions the naver in this direction should have a different c value compared to this one so by creating a condition checking the neighboring one and if it's difference if it's different and only if it's different then filling that space with a density will create will be able to create this kind of wall like um volume and later on we can convert it into surface as well so that's what i would like to do try to do here okay it sounds a bit more advanced but we can actually do this with the information that we've been learning okay so to do that first of all i am going to set the density setting starting to set the density by zero as a default now um let's only look at the x direction and see the neighboring value for the seed okay so to look for the val to look for the next um neighboring value in next neighboring and x direction in terms of the volume you can use a function called volume index and first value 0 which is the number of input and the second one is the name of the volume which i would like to look at the seed density or seed volume now for the third parameter you can set the address or index of the voxel now the current um the current index the current volume wrangle index is looking at i x i at at i x i at i y and at i c so this is the current voxels index so if you want to tr if you want to get the neighboring value in x direction then what you need to do is to add 1 to the ix or subtract 1 2 with the ix so either one works so let's see by using at by 1 and see the neighboring check the name check the neighbor value okay and as an output you'll be able to get the neighboring c value okay now why what i want to do is and the current seed value can be retrieved by accessing to f at seed okay so next you need to create a condition if this f seed is not equal to the neighboring seed if it's not equal then that's where you want to fill in the density and that's where you want to update this density value to something like 1.0 okay and as a result you should be able to see something is happening here so maybe the volume resolution is not high enough so i'm gonna set the volume resolutions to 100 i'm gonna copy this one and paste it to the density so it shares the same density or resolutions now right now the c value is a bit too noisy and we cannot see what's happening here so i'm going to create a delete node to delete the seed partition or seed volume at this point and select the seed okay now i can only see the density volume now now like you can see that there is some partition like surface or volume is being filled with density equal to one like this and this is actually the partition that we want to visualize as a surface and we have just done it done the condition for the x direction but by doing for all the y and z direction as well as the negative direction negative enables you'll be able to create a completed partition conditions to fill in the density with without any gaps without any small spaces okay so to do that to do it in one call or to do it efficiently we're going to use a for loop uh for the positive and negative for the x value first so let's do that i'm going to create a single for loop starting from -1 to positive 1 and add it by 2 so we only check either negative one or positive one okay now i am going to have it right this and then let's change this value to plus i which makes starts from minus one and also use a plus one as well and next loop so you have two loops with this one to use i for minus one and plus one okay as a result you have more thickened x directional partition okay now i want to do the same for the y and z so to do that i'm going to create a two nested loop for the y and z having the same loop set so i'm going to change the variable to n for the y and let's have it z for t let's also close the loop two times like this now i'm going to add n to the y and e to the z now i'm go also need a conditions for this one but i think it should work maybe not okay i think i missed this comparison operator here now you see this partition here now there is also a partition on the edges right here as well so we don't want that so let's remove that by adding some condition here saying if the ix is larger than zero and ix is less than resolution x minus 1 for the x direction which will delete the wall and the x direction do the same for the y and z so i'm going to copy this one copy right here and paste it and change this to y and do this again for the z value so z z z okay now it deletes the top and side faces now what i could try now is to use a volume blur to make it a bit more smoother at this point maybe that's too much okay like this 0.03 something and then i am finally going to convert this into surface by using something like convert okay and change this value to create a wall and you can see that the wall has been created using a volume noise and let's try to change the size of the volume by changing the scale value like here so if you make this figure you have more uh cells volume more voronoi cells and you can see that the wall has been created the border hasn't visualized the surface like this okay and if you make this jitter like zero at some point you have more artificial more geometrical parts if you keep all everything to zero you have more square like cell divisions like this if you just set y value to one okay to something like this looks looks like a honeybee which looks interesting as well yep so that's what i want to show you in the last how you can create a border by using a voronoi a ter more annoying noise information you can do the similar things with the wally noise maybe together with the manhattan distance or chevy chef distance might give you a more interesting results so i suggest you try it out by by yourself you should at this point you should be able to do it by yourself okay so that's pretty much it now that was a lot to cover but that was the basics of noise how you can use each of the noise functions in houdini and what you can retrieve with it what's the characteristic of each noise functions with some exercises i hope you got the glimpse of what you can do with those noise functions it's pretty powerful functions you can use it for many purposes i i also tend to use it every time i do the algorithmic design for many purposes it's pretty essential tool for the design now this is it for today and now the next topic that i would like to talk about is the combination between the vex and the solver the basic of the combination between the vex and the solver is what i want to talk about in next topic which is also a must when you are doing a animation based uh designs or motion graphics or algorithmic design and stuff i think there are tons of things to cover for the solver so i might need to split it into several sections in different days but i'm going to start with the really basics okay now thank you for watching and if you like the video if you like the series uh please press the like button and uh will be great if you could subscribe so that you can check the the newest video and i also started a patreon page myself and you can go to the page from the video description page from the youtube and if you are kind enough to support me i would really appreciate it okay thank you very much and see you next time you
Info
Channel: Junichiro Horikawa
Views: 5,935
Rating: 4.9821429 out of 5
Keywords: houdini, vex, programming, visual programming, tips, tutorial, beginner, howto, modeling, design, procedural modeling, algorithmic design, algorithm, array, basics, basic, introduction, scripting, procedural, variable, language, coding, attribute, function, cg, computer graphics, graphics, computer, computer science, mathematics, math, game, game design, vfx, simulation, sim, tutorials, container, dictionary, essential
Id: Q2OUvq4BcFk
Channel Id: undefined
Length: 174min 8sec (10448 seconds)
Published: Sat Jan 16 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.