Lesson 7: Data Inputs and Parameter Hierarchy – Intro to Unreal’s Niagara Particle System

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this lesson i'm going to talk about data inputs and i will show you how we can make data input hierarchies to make more complex data values for our modules and their parameters okay let's see what data inputs mean and then i'm going to go over some of different types of data inputs and how we can mix them together when i'm referring to data inputs all i'm referring to is these values here these are called data inputs for example the noise strength for our curl noise is set to 150 this is a data input of float this is a float value of 150 that we are using for the noise strength for the frequency we are using another float value float means that it can have decimals with it however when i was talking about these scale sprite sizes for example if you remember i changed that number if i reset it back to its original value originally the scalar sprite size was set to x and y equal to 1. but since we wanted to change those values over time i changed that to a different type of data input which was the curve or float from curve or vector to the form curve right so technically what i'm doing here is i'm changing the data input from a vector to another type of data input which is called vector2d from curve and all what it says is that create a vector2d a 2d vector out of this curve so out of this curve create a 2d vector and if you remember we started moving these keyframes around so currently what i'm doing is i'm changing the scale x of my particles over their normalized age from 0.5 all the way to zero and at the same time i'm changing their y value their scale y value from for example 0.8 or 0.9 all the way to 0 over the period of their normalized h okay and by the way you can see that since i'm not having the same value for x and y i'm technically non-uniformly changing the size of these particles this is one type of data input so this concept of data inputs allows us to start building some formulas some math formulas to be able to mix different types of inputs together currently i'm just using one data input but let's go over some of them that you usually use i made a list here for you so you can almost get familiar with their names and what they do and again these are only just a couple of them we have a whole bunch of them but these are the ones that i usually use a lot so the first one is the wrench if you remember we used a wrench for our lifetime as well as the particle sizes this wrench data input allows us to create a random value between two numbers so for example from 0 to 5 it picks in that random number anytime that it's using that value anywhere so let's go back and see what way we use that in the initialized particle if you remember for the lifetime we set it to random and we said we want to have a random from point one to three and if you remember i said this this data input this lifetime mode is new back then it used to be just a direct set it was just like this and we didn't have this drop down so we could only use a lifetime of 2 however even in this situation i can change that to a range by typing a range random range float and technically it's the same thing i'm converting my constant number of lifetime which was originally two or three or five i'm changing that to another type of data input which this time is just a random range number which allows me to pick a number between two ranges and technically it's the same thing as we change that to a random again since this random didn't exist back then we used to change the lifetime to a random number using the range data input similar to the sprite size so if i want to do the same thing for the sprite size i'm going to change or convert this constant value of 2 to a range and then i could pick any two numbers for my range to change the random size of my particles all right so anytime that you change any data type input you can always go back to its default value by clicking on this default value button or undo button so that's the first data type the second one is multiply add subtract divide which is the primary operations on two inputs so it's not that easy to show it directly i'm going to use it somewhere else just be aware that in terms of data inputs we can use a multiply value to multiply two numbers soon i'm going to show you an example that has some of these all together we also have a curve input we already used that for our particle sizes let's go back to unreal this is where we use that so scale sprite size by default it was set to a value of 1 so it wasn't scaling anything however we converted that to a curve vector2d from curve and then we started playing with these curves what we care about is this curve term here so it says that use a curve to drive my values depending on another value in this case it's normalized h the next one is 2d 3d for the vector from float so converting one float number to create a vector number out of it it means use one value for all axes so let's see where we can use this this is a nice one so i'm going to show you how we can use this how we can leverage this one for our purposes let's go back to unreal so if i reset this scale sprite size back to its normal value which was a 2d vector one of the issues that we had with this one was that when we converted that to a curve input we were dealing with two axes so we are using two curves to control the scale x and scale y at the same time and since we wanted to have these particles to be always uniform in their size to avoid having these non-uniform scales on their size we had to make sure that these two curves are identical we wanted to avoid having different values for x and y we wanted to make sure that x and y are always the same they're always using the same value so to solve this issue what we could do is that we could convert this vector to only be one value that is being used for both x and y so going back to here i want to make an input that says use one float number and convert that to a vector and use that float number for both x and y axis okay so let's go back to unreal before i convert this to a curve i want to make a 2d vector a 2d vector from a float number which i provided to you currently it's set to 1. if i make it 5 i'm saying that use a value of 5 for both x and y so let's undo this if i want to scale all of these particles at the same time i need to type the same value for both x and y i'm going to go back to my initial particles and change the size of the particles here to something non-random so we can see the difference there so currently in the initialized particles all the particles are having the same size of one in my scale sprite size i'm scaling them up by a factor of three in both axis if i convert that to a vector 2d from float now i'm using one value for both axes so i can scale them up and down uniformly all together at the same time so that's the beauty of this vector2d from float now i can convert this value to a curve so i'm going to use this new dropdown list and type in curve float from curve and now i'm using only one curve to drive my only value here that is driving my vector here so let's try that i'm going to use a value of 0 here and perhaps a value of 10 or 5 so we can see these particles so now the particles are uniformly scaling up uniformly scaling down over their normalized age okay i'm going to explain this hierarchy in more detail very soon right after this the next one is a make vector which allows us to split a vector into all of its components so we can access each one of those inputs individually let's go back here i'm going to just show that here as an example currently if i want to convert this y value or x value to a range for example i can't do it because they are both making one vector however using a make vector 2d input i'm technically splitting the x and y now i can type in a value just for x and a value for y and the beauty of this is that now for just the scale y or just scale x i can write in any different types of data inputs as well so for example i can change this to a range so now my scale x is always a value of 2 but my scale y is a value that varies between 1 and 5. 1 and 10. all the scale x's are the same the scale y is only changing like this so make vector2d allows us to split a vector into its components so we can have access to each one of the components individually let's undo this and the last one is a sine function i will spend more time on the sine function and i'm going to show you very briefly how we can use the sine function for some places in our particle system i talked about these different types of data inputs but what i left out was how to make hierarchies or what that hierarchy means very quickly i did that here when i wanted to show different types of data inputs so let's just do it one more time vector2d from float and then i converted this value to a curve technically what i was doing was i was making a hierarchy of data inputs let's get deeper into that now let's just make this our curve so i like how these particles are growing up and down but they are very small and let's say i want to maintain all of this setup but i want to multiply all of these scales by 5 or 10 just to make the particles to be a little bit bigger but maintain this curvature and maintain this vector to different float and everything so in order to do that i know i need to multiply two numbers together so one of them is going to be a curve the other one is going to be a constant number so the first thing that i need to do is rather than directly using this curve to drive my float i'm going to use a multiply input this is the one that i skipped because i said that i can only show that when i'm dealing with multiple values so i'm going to use a multiply input this allows me to multiply two numbers together and now for one of the numbers i'm going to use the curve our friend float form curve and the second one is going to give us this opportunity to multiply everything by a value of one or two or three so let's create or recreate our curve and we are happy with the result then i'm going to multiply everything by a value of five so now my spheres or my sprites are going to scale up and down using this curve and then they're all going to be multiplied by a value of five it will give us a number and then we're going to use that number for both x and y values let's elaborate on this a little bit more and see what else we can do here so currently my particles are not having a random size we know how we can initialize their sizes randomly in the initialized particle by going to initialize particle and choosing different numbers for our range to make them random size let's assume that we do not have this so let's assume that our particles are all having the same size of one let's go back to our scale sprite size let's convert that number to a range here we go and let's pick different numbers for our range let's say minimum 1 and maximum of 5 or maximum of 10 even to make them even more random again this is just a proof of point here let's see what we've done here i'm going to go back to my slides this is what we got here in unreal let's elaborate on that so what this setup is doing is it's going to make this formula for us and i color coded them so we can understand where we are so we are generating a random number in this case between 1 and 3 we are generating a number using a curve input which is this one we are multiplying them and then we are using that number that we get to make a 2d vector out of it so we are scaling up the sprites in both x and y using the same value so this lists all what we need to have to be able to make this formula let's see where they are this is our make 2d vector from a number then i'm multiplying multiply float two inputs so after i have the multiply data input i need to give it two numbers the first number is our curve a and the second number is b which is a range already this is what we are having currently i collapse these inputs so we are not overwhelmed with all of these names and terms a vector 2d from float that is using a multiply input and that multiply input is multiplying two inputs one of them is a curve the other one is a random range technically we are creating a hierarchy of data inputs two numbers are being multiplied together to give us another number and that number is converted to a vector 2d format and this is the hierarchy that we are getting so now that we learned how we can use this i'm going to just show you one other data input that i skipped i skipped this sine function input and i'm going to show you very briefly how we can use that in sum of parameters in our particles okay so i'm going to change the size of my emitter to something smaller to make it a point okay i'm going to change the size of my particles to even lower than that so 1 to 3 as a random number all right i'm going to go back to my sphere location and the sphere location if you remember not only it allows us to change the size of our sphere but also we have this offset value here that allows us to move that sphere around in this 3d space i'm going to split this vector into all of its components by using the make vector data input so make vector and let's say i want to move the source up and down over time using a periodic movement or using a sine function what the sine function does is it will allow us to create a periodic value that goes from negative 1 to 1 or negative 10 to 10 depending on the inputs that we give it and it will allow us to actually move something over time periodically i want to do that in the z-axis i'm going to convert the z to a sine function and if you are familiar with the sine function whenever we are using sine or cosine functions we we have a frequency or period as one input we have a scale or amplitude as the second input and we have offset or bias for the third input so the period or frequency makes the periodic movement to go faster or slower the smaller the period the higher the frequency of the sine function the scale lets the value to go beyond negative one and one it allows it to go for example from negative 10 to 10 and anything and the bias lets it to have an offset over time so it doesn't always start from zero zero or it can actually start from any other offset that we give it let's make the amplitude to go higher than that and now you can see that the source is going up and down just to make it a little bit more easier to see i'm going to turn off the wind turn off one of the turbulences or even two of them the curls and i believe the period is a little bit too fast i'm going to keep one of the curls here i'm going to go back to my sphere location and the scale is set to 50 i'm going to change the period to something higher so it's ltb this lower i want to make sure that you can see what's happening here so let's spawn more particles ten thousand okay and i'm going to make the change the size of the particles to be a little bit smaller i'm going to go to initialize particles and change this to 0.1 0.5 here we go i hesitate to turn off the curl because that's the beauty of our simulation but let's for a moment turn that off and i'm going to turn on the wind okay here's our emitter that is going up and down so let's go back and play with the sine function the period i'm going to make it faster by turning down the period so every two seconds it's going to make a full cycle change the scale to 90 so it goes higher and lower okay so i hope you can see the result now so this is how the sine function works just to make it a little bit more interesting i'm going to use a cosine function for the other axis and it will give me a circular movement again this is a math concept i'm going to just briefly introduce the concept so as long as the amplitude and the period are the same we're going to get a circular movement for our source like this alright and let's bring back in the curl noise here we go so just created a circular movement on our particle using the sine function and cosine function in our source i'm going to make the particles to go a little bit larger that's cool in the next lesson i'm going to talk about the render modules and we're going to see what options we have for our particles look
Info
Channel: meghdad.asadi
Views: 85
Rating: undefined out of 5
Keywords: Unreal, Niagara, Particle, Simulation, VIVE, Tracker, Virtual, Production, HTC, AR, VR, Augmented Reality, Virtual Reality, headset, post process, engine, game, controller, xbox, gamepad, BP, blueprints, blueprint, realtime
Id: j0GsZH16K0w
Channel Id: undefined
Length: 20min 2sec (1202 seconds)
Published: Mon Sep 13 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.