How to Make Mist in Houdini + Unreal Engine (Easy Tutorial)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everybody so today I'm going to go over how I set up this missed effect top for the environmental Effect series we'll start by using Houdini to create the textures and then importing the results into un rail if you have any questions about the workflow or comments or any requests please let me know in the comments below hope you enjoy the video all right then let's get started so for an effect like this there are multiple ways of doing this you can do it as just one frame looping sequence or even like four frames if you want for this one I'm actually going to do it into a generic texture and actually have it in a way where you can reuse it in different effects so this is the beauty about Houdini you can do a lot of things with just one simulation so for this one I'm just going to go over how I set things up this is my own personal way like I've done it like multiple times times like even in the industry like I would go in test this out and see like what the result that I get from it so one thing I would always say to keep in mind is don't go overboard with your simulations because sometimes you can just push them a bit too far you just like dial them down and just go step by step and change one thing at a time okay so first off I'm going to start with the geometry so when you go into the Geo uh sop uh here I am going to add a sphere and this is going to be our shape so you can start this off with a sphere or you can actually um deform the shape and to do that you do a mountain and this will just add noise to the shape and of course you can animate it or do anything that you want with it this generally breaks up the shape of your simulation which is a good thing because you don't want your smoke or your explosion to have a shape that is a uh uniform because that usually doesn't look good okay so before that I'm going to go and change this into a polygon and increase the frequency to like say 20 should be fine I mean depending on how you want your shape to the form just going to keep it to this okay next I'm going to have my pyro source and this is where you're going to oh no sorry not the Pyro solver that's later P source so this is where you set up your temperature your uh Alpha color when it comes to like what the simulation source is going to be so this is really important if you want your um let so okay let's say for example if you're doing an explosion an explosion is going to have temperature density burn and Fuel and velocity of course so these are the things that you're going to need here to add that into your simulation so you can get those results for me I just need density and temperature so part of the reason I would need density and temperature is you'll see in a second so when I add both of them in here and just this now I will have my shape but I can't control the separation of particles so what that means is I can't control how many particles are there because they are based off of the polygon here and they are based off the points so to change that instead of uh having keep input which is the input to the Pyro Source change it into surface scatter so that way you can add how many uh scatter fa uh surface scatters as possible or you can just take them down it's up to you I'm just going to go with something like this 0.05 that should be okay uh let's see so next I am going to do a roriz uh roriz uh volume roriz attributes so here's where you're going to add those attributes that you had so the density and the temperature of course you can see here that like it's just a Big Blob uh I'm just going to clamp the coverage using the density and then decrease the voxal size but before you do that you might want to add your pyro uh simul uh so the P solver and then attach it here and part of the reason I say that is you see here you have a voxel size uh right here and then you have a voxel size here so what you can do is to have them both uh like let's say for example if I said this to three. three the other one is basically disconnected from it so to actually connected to you can just go on the voxel size right click and then do copy parameter go back into the volume size uh sorry the roriz and then go to the voxal size right click and then paste uh paste relative references so that way now they're both sharing the same value and if you change it here it will change here okay so now what I'm going to do is decrease this to let's say two 0.02 maybe five for now okay so if I just come in here and then based off of me just changing this I'm just going to play this that's the result I get just everything going up so for the simulation itself I'm just going to go to the source and then kill the flames and kill the velocity cuz I don't need them but what I will need is temperature and density and part of the reason I say temperature so if I kill the temperature here my simulation is just in place it doesn't actually go anywhere you you can't really do anything with just density I mean technically you can but just for the sake of this simulation you'll need temperature so if I go to the fields and check out the turbulence for example and then add turbulence to it nothing happens but as soon as I check the um uh the temperature back here now you also have turbulence but back to this uh I'm not going to need buoyancy because I don't need it to go up uh I just need the turbulence in here cuz now everything is animated especially the source and now you have your turbulence so technically it looks all right you just need to tune it up a little bit but the one thing that's a bit bothering me is the actual uniformity of the source so I'm going to change that uh after the Pyro Source I'm going to come into here here and then do a noise so attribute noise and change this into a float now if I view this you can see that this is being affected by the color CD CD is just basically an attribute for color and it's a vector so if I change it to a float and then delete the color and then add density so now if I plug this back in and view it here you see that nothing changed but if I change the things here and add let's say for example zero centered like I can break up the shape more so let's say I do subtract so now this adds a level of complexity to this and also I'm going to animate it so now you kind of have two types of Animation but also youd have to be careful because sometimes it goes into a weird way where like here for example half of the shape is gone so to fix that I'm just going to add more here the noise pattern so I wouldn't have that issue but like I said now you have a different type of uh complexity which is adding things on top of each other so now okay this doesn't look bad sorry it's a little bit slow because it's trying to cat this out again the only thing we changed here is basically just the noise inside the simulation itself nothing except turning off the Flamin velocity and turning off buoyancy so what buoyancy does is just kicks the uh like gets the particle uh sorry not the particle but simulation to go into a direction um which is up uh for the turbulence I did nothing here uh except for just turning it on on so here I can just come in and if I wanted to change something here and I implore people when they look at tutorials use your own numbers like for example I have my own way of like setting things up I know what they do I know why they do this in the case of somebody who's going in like fresh for this please do use your own number like for example you liked a value how something looks look at it again what did you do how did you set it up that way it makes you uh receptive to learning uh what things do so for this one for the swirl size I'm going to turn it in by half and increase this by three so now I have less uh I have too much turbulence now but I have less of a Sr in it so now it looks a little bit more broken and it has more of that a little bit of uh uh turbulence so to even add a bit more comp complexity to this so you can add disturbance which is going to shred it even more so now if I get it back into here and of course it depends on what you're going to use this for uh you can use it for mist you can use it for kick cups you can use it for like if you're doing uh gun impacts or whatever this is the way like I use like one texture to do multiple things for example all right so I think it looks all right for now I'm just going to tone down this maybe back to one and just change the seed and see how that looks yeah looks nice okay so I know it looks a little bit pixelated but once you actually get it into Mantra and render it out it that would look better so let's see let's say for example I want to actually cach this out so I would I can scrub through pretty quickly uh you can do a file cache and just pick out folder that you want to set this up in accept and just save okay so that seems to be good to go so one thing about this that is a little bit like what you don't want to have is it's not looping sorry what you do want to have that this is uh not looping but you want it to have it looping so there is a note called Loop uh Labs make Loop and if I set this up technically speaking you just need to pick a good point where it doesn't Loop anymore which hey this doesn't Loop so I sorry this does loop and now I don't need to change anything in here uh but the one thing I will add in here is the Pyro volume and turn that on add a color to this part of the reason you want to just have this is because they'll allow you to actually uh look it look at it when you render so if I had it just on the make Loop and I tried to render this so you want first you need to have a camera on the scene so hold control and click the camera and you'll have this outline where you can just Center your camera go to the view and just set it to 512 by 512 then just get it as close as possible to your uh simulation next you're just going to come to the render view switch this to cam one and render so now as you can see at least like you have something in here so let's go back into here I think this would have probably needed to have more so let's do two and just recache it again so this is probably going to take a while uh I'll come back when it's done all right that looks a bit better okay so let's see first thing uh let's add a light in here which I'm going to do an environment oh Skylight so if you hold control and then click on the skylight G to have light in here so now in your render you can actually see your uh details let's see so here is an issue that you're going to encounter a lot uh what you don't want to do is have this type of alpha because when you're going to try and erode this over time or have it dissipate this is the problem that you're going to face you're going to get to a point where it just it gets to this uh degree where it just erods completely through a big spot and you don't want that you want it to go from 0 to one or 1 to zero throughout the whole thing so one way to fix this is through a node called volume ramp so when you add that in here oh right now you'll see your Alpha when you erot it this is how the erosion is supposed to look like so yeah uh the one thing that's left is just to render it out and see if you'll like this uh usually before rendering uh uh usually before rendering out a simulation I look at it it through a play blast just to see like if there are any hiccups or anything because usually oh that's not what I wanted uh just change the size here to 1024 by 1024 and again so generally what I don't want to have is a big issue with um this for example how it looped this way that was weird huh H right now I understood yep it's the looping that's what it did uh I think I know how to fix this see that's why I would do this first to see like how it would actually look like but the simulation itself looks nice uh I'm just going to take this and just put it after the file cach and hopefully it doesn't Yep looks good so if I do it again again usually this is just patience you need to have the patience for this and you need to trust the process because if you rush things like this it's like you're going to have to come back and fix it anyway so might as well try it and do it right the first time I don't need to I don't think think I need to worry about like what's happening here that's I think that's Bly because of the lights I might be wrong but we'll see yeah I think it's the Shadows so if I change the angle again you can skip over this part this is just my sanity check here that I usually do okay let's try this then if I do it this way don't think it's going to change anything anyway okay I can just render it out if the problem persists I usually just come back and see what's wrong usually just go by turning things off and see like if that fixes the issue uh for now I will show you how to render in Mantra which you just go into the out you have the Mantra node here you can actually just pick your frame range so I'm just going to pick the whole thing and just render that out uh couple of things I would do is uh PBR for the rendering engine allow motion blur and enable depth uh and also if you want to like get rid of this based off of your PC and this is also going to affect rendering time uh you just uncheck this so now you see like it it is going to take a while but just for for the sake of this I'm just going to keep it on and just render it so uh let's see that's the camera Correct images so let's do this I don't want to tap the whole thing so I'm just going to copy it let's go to the D drive goo render just do looping smoke accept and render so now we just wait for rendering okay now that the render is done I'm going to go into how to put it all together so uh I'm going to go into the image or the comp uh section and I'm going to switch to the comp View and here you'll see this note so I'm going to delete this but usually it's the only node that you're going to have so drop that down and dive in the next thing that you're going to need is the file uh node so what this allows you is to get the actual file that you have of your um render so now I have from one all the way to 240 so I think that's fine so if you want to you can just like make a completely new project and just import this in just for the sake of like peace of mind and nothing would uh uh no issues with the r sorry no issues with the go or anything on the project side but I don't see any issue with it right now so I'll be fine with this so what I usually do on comp is I break it down into couple of different things so one do I need to have this uh be affected by Lighting in the engine if I do before this step before I render out I would set up a 6. light setup which here allows me to control the different Channel Through uh the channel copy node so this node allows me to give uh the three the four channels different sets so here I can say this is going to be R this is going to be G and this is going to be B and this is Alpha for this effect I'm not going to use that because I really don't need to do that this is just for one thing and it's just just a piece of information for you know like if you're trying to do a 6. l setup you would set it up here and then you would render it out from here so next thing I want to do is control the timing so this is 240 frames I want to compress all of this down to 64 so there is a uh note called shape uh sorry uh time shift or time scale so in the time scale under length scale select select uh select sequence length and then set this to 64 what this will do is compress your uh sequence from 1 24 uh sorry from 1 to 240 to 64 so now once you get to 64 no more frames so what I would do is I usually do 64 64 that way I have all of my frames here and for this one I'm just going to go back out and just kill all of it I don't need to show anything okay to actually make the atlas I'm going to use a mosaic Noe and this will give me the uh rows and columns don't forget you need to have this on the first frame for it to work here is going to be images per line are going to be eight so it's going to be eight rows and eight columns and the max image frame is the max of the uh sequence so it's 64 so you just wait a little bit and now you're going to have your Atlas so one other thing that I'm going to do is actually do a crop it's kind of weird but I know I this is the way I do it and it's I know it's manual but at least it gives me a peace of mind to what I'm doing there might be somebody else out there that's done this in a more efficient way but this is the way I've learned and this is what I'm going to do so what I'm doing here is trying to minimize as much of the dark space as possible so what this will allow me to do is just so I can have the uh texture not be wasted I wouldn't say wasted but more of I don't want it to have much waste of space in there so that looks okay I'm just going to take this up a bit okay let's see I think that's it I mean the last thing you want to do is just do save frame uh just go into the format and open exr as far as the size set it to other and you can come into here and do 1024 by 1024 or if you want it to have a higher resolution you do 24 uh 8 by 248 and you're just going to find a place to save it I'm just going to save it into here just going to do under smoke yes I called the folder that long uh next I'm just going to call this loore smoke and I'm just going to render it out so now that I have my renders done I'm going to import them into un Rail and create the M effect so go to the texture folder I basically created a folder structure for myself um it's good to have uh import the texture just make sure it looks good yeah it looks all right yep everything is good so if you want to like save on performance you can always come to the level of detail and set the bias to one so this will cut it in half or if you want to set it to two that'll go 512 and so on for now I'm just going to keep it at zero just for argument sake uh all right so now I'm going to go into the material and make one called looping uncore smoke so one thing I do want to do here is the same video that I did the otes and when the camera gets closer to the effect it starts to kind of fade in the middle or like Fade Away based off of distance and that's what I want to do for this too cuz like you kind of don't want the um the camera or the player to walk in there and still looks really hazy and everything you want it like when you want it like it's in real life when you walk in through the fog you see what's in front of you but you can't see let's say 10 m in and so on it's not like too much uh in your face it's not like really smoke that's emitting uh everywhere so to do that uh and I explained this in the modes video you need a pixel depth a sphere mask and a one minus and a uh a constant which is if you hold uh one and left click you'll get a constant Vector so put the depel uh the pixel depth in the A and the constant into B set that to 20 and when you look at it Yep looks right I'm just going to take the hardness down a bit and increase the radius for like 1,500 so now I'm just going to invert the result and review that okay that doesn't seem to be bad okay so I'm going to add in the texture call it smoke and put a particle color with a multiply so for the multiply it's basically a uh you hold M and you left click and you'll get the multiply you're going to need about three of them so you're going to multiply the RGB each other and then the Alphas with each other looks more like this and then you multiply the alpha with the uh pixel depth math and then you take that into the opacity so I know right now the opacity is gray out so to change that just go to the blend mode if you just click anywhere in the gray area you'll see this and then switch it to translucent so if you back out now you'll see it if you get closer to it it starts to disappear and that's basically it this isn't really complicated like I don't have like a sixo light setup or a different texture to do everything in it it's going to be set to LIT uh for Now default lit and two sides I'm going to save this so just like the mode effect that I did this is going to be like a an infinitely looping um effect so to set that up it's the same as the other one it's just you want to have uh you want to have a good idea of the performance and you want to have a good idea of what it's going to look like so it's also trial and error when you're trying to make these type of effects and depending on what your depending on the lighting and what the time of day in your environment is call this looping score SM I'm trying so hard I'm trying so hard to like spell things right cuz like I have really bad spelling and like it tripped me up every time not looking at the keyboard when doing it sorry all right so let's see okay I'm going to add the um the material in the Sprite renderer uh uh called it bling smoke so because I created an empty one like I'm I just do things from scratch and because I created an empty one this is basically not going to have anything to spawn until you do a a burst one on the emitter update so I'm going to do burst and I'm going to set it to like 50 for now and yep part of the reason it's disappearing is because of the distance of course actually I'm just going to put it back to 10 uh you can go to the Sprite renderer and under subv set this to 8 by8 so now you'll have your um particle and do a UV uh sorry a subv uh blending oh actually you're not going to need the blending sorry uh this is basically if you're trying to get a smother blending between frames when it plays out but I'm not going to have this play out I'm going to have it spawn a random particle uh sorry a random frame every particle so to do that I will go into the particle spawn and do a subv texture uh animation or subv animation um change the Sprout render to get the error to go away into a spread renderer and for the subv mode you want it to be random so now it will basically pick a random uh particle and to show that I'm just going to do change the size to uniform and if I set a shape location uh set this to a box or a plane and let's see Kill The Zed and do a let's see I want to spawn this on the surface and let's see actually let me do a sphere for now why is it not doing that maybe it's because yeah that's why so the size of the particle was a bit bigger than it uh the box so every time it spawned it would spawn still of the cluster so to see it I'm just going to add the particles into the world oh and just a tip for an infinitely uh spawning particles you might want them to set them to Local Space so you can actually drag them around without having any issues so now you see like it basically has a different frame uh but to even add more complexity to this I am going to do random rotation so every time a uh particle spawns it will spawn in a random rotation so that way you're giving that illusion of uh the particles being uh random so now this is this does keep spawning so to do an infinite uh life particles is kill particles when time has elapsed that needs to be unchecked so you'll see the infinity sign here and then when you go to emitter State you change that into self infinite uh the loop Behavior needs to be once and then the loop duration mode needs to be infinite that way you're going to have infinite particles in the world so to add even more to this uh I'm just going to add a rotation like a a small type of rotation so there is rotation uh rate rate Sprite rotation rate so if you see particles are slowly rotating right and this is what I want that's it like you can just set it up this way and leave it alone but if you want to add uh a bit of randomization to it you can have some particles Spin and some don't some can go the actually the opposite way so it's up to you um I generally if I'm doing something like this I try to keep it a bit uh neutral so -2 and let's say two and it will have a little bit of that flavor of it like being random it does move over time and the player is not going to notice this uh in the world that's the thing uh there are some things I need to consider when taking a look at this which is performance how many particles do I have how much is it going to cost me and so on and to check that I usually go into the uh top left corner where it says lit under the uh optimization view modes and Shader complexity see that is a little bit too much you trying to stay away from it's becoming a bit white you just want it to be a little bit here for example so for this first thing I am going to go to the spread renderer and under rendering uh sorry no where is it cutouts uh under cutout there is a way to actually cut out the uh lines here so that will give you a bit of room to wiggle with uh sorry not the line but the quads so to do that I'm just going to add the same texture that I had which is the looping smoke so what this is going to do it uses the alpha to cut out the uh quad so that's one thing does look a little bit too much still so I can come here either decrease it to like five for example and increase it size so one thing my mentor used to always say less is more so if you change for example the size and then change the uh amount and you look at it again yeah it's a bit it's not much but if you set it up correctly it would look really good so let's do that so now I've added like the stuff that I need to for the performance or done the stuff that I need to for performance uh I'm just going to mess with it a little bit so let's try and [Music] do try and do it in a way that is like not too much okay that's too much so this is let's say 800 say 1,000 th000 looks fine to be honest hm okay actually I'm going to keep it this way uh next thing what I'm going to do is just decrease the opacity so I'm going to go to the initialized particle and the color mode just set it to direct and set the alpha into like3 just to test it out nice that looks nice so that's part of it uh what you can do is I like how I populate a level for example if I'm working on something after I get this to look correct performance is right just for this right um I will copy these and place them around the level so here's another thing don't do the performance before you actually place them in the world I would say finish placing everything and then do the performance when you get a profile of basically uh everything in the world make sure it's finalized before you stop performing CU here's here's the issue that you're going to fall into if you do the performance uh before placing stuff right and you get to a point where your budget is going to be a lot higher than you think and then you're going to ask to cut out even more so part of the reason I did the performance before all of this is just to Showcase that just in case I forget so yeah all right so let's take this and and make another copy of it uh if you have it in the world just hold alt and then just drag uh another one okay it doesn't look bad okay there might be an issue here if you have noticed like there is like a cutout of this and typically when smoke or Mist does that it actually just does it in a way that is uh the depth is better so to fix that issue uh it is basically the depth so I go back to the material looping smoke and and under the uh Alpha what you can do is set up uh depth fade uh fade depth all right and when you save this it should in theory fix that problem perfect so now you won't really see it also if I do look at the performance it's not bad like there's just this right here but other than that doesn't look that bad at all okay yeah uh this is how I usually set up my uh stuff uh this is not a big environment but if this was bigger than this if it was like open world or something like that I'm more um I would say I have more freedom but because this is just like a close off scene uh I'm just going to start placing things around just to make it look good and usually you want to set it up in conjunction with like a postprocess that you use to control the amount of uh fog or not even fog just uh the atmosphere itself uh but yeah this is how I would set this up
Info
Channel: Mad VFX
Views: 5,453
Rating: undefined out of 5
Keywords: Houdini to unreal 5 mist Tutorial, houdini to unreal engine 5, houdini to unreal 5, houdini to unreal engine, houdini to unreal engine 4, flipbook, fx, games, help, houdini, how, looping, pyro, real, rendering, sim, simulations, time, to, tutorial, ue4, unity, unreal engine, vfx, video, mist, game fx, niagara, niagara effect, niagara tutorial, realtime, realtimevfx, rtvfx, ue5, ue5 niagara, ue5niagara, unreal engine 4 vfx, unreal engine 5, unreal engine niagara tutorial, Unreal engine tutorial
Id: B0tAkR-8CuU
Channel Id: undefined
Length: 49min 35sec (2975 seconds)
Published: Fri Oct 13 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.