How to Use a VDB In Unreal Engine: Plus Free Advanced Volume Shader!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey our owner binits here for the pixel.net when epic games released Unreal Engine version 5.3 they included native support for VDB sequences making it possible to add pre-animated volumes like fire or smoke but with very little documentation and a complex workflow it's been kind of hard to use but in this video I'll show you how to use this free flexible Advanced Shader for vdbs that I built which is going to make it super easy for you to add volume based visual effects into your work I'll be using vdbs from the pixel lab's huge library of visual effects but this Shader works with volumes from anywhere special thanks to Jonathan Winbush for compiling much of this information in different tutorials and if you want to learn things about Cinema 4D and unreal he is the man to follow check out his channel on YouTube and get ready to have your mind blown okay so the first thing we want to do is we want to create a project and if you haven't already turned on raate tracing just go up into the project settings so edit project settings and make sure that you turn on two things so you'll start typing in Ray space tracing and before you even finish some properties will come up you want to turn on support Hardware Ray tracing that should be on and then also path tracing right here you want to turn that on if you plan to use path tracing okay closing that out so now let's get started the first thing you're going to need to do is copy the files over for the Shader into your project to do that you'll download the files and once you've downloaded and unzipped them you'll see that there's a pixel lab VDB folder and inside ins of that there's a Content folder and inside of that there's a pixel labore VDB Shader folder and this is what you're going to do you're just going to copy this so you know you can choose right click and choose copy or you know drag it but either way we're going to go over to the content of the project file that we're using right now in this folder and I'm just going to hit paste and it's going to copy the files over and we can see that my project file now has the pixel lab VDB Shader set up in there at this point you might need to restart to get it to see the shaders properly but after you do that everything should be fine so now that we've done this you can see we have a folder that's been added to our project and if we go inside of this pixel lab VDB Shader folder you'll see that there's a VDB material instance and then a folder called source files which you want to leave this alone so we'll just go up one level and this is the file that we're going to be most working with here in the meantime I'm going to go back to the content folder and I'm going to grab hold of this VDB sequence from the pixel.net I'm going to drag the first frame right into unreal here and once I do that you can see that this dialogue for open VDB import options appears and this is where you need to make a couple of changes and it's found a sequence of 130 files so we're going to say yes it's going to be checked off and then there's attributes a and we've got this thing that says 8bit and then there's 32bit and 16bit now this stuff is not well documented but my guess is that this is about the color maps that control density and temperature and the larger the number the more data that will be in there for now I'm just going to leave it at 8 bit but you can change it to 16 or 32 and then I'm going to come over to the second area right here and I'm going to set this to temperature if there were a third option you could put it over here but right now there's only two in this one in fact if you were to import something like a VDB Cloud which doesn't have any heat no fire or anything like that then you'll probably only see a density Channel and not a temperature Channel I'm also just going to get rid of what's here we don't need this then I'm going to click import and it starts the importing of the VDB can take a minute or two and once that's done you can see that the VDB has been imported right here with that done I'm going to jump back into the VDB Shader folder and I'm going to drag and copy this just choose copy here and we've got this VDB material instance and I just do that so that I don't mess with the original material so now I've got a copy that I can work with then up here in the place actors panel and you can find that by going to window Place actors once I'm there I'm going to type in hetero and before I can even finish writing heterogenesis volume I'm just going to drag this and drop it right here and then I'm going to take this material and I'm going to drag it right onto the materials for that volume and you can see that it's got a single frame right here of an explosion it's not looking too good let's just get in a little tighter there cuz it's sideways so I'm just going to rotate it 90° and I'm going to bring it up right here like this doesn't really matter too much and this still frame is just here to help you see what things should look like okay okay now let's take a look at how all of this works I'm going to double click on the material to open it and when I get inside I'm going to see a whole bunch of parameters the first one is this one called VDB file and when I check it on it allows me to change the VDB source file so I'm just going to grab the one that is the one we brought in this animated sparse volume texture and we're not going to see anything at first because the first frame of this animation doesn't really have anything in it so what I need to do is to come down over to here and I can turn on playing and looping which will make the animation play playing Loop and helps me to position things a little bit better maybe and kind of get it to where I can see it sitting on the floor properly and that looks cool but I'm going to stop the playing in the looping and instead I'm just going to go to the a frame of the animation where I've got some nice explosion stuff happening where I've got a nice mix of the Heat and also the smoke and this looks like a good frame at which to do it so let frame 30 we'll leave it at that and then I'm going to go back into the material and once we look over here we can see we've got different properties and one of them is density density controls in this case the thickness of the smoke so I could lower this down to something closer to like 0 4 and you can see more of the heat is showing through if I bring this all the way down then we'll only see the Heat and only see that fiery part but if I bring it back to something like8 you know that's a pretty good place to be although in this case I think actually one is a good place for this particular animation so I'll leave that as it is and then we'll take a look at temperature now temperature controls how hot is this whole VDB essentially there's a chance that came in with it from the program that made this VDB that said that there is heat in it and if we lower this temperature down to nothing then we have no heat if we bring it up really high it gets very very hot now I'd like to reset this back to the 3000 that it was at and I could try hitting this right here but I've noticed it's kind of a bug and the bug is that when you change the numbers using things like reset uh they just don't update here in the visuals so what I'd say is just bring it by hand type in 3,000 for now and maybe this is the bug that unreal will fix but for now this is the bug the next thing to do is to look at the temperature emissive strength now whereas the temperature tells me how hot this is the temperature emissive strength tells me how bright that temperature emissive is so like if I combine this down to something really small but I crank up the emissive we're going to see only in those areas that are considered hot that's where we're going to see that glow if I crank up this number higher we're going to see this emissive really starting to fill up and make the rest of this glow so it's really a combination of these two one that tells me how hot it is and one that tells me how bright it is I'm going to set this back to 3,000 and I'm going to set this one back to one which is our emissive strength and then we'll take a look at the next section now below our main controls we've got our color controls and you'll see first we have our scatter and smoke color the first option here is called use VDB scatter color this is meant for a VDB that actually has color information in the scatter color in the smoke and in this particular case we don't have that so if I were to turn this on I think that it's pulling it from the temperature colors but it's not appropriate to use here so let me turn that off and we'll come back to that for an example that makes sense a little later now in this case I'm going to work with the scatter color by default the scatter colors are set to 50% gray and that's actually a great place for smoke but if you wanted to give it a little more life and have it kind of change over time where we make the first color white and I'm just going to okay and then I'm going to make the second color black and we definitely get a more interesting defined look and that's cool but you can also do things with colors so I could say what the first color would be blue and the second color will be purple and then we get something that looks again very interesting although maybe not the best look but it's definitely a way for you to arir this smoke a little bit and if we minimize here and we animate this over time we can see that what's actually happening is it's transitioning from one color to the other as the smoke ages so the first color that pink is brighter and then it kind of transitions into that darker blue color and I'm just going to bring it back to something like right here and if I go back into the material you can also see that we have this scatter color bias so I can push the colors more towards one or the other over time right so if I set it to let's say 0.5 then the purple will last less time in that smoke animation if I set it up to two then the the purple will last a lot longer and the blue is going to be the part that gets seen barely at all in any case I just want to reset this back to 50% gray and it's a great time to just remind you there's this bug and if I click on it nothing happens I've got to go in here and what I find is if I do this and this and click okay that will work and if I again come in here I can just copy this color right here and we're back and we're good and I'm going to set the scatter color bias back to one although in this case now that the same color doesn't really matter now below our scatter and smoke colors we have our emissive colors and this is where we can change how the glowing part looks so we've got our used black body color by default and that's just pulling from the temperature so you get like from uh orange all the way up to yellow and that creates a fiery look if we turn this off then what we get instead are a couple of different options now this first one called emissive color from scatter we're not going to touch here really because if we turn it on it's just going to be pulling these two colors and we don't actually want to do that this is not a great place to use that so let's just turn that off instead let's look at the cool cool color and the hot color and basically the outermost parts of the heat are going to be this cooler temperature and so we're going to see that as dark blue and the hottest areas are going to be this bright blue and if I were to change this color to let's say purple for example for the outer color and I maybe change the inner color to Green you know uh it looks pretty interesting although maybe not beautiful but you can see that we can control the colors of the emissive channel I'm going to lower the density quite a bit here just so we can start seeing a little more inside and you'll see that we can also push the colors more towards the hot or the cold color like we did before so I can bring up the bias and that will bring me towards the hot color if I bring it down to 0.5 that brings me down to the low color with just a little bit of green and as I lower the temperature you know what we'll see is that we're just seeing more of that purple where we should see in the hot points that green so here let me just bring this up a bit and you can see as we go back up those hot points are going to be green now let me just bring all of this back to where it should be and finally we've got this emissive remap adjustments area it's kind of like the levels effect in Photoshop in that it lets you expand or compress the bright and darker areas so let me just bring everything back to their default here and if I come into my input low and my input high I can bring up the input low and that'll strengthen the lowest point and we'll end up getting less brighter areas and I can also bring down this input high and we end up with brighter areas but they're sort of more compressed as where they are or and I can bring this back to the original numbers I can work with a Target low and Target high I can lower down this number and you can see that we never really get too hot but I can also just strengthen it so that more of it has temperature in it more of it has heat it's just never getting too hot because it never goes above this number you're probably not going to use it too much but it's there for you if you need it by the way like I mentioned earlier this Shader does work with vdbs from anywhere and in this case I'm using one from Cinema 4D what you'll see is that it doesn't have quite the brightness that the ones we're using from Pixel lab have and that's because Cinema 4d's temperature default is something like 6500 and when we do that we get something that looks a little more like what we'll see inside of Cinema 4D so this Shader is going to work with any vdbs you have and just to come full circle because we talked earlier about some vdbs not having a temperature Channel like a cloud and in this case you can see if I raise the temperature no matter how high I make it or no matter how low I make it you can see that it doesn't affect the image so I can again bring up the emissive values bring up the uh temperature nothing happens however if I come into the scatter colors of smoke we can change the colors here because these parameters are part of the channels that were included with the cloud VDB so some of these controls may not work as expected if you're bringing in something that doesn't have a channel that they can affect like the temperature now earlier I mentioned that we were going to look at this one property here called use VDB scatter color and this property is for a VDB that actually has a color channel so let's look at one that has that pixel lab has a bunch of vdbs called the nebulas and they're part of a package that you can get that have different colors within the nebula and if I were to drag this in let's just bring it in here and then we can see that we've got the red green and blue channels all have these different color channels and then we've got the density in the alpha I'm going to click on import and it'll take care of that and once that's imported I can just drag this right here into this property over here and we can see that we've got a nebula and it's using right now what appears to be the emissive color so let me just do a few things here I'm going to lower down the emissive all the way down to zero so that we don't see any of that and now we've just got this what looks like a cloud essentially but if I were to tell it to take its color from the VDB itself now we start seeing something where we've got the color that's the blue and the orange that are in this VDB and then if I come back to the emissive channel instead of using the black body color I can tell it to use the emissive color from the scatter and over here back on temperature I'm going to set the emissive strength back to one and now I've got a nebula that is both using its color for the Cloudy parts and also the EM missives as the same source which is the colors that came with it and you know you could do things like lowering the density a little bit and then just get less of the dense Cloud stuff and more of the glowy stuff and you'll have to play around with that to get the results that you want in fact in a situation where I've turned off all the lights I've brought the density down to zero I have a lower temperature of just a th000 and the temperature misses strength of just one you know as I move through it I can really get a nice nebula effect here just by moving through it it's really cool now what if you wanted to use vdbs with the path Tracer the path Tracer is a highquality renderer that comes with unreal it takes longer to render stuff out of it but it looks a lot better you get better reflections better lighting all sorts of good stuff so let's take a look at that I'm going to go from lit over here right over to path tracing and immediately I can see that my VDB has disappeared my volume is no longer visible so we have to tell the path Tracer to render the VDB to do that I'm just going to go into this command area right here and I'm going to type r. paath tracing H and from the options you'll see two things and the first one is called heterogenous volumes and we're going to click on that and then we're going to hit space and we're going to add one and one is to turn it on and if we wanted to turn it off we would type in zero we hit one we hit enter and now we can see this and first of all we can see we're getting a shadow right here which we weren't getting before and we can also really increase the temperature and the em missivoire225 the Shadows we also get this lighting and you know let me just bring this back to one uh we might want to lower the colors here from Gray to closer to Black which I think might look better and it's important to note because of that that stuff in the path Tracer does tend to look different than it does in the standard renderer so anyway you can see this looks pretty cool and that's how you use vdbs with the path Tracer now what if we want to drop this in the sequencer and have it explode at a particular point in time so let's take a look at that I'm going to add in a new level sequence and we'll just keep the name new level sequence save it and then I'm going to take the volume here and I'm going to drop it right in here then I'm going to click on the plus button and I'm going to choose heterogeneous volume component and from here I'm going to click on this right here and I'm going to look at the different options for animation I've tried a few different ways and it seems to me like the best way is to use the frame to trigger the animation so I'm going to set it to frame and I'm going to set this Frame to frame zero I'm on the first frame which is zero I'm going to set a key frame I've also turned this on so that if I make any changes to the value that will be automatically set as a key frame I'm going to move down to frame 129 cuz I know there's 130 frames and the first one is zero and the last one is 129 and I'm going to set this to 129 and now if I hit play well I'm going to see something weird it kind of ramps up really slowly and then picks up speed and why is that because these are ease key frames so we're just going to select them and rightclick and from the options which you might not be able to see on your screen linear right here it's the triangle shaped option you've got cubic you've got uh constant I'm going to go with linear and by choosing linear I've made sure that it moves in a linear fashion where it doesn't ramp up over time so now if we hit play you can see that we've got that so far so good now if I wanted this to start maybe 15 frames down I could just move this whole thing like like this and that looks good the problem is this is I just realized that if we bring this up a little further right we can see that the first frame has got this little dot right there so look at that so we don't want that we don't want that little dot there and there's definitely a couple of ways you can handle this to me what seems like the best way in this particular case is I'm going to go back to the F this Frame zero now and I'm going to set this to frame 129 right because frame 129 has nothing in it right the volume's dissipated and the problem is that if we play back from 129 down to zero it kind of runs backwards which is not what I want so I'm going to select this key frame right here and I'm going to right click and instead of using the linear which again you can't see I'm going to choose constant which is a square and then from there it will hold frame 129 and then jump to frame zero there we are and something that I probably should have thought about ahead of time is the frame rate I can set the frame rate here to a different frame rate but if I set it to 24 frames per second right now well you can see that the frames are no longer matching up to where they were and so we probably should have done that ahead now we have to calculate the distance between this one right here 12 we have to add in 129 and that would be 141 so I've really got to move down further in time to something like 141 so let me just get myself to uh 141 here and I can either grab this key frame and drag it to there or I could you know gra drag out these edges right there but that gets me there this looks right now anyway that's it and I hope that this helps you in your work if you're doing a lot of stuff in unreal then check out the products at pixel.net for unreal and you'll see that they've got tons of olymic and VDB files plus if you need materials for Motion Graphics check out the new Unreal materials for Motion Graphics it's pack with literally hundreds of materials for high-end motion design and visual effects stuff like metals and glass and animated Neons and and much more I think you really like it once again I'm Aran Rabinowitz for the pixel.net and I'll see you [Music] soon
Info
Channel: thepixellab2011
Views: 7,876
Rating: undefined out of 5
Keywords: unreal, ue5, ue, unreal engine, vdb, volume, explosion, fire, cloud, smoke, vfx, visual effects, motion graphics, gaming
Id: bLEGxvXc1Fw
Channel Id: undefined
Length: 20min 27sec (1227 seconds)
Published: Tue Oct 31 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.