Material & Particle Interactions | Live Training | Unreal Engine

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
it's me hello everyone I'm Alan Willard I'm a senior tech artist in the developer relations part of epic what that means is that I do lots of travel to show other companies how to use the engine I do training events like our developer days where we invite people come in and check out the engine we give talks and show what we're working on what we're doing answer questions things like that so today I'm going to be talking about how to create materials for particles I'm talking with my hands great materials for particles and then use those materials inside of cascade to do more complex effects than just swatting a dot and having the dot fade out over time cascade and our material system can communicate quite a bit it depending on how you create it so that you can get some very unique random appearing effects and cut down on the number of textures you use how complex your particles need to be things like that so to start with I created a sample project it's completely empty it has the starter content but it's it's starting from the blank template and you can see I've changed the defaults for the content browser a bit I don't prefer the folder view though I am going to create a new folder for my example content to be in so now that we've created that we'll start with the material because you can't render a particle without something to render so creating a new material particle material one and so here we are in the material editor and the first thing I'm going to do is drop in a particle color node when you start to type in the right-click menu you filter down to what materia Oh expressions match that filter there's a few material expressions specifically for particles color being one of them and so this anytime I tell the particle what color I want it to be it's communicating with the material using this node in this case I'm going to take the first output which is RGB and hook that into the emissive color the default for this node is all white one in each channel so my material immediately starts off as white that way and then typically I do the Alpha Channel the last dot into opacity now it's grayed out currently because the blend mode is set to opaque so changing that to translucent and I'm going to change the shading model to unlit so it's not going to use any lighting information so now I have a flat white sphere or quad depending on what shape I'm previewing and that's my microphone free so what we've got here is the simplest way that you can send particle information down to a material we're going to get a little more complicated than this going back over to the content browser I can find some nice textures so let's say a smoke and we've got a smoke texture it looks like this kind of a simple smoke pattern and in my particle system or in my material I'll hold down T and click and it's going to look at what I currently have selected in the content browser and try and add a node based on that so now I have a texture that I can use to add some smoke appearance to what will eventually be a particle the simplest way to do this would just be multiply these two things together so I'm going to multiply the RGB output of the smoke by the output from particle color and feed that into the emissive and you see what looks like the mismo texture now on my quad but I want something a little more sprite like rather than just a flat sheet that has a smoke texture so we're going to use a little more of an advanced node this is called sphere mask and what sphere mask does is given two points in space it generates a procedural sphere around that but because we're all we're dealing in two-dimensional space on our textures will eventually be our particles we can do that just using the texture coordinates so texture coordinate is literally just the layout for the texture how it knows where to render a given pixel of the texture on that surface so using this as a I'm going to then give it point five for B so that says that if we look at this as being zero zero in the upper left corner and one one in the lower right 0.5 in both axes will put us right in the center and that gives me a dot starting in the center for my sphere mask because a two-dimensional representation of a sphere is just a dot and I'm going to say I want it to go 1/2 the radius of the surface and so I now have a procedural hard round shape the hardness value inside of that is how sharp that sphere will be so now setting the hardness to zero I have a nice soft fall off this gives me a very procedurally clean circle that I can then use to modulate say my opacity and if i hook this in directly I now have that soft fall off right in my my preview shape so now if I were to compile this and go back in my example content and create a particle system and get rid of my filter so now I have the default particle system that's created when you first open cascade but it uses just the the simple axis cross so that we can see the orientation of the particle I'm going to go back to my particle material and inside that particle system in the required node I'm going to override this default particle material it will recompile the material to be used on particle system and now I have that soft dot floating up towards the the top here and because I've hooked up that particle color node here this color over life module is affecting the RGB values and the opacity of my particles so adding that to the curve editor using the curve button here here's my alpha so this is my opacity so at birth to death or 0 to 1 we go from fully opaque to translucent if I bring this down a bit you'll see my particle still lives the same length of time but it's dimmer throughout its lifetime because my opacity never quite reaches maximum and of course if I wanted to have something that had a little more shape I can hold ctrl and click and this adds points to my curve editor so now I can plot a little more complex curve and say at 50% of its lifetime it becomes completely opaque so now it fades up from being transparent to is opaque as it's going to get and then fades out again at the top now going back into my particle material most of the time when I'm doing something like a smoke texture what I actually want to do is put the smoke in the opacity so you get varying density based on how much of the smoke is coming through so we're going to change this just a little bit we're going to make the smoke a solid color but we're going to modulate the smoke texture with the opacity instead of the emissive color so this ends up looking mostly the same but it means that my color will stay true it's not being affected by whatever's going on the texture but my opacity is variable so we'll set this up as a little more of a traditional smoke where it fades up pretty rapidly and then moves now one thing you'll notice is the pattern of the of the texture is the same on each particle that's because when you spawn a particle the orientations are always the same the UV coordinates are the same for every sprite that gets spawned so what I'm going to do is add a rotation node and this will randomize the behavior so now each one comes at it's a slightly different orientation if I look at this in wireframe you may be able see that the the quads are turned slightly from each other so instead of getting a solid line of boxes and getting all sorts of triangular shapes and that looks like this but the problem with this is now that I'm rotating it if I want to do something that per particle goes in a certain direction I'm starting to counteract my ability to do that because the particles are turning so one way that I like to use the the way that the material system can communicate with cascade and vice versa is by randomizing the position of the texture in the material and just feeding that data from cascade the way we do that is inside of the material editor we have a dynamic parameter node and this is a 4-channel data stream that can be sent from cascade into my material now inside of this node we have four channels each one can be named independently so I'm going to call the first one X and the second one y and then I'm going to append these together so I'm going to take the individual channels and make it a two vector that just like my texture coordinate would be I'll duplicate my texture coordinate and bring that up here so now I have a texture coordinate that is having the results of these two two vectors that I've built from this dynamic parameter so now nothing has changed yet I'm going to change the tiling on my spoke texture by setting the tile to 0.5 in both directions so now it's scaled up the smoke relative to each particle so it's it's going to give me a bigger canvas to work with in now we make sure my material is compiled I'm also going to power my smoke here because while it's fairly smoky it's also fairly white so the results are rather bright and now when I multiply I get a more distinctive smoke pattern so now back in my smoke you can see the pattern much more clearly you can see that it's tiling and repeating if I add in the dynamic parameter node and whoops not deleted I wanted to refresh it when i refresh it the parameters that you see here now take on the name from the material so the connection between the material and the dynamic parameter node is completed with cascade so I'm going to change the distribution from constant to uniform so instead of a single value here I want a range I want zero to one by sending that to be uniform I'll get that but I also need to set it at spawn time only if I set it to zero one now every tick every time the particle is updated it will basically scramble the the surface so instead a spawn time only and now it only sets that value when the particle spawned it leaves it alone after that and I'm doing that in X there I'm going to do it in Y as well so now we have a fairly noisy non repetitive non tiling particle smoke out of that simple particle material here I have the texture being given this random offset I've got it scaled down so that it's possible and somewhat likely that the texture won't appear on the same part of the quad or sometimes even on the quad so your tiling features won't be as obvious and then I'm modulite modulating it by the particle color to get that broken up smoke look and of course I could do a little more math here if I move my power to be after my my opacity has been set and then feed that in I'll get a more soft broken look so you won't see the the round shape nearly as much so that's how I do a kind of broken tiling a couple questions about this have come through so is this expensive would this not be ideal on mobile mobile tends to do better with simple textures and not a lot of shader math so doing something using just rotation and offsets is probably going to be better for mobile this would be battle for PC console and other platforms like that mostly because rendering pixel shader instructions is an expensive thing on a mobile device so when I make a tutorial about creating water C materials since there isn't a support for translucent refractive in youbefore yet and it's kind of difficult to create decent looking water and other same local materials I possibly will do that in the future that's outside of the scope of what we're doing for this particular live stream but it is something that I have a little bit of experience with in the past so we've got a couple other questions I'll knock some of them out what is the cheapest way to do particles is it to make lots of particles lower definition textures or higher definition textures with lower rate of particles again this depends somewhat on your platform if you're doing up mobile then you're probably fairly conservative with your texture resolution so you're probably going to end up with lower resolution textures and a few more particles you just have to be careful of overdraw and that's overdraw is having particles that are translucent overlapping and that adds up very very quickly smoke and fog effects things like that or we tend to be pretty conservative with because they cost a lot in overdraw if you're doing something where you want to fill a room we try to use very very few particles because the if you have three particles that are filling the entire screen and overlapping that actually adds up pretty quickly in terms of the the spawn rate we try to very carefully micromanage that by using our LEDs so inside of the particle system itself this toolbar here is how we create and manage LEDs it doesn't start with one by default but when you create one so if I add an LED I can now go to the next step down and all of these modules have been disabled because they're exactly the same as they are in the other LED but if I go in and duplicate from higher that means that this LED has a different copy of that node or module then the parent one did so now if I go into its rate and set the rate to be very low now when I'm in LED one which is the first one after the base I have a very low spawn rate but when I go to LED zero I get the full spawn rate back so we carefully manage those so that our performance isn't suffer when we have things very close or at a distance we try to balance those can the particles change size over time the way opacity can yes they can we actually have quite a few things that you could do over time right now I'm just changing the color and the opacity but if I do size anything that says by life is over the lifetime of the particle anything that says initial only gets set when the particle is spawned so you if you're looking to do something where your particles are always red you can use the initial color and not color over life but if you want to do something where like with a fire it's going to change over time you want to use color over life and manage that so in changing the size of these particles you have a multiplier and that's the value that you're your initial size is going to be adjusted by I prefer in most cases to lock the axes right now if I add this to the curve editor you see it's got a red green and blue channel so I could actually change the x y&z scales of the particles independently but for something like this that's not useful so to simplify the representation if you lock it all XYZ it only uses the X channel it represents just a single value and now I can really quickly and easily adjust that so I've got the nodes for birth and death here my period of somehow locks there so now I can scale my particle system based on its age so as particles get older they get larger at the top so the dynamic parameter way of changing your your values in a particle system works really well if you're going to have a dynamic system that that may get placed in a lot of places could be moving could do a lot of things if you're looking for something that's more of an environmental effect where you don't want to have as many things going on in the particle system but you still want to break up its appearance there's an easy way to do that so inside of my particle system I'm going to get rid of my dynamic parameter behavior here I'm going to leave my texture coordinate though and I'm still going to set this to 0.5 so I'm still scaling my particle system or my textures up for the particle system but I'm going to get the world position of the actor this isn't the position of the particles themselves this is the position of the emitter at wherever you place it in the world and I'm going to take that and divide it by let's say 512 so now I have a coordinate in in the world I don't know what it is yet until the particle system is placed in the scene but this is giving me access to the planes that make up the the 3d environment I only want the the XY plane the ground plane I'm going to mask this - red and green so red is X Green is why blue is Z I only want the horizontal plane as I said so I'm then going to add these together and pass it into my texture again so now going back to my particle system I'm back at that tiling appearance so to break that up I'm going to turn that rotation back on so now I have a little more of a noise to it but the cool thing about this is now that I've added that world position behavior when I drag the particle system into the scene make this a little bigger and set the lifetime a little longer there we go so now I have a more distinctive plume get rid of the fog there so now I have a small smoke plume but if I duplicate this because its behavior is based on its position in space everyone that's placed in a different location will look different exactly the same particle system I don't have to do anything per instance to make it work it just does so I can now have a lot of in world variation for an extremely low cost and you'll notice this isn't something that you want to have moving if I move this out into the dark every time I move the particle system because that's the position that is using to do the material offset every time I move it all my old particles move as well because they're all linked so this is this is the kind of thing that you would want to place an environment turn on or off but not have attached to something not if you're doing your randomization this way so I'm going to actually build the if I can resurrect it here put the dynamic parameters back in and I'm going to do this pretty quickly so this is what I had before again you notice there are actually four channels inside of my dynamic parameter I'm using to to do the dynamic offset actually I brought my fog back there so here it is working again and in my material I'm going to use the other two to do something slightly different it's along the same line so I'm still going to be appending but I'm going to call these two add X and add Y so I'll append these together and then I'm going to add them again to my coordinates and what this is doing is this is giving me the ability to build my own panning behavior but inside the particle system so now that this is back if I add my dynamic parameters to my curve I don't need to see those so now I've got these two new ones if i refresh the node it'll give me a name so here's my add X and add Y I need to change the behavior slightly inside the properties for the dynamic parameter node I'm going to leave it so that it can update every frame I'm not going to set spawn time only but I'm going to set the distribution to constant curve instead of constant and this lets me plot it on my curve and do things over time so constant curve so now I have my curve here from 0 to 1 go ahead and plot that out and now we turn off the rotation as I drag this value around you can actually see it's changing the position of the texture within the particle system and this lets you do some interesting effects like bunching smoke so now smoke texture is actually moving down as the particles are moving up so it gives a little more of a weighted flowing effect if I do this in the other channel I can get a directional wind so I can start to have the particles move off in one direction the further I move it the faster they're going to move and again this is based on life so if I normalize the particles life time here at 2 you'll get that almost tornado like effect because the texture is moving inside of the the particle system based on the age of the particle but it's not actually moving the particles themselves so you're getting a more complex effect so someone asked if there's a way to have a volume of particles just sit but react to players walking through it you can do something like that with the GPU particles by having a global vector field attached to your player it's a little complicated to set up I'm not going to try and do it here but you can do something like that using those systems there's documentation on the global particle or the GPU particles and the vector field behavior so somebody else asked what's a good way to do ground fog smoke through a large area that you can walk through try making a lot of cloud particles but my fps dropped extremely well when I walk through them and I guess because of the overdraw that's exactly what happened the overdraw is probably killing you that way so the the best way that I found is having the particle systems be led so that as you're moving through you have a number of particle systems placed so you can kind of manage them all independently you don't have one massive particle system that's just sitting in the room filling everything up we also tend to fill effects like that by putting planes in that have different behavior so having a basically a fog sheet that's parallel with the ground and then you can use the depth fade to have it not render when it's close to the player death date is something we use quite a bit in our particle systems to cut down on clipping artifacts it's got its own nodes so if I just add a depth fade node and set the opacity as the output from my power so now in here because there's no depth at all it looks exactly the same but when I compile it and go back to my seen anything that anywhere where it would clip into a surface the depth fade is is cutting that back so even putting the the smoke directly over the chair it fades off nicely as it interpenetrates the chair so it gives you a softer look and that's one of the ways that we make things like player particle interaction look better by by carefully fading things out based on enter penetration somebody asks how I would do a spaceship thruster not just on its own moving in space so it looks right when it's moving fast or counter burning against its momentum there's a couple of different ways to do that one you can have a particle system be in local space which means it will always move relative to its placement so now if I move this off and grab my ax no matter how quickly I move it it doesn't leave the particles behind they're basically a solid entity of sprites it's not going to inherit any motion from the world or anything like that and this is good for things like short lifetime horror high intensity particles like something off of a thruster now if you want something that's more like a long trailing exhaust then you would attach this to the the rocket or nozzle whatever it is you may end up having multiple particle systems so within a single particle system you could have one be local space the other not and have the non-local space one have more velocity so if we bump this up a bit so now when I move it I've got trailing particles not really at a Highness one rate to look great but I've got the kind of core of the rocket being amplified out by the the secondary ones I could increase this size by life and also increase the spawn rate just for the the exhaust particles and it might actually have their location offset so in your initial location module you can give it a range so if I wanted to say have it spawn in the volume of the other particle system I could do that a little more easily alternatively you can also use what's called the spawn per unit and spawn per unit does a couple of things one it can override your spawn rate completely so your particles don't spawn at all unless the conditions are met and two it allows you to spawn particles based on how far the particle system has moved since the previous check so if I go in and kill this initial location and do a spawn per unit I can tell it to ignore the spawn rate when moving so it's not going to take in the default spawn rate I'll turn that off completely and so now we have a motion checkbox under view and what that does is it simulates the particles moving in orbit around the center based on the motion radius so if I increase this motion radius to 500 I get a bigger movement around the that point and now if my spawn per unit is very low I won't get anything but now I've given it something so what it's basically doing is it's looking to see whether or not it's moved some percentage of the the unit scalar and then it fills in the gap between samples with particles so you end up with something that only spawns more particles if it's moving quickly enough to trigger it it is something you need to be a little careful with it's easy to have something that looks really good when it's moving slow but that spawns an unusable large number of particles when it's moving that's something that GPU particles work very well for because we can spawn a lot of them very efficiently in that case we would just change the type data to GPU and get rid of the dynamic node because dynamic does not work with GPU particles so if you're building something that's not a CPU particle system bear in mind there are nodes that work in CPU particles and don't work in GPU the dynamic parameter mode node is one of them so I'm going to add in the initial rotation again to get a more broken up look you could also set the initial size to be variable so this will give me a more visually staggered look some particles will be larger than others some particles will have different rotations if I make these numbers dramatic you'll you'll see even more of an impact so the spawn per unit is how I would do something like a trail behind a car's tire based on the movement of the car I think you can actually see that in our vehicle sample you can also do things like the spaceship thrusters where it's kicking out a consistent trail it may not be the highest spawn rate that you see but if it slows down you're not over spawning and if it goes very fast you're not getting the cotton ball look where you have puffs scattered out between points in space so in terms of the other particle systems things like beams trails dynamic parameter only works with sprites and only CPU sprites so depending on what you're building it may not be the right solution workarounds that I found for that is even though things like the dynamic parameter don't work the particle color does so you can do a lot of the same things by carefully choosing how you're using your RGB values so for example I'm going to get this down to just simple dot and just put that right into here there we go so now I just have the simple round spot but let's say I'm if I'm doing this in a beam system you know build a beam system for that really quick so beams require a few of them this nut does not need a motion on beams require a couple of additional nodes to work for example the source and the target because it needs to know where it's starting it needs know where it's ending I'm going to just set a default source of 0 so my beam will start at the origin of the emitter and then the target will just set that to be 500 units along X now you'll see you notice that it's kind of growing it's not really going anywhere useful that's because it's got a speed that I need to override so if I set the speed to zero the particle just spawns and now I have a beam between two points and it'll just keep refreshing itself so it's good if I set my material to be the one I'm using I should get that soft dot overlapping after compiles so now you can see the color of her life affecting it but if I wanted to say pan this material around on side of my dot I could do a few other things instead of doing opacity I'm just going to use the Alpha Channel for something else so we're going to append this to nothing so now my alpha has become a two vector and then we're going to add this here so now my alpha channel is part of where that sphere mask is going to appear and so now I can actually control the position of that dot on my particles that are on my beam I'll get rid of the the over time so now I just have a direct value now by default the color over life wants to clamp at the Alpha to keep it in the save range I'm going to turn that off because in the case that I'm using it in it's not really necessary and now I can say every time I beam spawns it starts at 1 and goes to negative 1 which will pan it completely off and I now have a beam that has a panning dot moving along its length and this is only one of the ways that you can hijack existing nodes to do something a little more complicated there have been plenty of times where I needed to do something that had variable color variable position noise built into it and the way I do that is you start using your other RGB channels so for example if I wanted to have my red channel be just my color I could have two colors let's go with red and blue just for simplicity that I linear linearly interpolate between based on the red channel so now inside my particle system my dot is red and in my color over life I'm going to look at just the red channel and vary its value so now my dot goes from red shades through purple to blue but I'm only using a single channel of data to control that blend so now I could start doing other things like blending between textures that were being used going back into my example content I find that noise texture that I like so much you can put that in once it finishes loading it there and then we'll find there we go we'll do the smoke again so now I can lurk between these two using let's say the green channel and we'll modulate the opacity with this so now my appearance is being varied not only by the color of her life changing the color but once it's finished compiling you can see that noise pattern is part of it I'll go into the green Channel and do the same thing here so now it's interpolating between the noise pattern into the smoke I could continue to change this in as many ways as I wanted by just using these three channels as raw data instead of as an RGB value it doesn't care how you use the data the material it's just conveniently set up in a number of different ways so that's a lot of the kind of complex CPU particle stuff and obviously some beam types of materials that I've created talking a bit about GPU particles there's a few other things that you can do with GPU particles that can be kind of interesting so I still want the particle color node I'm just completely going to gut my material here so this is going to become a GPU particle just feeding it directly in this is the absolute simplest GPU particle you'll usually create will kill that and inside of my particle system will take the material and assign it and tell it that is GPU sprites so now it's complaining it doesn't have a bounds that's very easy to fix deselect all of your nodes and scroll down until you find where it says bounds tell to use of fixed bounds and for this this is giving the the box in space that it considers the particle system to live inside of it assumes that if you can't see the extents of this box that you can't see the particle system and so it stops rendering and that can cause problems when you move up to a particle system so that it's filling of you but you're looking away from the origin enough that it blinks in and out so by giving this a large value in this case positive 500 for one axis and negative 500 for the other it now thinks that the particle bounds are a little bigger and it will be more likely to stay on screen when it should set that a little bit larger they're so negative five thousand thousand five thousand they were you so GPU particles because they do have different limitations there's other ways that you can use the material data so for example if I do particle position world space I can actually use this to map a texture into the coordinates of the particle system so I'm going to do something really simple or really similar to what I did with the actor placement where if you place the particle system in different locations you get a different smoke plume I'm going to do 512 and let's find a good texture here we'll filter just for textures this will work listen noisy and kind of large so inside my material I'm going to put that in and I'm going to use one of the RGB channels of the result of this as my coordinates for my texture here and then I'm going to feed that in as my particle color so again this because this is position in space masking it to just two components like this gives me the XY plane and then in my particle system let's give this a really large box I don't need the z-coordinate and we'll have the spawn rate buy some ridiculous factor so 50,000 so you can actually start to see the texture pattern for this texture showing up in my world based on the scaling factor the more particles I have the more of the texture you'll be able to see but this means you can actually do things like logo projection breakups where you actually lurk this value in only at a certain point so you can have a wisping effect if I kill the velocity on this and make the size a little smaller you'll get a little more apparent resolution and let me drop this box down there now you can see the texture quite easily now obviously it's minimum resolution is the size of the particles themselves but this means that any texture that you give it say for example this little hexagonal grid thing compiling the shaders always a good idea so there we go you can see now if I were to do something like find a vector displacement field I think if we may not have one in this nope just the texture I could have it as part of the the effect and have it break up a bit based on that you'd be careful though because you are projecting it in world space which means as particles move they're just picking up the the texture based on their position if I give this some lateral velocity say along X and turn this on you still see the the texture itself is locked in space even though the particles are moving often in some direction there so what we've got is the ability to render a volume texture essentially over the top of the the particle systems so looking at some of the other the questions is there any way to spawn particles through a grayscale texture this is about the closest that you're going to get is the ability to use a particle to or use the texture to determine when the particle looks like in space there's not a current way to spawn particles from a surface based on a property of the texture at least not correctly there's some support for it in the the spawn are the initial location module for skull divert surface location there's an inherit vertex color you cannot do it on GPU particles but the idea is that it when when it spawns the particle on the part of the skeletal mesh it also looks at the vertex color and you can set whether or not it gets that vertex color on spawn you can also set material indices saying let's say your arm has three materials one for the hand one for the forearm one for the upper arm even if they're all one bone or three bones and you set all of them if you set the material and to see the material index only work on the one for the forearm it will kill any particles that spawn off of that material index so it allows you to have a skeletal mesh that has customized spawning locations essentially on on the mesh is there any way to set a selected low poly stat mesh which will decide initial direction that's the kind of thing that you typically do with a blueprint so for example I have a blueprint that is I can actually do this pretty quickly so in my example content I'll start a create a new blueprint of type actor open it up and let's see in my blueprint I'm going to create a static mesh component and I'll tell it it is let's see quad pyramid will work so now let's let's assume that this has some directional bias to it we'll duplicate this and so we're going to assume that the particle system is going to go along this axis it changes to be it there so it could change to be positive X just to make the math simple for me so now this arrow essentially is pointing pointing along positive x if i add the particle system as a component as well and we'll set the initial location to be a sphere it's not too terribly large and we'll drop this pond right now much there so now my particles are tending to spawn and move along that axis along the positive x back in my blueprint I'll add another component which is my particle system and all directional I'll make it a child of my initial mesh so now I have the oops I make it there so now the vertical pyramid and the pyramid pointing along X our parent child and my particle system which I will set in a second is a cha is a sibling there so now back in my blueprint get rid of that one in the world when I drop this in space anywhere I rotate this thing and able to see it pointing that's the direction of my particle system is going to spray in because it's using the the same coordinate set and this will still do the if this we're moving during gameplay every time I move it at re execute the construction script so it's not going to move the same way as the particle system was would if I dropped it in so now you can see I kind of draw with it if you moved it the same way through a time line or something like that it would update dynamically so that allows you to have a directional value that you can see but the actual emission doesn't start until game players or some event occurs but you can still pre visualize what direction it's going to move so somebody asked how you stopped GPU particles with collision from colliding with your character but not other objects unfortunately there's no list of channels that particles collide with or not GPU particles just use the scene depth to collide with if something is opaque and writes to the scene depth then the particles will collide with it depending on the nature of your project if you were able to make your character transparent the GPU particles would no longer collide with them that's not going to be feasible in a lot of situations so there's not really an efficient way of not having them collide with with the player question how can we create volumetric smoke that gets obstructed by moving objects next to it or do we need to use invidious smoke system which doesn't support you before if you're talking about having something like a simulated smoke that that hits things and moves around it you can use the collision module inside of a particle system that will handle kind of the high level don't go through these objects using the depth fade we've gotten some pretty good synthesized or simulated volumetric sout of that by basically having the center of the particle fade slower so it's not as likely to fade out it'll it'll look like it's present longer whereas the edges fade out rapidly so you get a kind of spherical volume there's also if you look in the content examples in the effects level there's some examples of smoke that are pseudo volumetric they can accept lighting and things like that they also cast shadows into the world so that's a good place to set that up any way of making spline based force fields like I have a vector field that you can modify with splines instead of the inside the editor instead of baking the vector field simulation elsewhere not really there's you could conceivably have a timeline where you have a point attractor that's getting updated and kind of pulls particles along with it if you look inside of the particle system here if I look under attraction there's point gravity so this gives me a point in space I'll put it in 3d draw mode so I can actually see it right now it's kind of at the comb of my purple garish Comet if I set this to be up to 50 and will go about 300 along X and give it a radius of 200 and we'll give it some strength you can see it's pulling the particles up towards the effect the higher the strength the more aggressively it's going to do it until you can eventually get this orbit mode thing going on so by setting that explicitly in your particle system you can do that with GPU sprites with CPU sprites you have a little more flexibility let me drop the spawn right down to something CPU sprites will be happy with so there's other attraction modes there's lime attractor which is basically a cylinder that the particles will get pulled into there's particle attractor which is another particle system within the same so you can have some particles getting pulled towards others the one I was going to show here is another version of point attractor similar to the gravity from before but in this case you can actually parameterize the position so you could have a blueprint tell the particle system that it's point attractor is at some arbitrary location like say you got the location of your player and every every couple of frames or every couple of like milliseconds you tell it here's the updated location for your point attractor because that's where the player is then you can have a particle system that is always attracted to the player's current location or are nearly always so if I set this to be direct and do something similar where I go 300 long x + 250 long Z I'll give it a radius as well in this case it's called range and the strength so you can see it's getting pulled up the range is a little different but the way the values work if I turn off strength by distance it'll get pulled a little closer and if I effect the base velocity so there I'm close to what it was doing before but with CPU instead of GPU particles and this allows you to attract to the player to an arbitrary mesh but it doesn't give you attraction to surfaces so you wouldn't be able to say stick to the arm of the player and have that work efficiently you could conceivably have a couple of point attractor locations that you rapidly change between so that it goes to this part this part this part and if you're changing that quickly enough you could simulate kind of a beam of attraction but that's not really the efficient way to do that is that it all viable to use particles as standalone projectiles that target your player or is there a much easier alternative we have a a projectile component that you can place in a blueprint if you look at the silly geo sample content game that I did in learn tab that's exactly what I'm doing I'm spawning a particle compar a particle on top of a projectile component the projectile component handles moving and has functions for updating its velocity and interaction and things like that the particles are primarily they're as visual Glitter they're there so that the player sees something and knows that it's a particle or projectile for my 2-d game the background is moving fast particles in world space disappear in an instant in a local space the movement looks odd what do I do need to do to keep emitted particles in a specific location on the screen the easiest way is probably to put them in local space and attach them to your camera so that as it moves the the particles move with it the oddness that you're seeing may be related to temporal anti-aliasing because the camera is moving very quickly it's trying to any of small shapes edges and things like that and it can occasionally pull particles and near them a bit even though they they look like they're moving relative to the camera because the background is moving quicker behind them they tend to get kind of confused into there is it normal when I try to migrate particle to my game that it's all gone and there's not textures or anything no that should not be happening if you can find a repro case we would love to hear it it's not something I've moved particles between projects that's how we migrate a lot of our sample content into kind of easy to consume packages so that should be working cleanly I would suggest it trying the migrate and then look at the logs inside of the editor and see if there's anything in your output log or your message log that says unable to move due to something or or can't find file for package something like that that may be able that that may give you a hint as to what's going on unfortunately without the content in front of me it's not exactly very easy to to debug something like that and I think that covers everything I had if we have any other questions I've got okay here's one is it possible for particles to connect collision for floors and walls for example a weapon that spawns a puddle of liquid unto the floor when it impacts the floor and also spawns onto the wall when it hits the wall but also spawns on both when it impacts an intersection since the decal system stretches across multiple objects I thought this could be a workaround instead there's nothing inherently in there to do that though we do have that there's the particle event system and what that is is inside of a particle system you can generate events so I can add one and I can say what type it's on collision and the frequency so I set it to one so every time it collides with something it's going to send out this event and if I call this event hit and I'm going to set a radio velocity and clear out the rest of this velocity and give this a spherical location it's a little slow we'll add radial velocity in the sphere as well so now and this is not something I would recommend doing a lot of but at least gives you a starting point say you had just a few particles we'll do it in the burst list so burst list allows me to say I'm going to spawn this number of particles every time so now every second eight particles could spawn when they die another eight gets spawned if I set the lifetime to be a little longer they'll go further and I'm going to tell it to only do it once and wait till they die before it spawns again so what this is doing is it's giving me particles that are moving out they're waiting to see if they collide with anything and I'll turn on collision as well so that okay they have one collision and then I'm going to create a new particle system that let's say just is the receiver it doesn't spawn until it receives the event and then it's going to spawn 15 and that should work will tell it it's listening for event hit so now this particle system if I set this up right and I may not have it's been a little while since I've done something like this every time it hits something it spawns particles from that position so conceivably you could have it yeah I'm giving it velocity and things like this if you did this very rapidly you could basically sent out splat points that hit local objects and try and spawn a particle on it by getting the particle velocity you could conceivably figure out where your wall is and stuff like that but it this isn't a this isn't a solution to your problem this is a a workaround that might help you get to something that's that's that's useful for what you're looking for it's like I said it's not a fix and it's not the the right the right way to do that feature if you're writing it as a feature you could do something very similar where you do a random number of traces out in a blueprint and find the end points to those and place a mesh or a particle or something against those impact locations totally in your blueprint or you could write it in C++ and do a more general splat feature that did that and clipped it correctly any last questions any questions that I've missed completely and did not do not mean to I didn't mean to miss any if I make a charge shop particle think Megaman archetype where after certain intervals the particle grows changes color would you use one or more emitter projectile or combine them all and set parameters to show the right particle for the charge it's an interesting question a lot of it has to do with how complex and expensive your particle system is it's probably easier to have nested particle systems that you kick on and off at the right times so you know you're doing kind of the the animated style where the bullet is traveling and then it gets a fireball and then the fireball gets a bigger fireball I would probably do it by having successive particle systems that you turn on mostly because later on if you decide you're not happy with the timing or if you want to change the color the more complex a single particle system is the harder it is to make those kind of changes and have them be efficient right you don't want to spend you don't want to lose a day making a simple change to timing because you're one particle system has all these other options that are being driven externally if you have a fairly simple group of particle systems that are getting turned on and off sequentially it becomes more much easier to make small tweaks and Tunes particles may have a timeline where their effects change over time can material support same thing if we use procedural ones like with substance which will let them age get rusty or dirty or damaged over time will we see the change over time in real time either fast or slow not quite sure what your you're going for with that materials can have a large number of parameter set that are driven externally think matinee or timeline where say I have a rust amount or weathering value that's doing anything from just a simple lerp or as complicated as five different textures changing slightly and being blended differently based on a single input those are very possible inside of materials you can do it on a per instance basis you can have a driven within a blueprint you can have it driven by matinee you can even have it driven by game code where your entire environment is just reading from the global material parameter collection and says here's the age of my room and then the level blueprint is changing that value so everything around you changes in age based on on the those values being adjusted so it's certainly possible to do changes over time in real time the speed and complexity of that is totally up to you I believe that's everything so thank you very much for for tuning in I hope it was educational and hopefully not terribly stilted and somewhat entertaining we will be doing more of these I'm sure in the future because I didn't generate any new content there's not a sample project everything I did was directly out of the sample content that comes when you create a new project so you should be able to follow along and and try a lot of the stuff I did and see how it works for your projects my name is Alan Willard and thank you very much
Info
Channel: Unreal Engine
Views: 34,253
Rating: undefined out of 5
Keywords: Unreal Engine, Epic Games, UE4, UDK, Unreal
Id: YZ3TIqwqOWY
Channel Id: undefined
Length: 72min 11sec (4331 seconds)
Published: Wed May 27 2015
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.