Pre-Baked Destruction in Unreal Engine || Houdini Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome to another destructible video so here we're gonna make something that is pre-built in houdini and bring that in unreal engine to make sure it's actually a bit more optimized than before so recently i saw the game ascent and he also like used some destructible area pieces which i'm gonna like try to recreate here in this video in a more simplistic version so now let's start here in houdini so we want to start by creating a pillar and we're going to use that by a box so we're going to just place a box here and from that we're going to make a basic pillar shape so we're going to now grab our handle here on the side and manipulate that into a pillar so something like this could be different it doesn't matter that much we can also add some uh scaling here so if you want to quickly scale this up or down you can also try and place a dash geometry from a human so we can sort of like get a certain scale so the bullet is super big now so we can scale it down if you want to and now let's actually just uh place this up a bit in the height so it's like sitting a bit more on the grid and also let's copy the box here and we're going to add some side details or side bars for support so something like this don't have to be perfectly like like you see here it's just for adding some more interesting details here on the pillar so the box i'm going to just play around with the position and rotate it until i've found something that i would like to have as a as a result now we can also mirror that in the other direction so we have that on both directions and now i'm going to cut off the bottom part by a clip node so this will just clip or cut the geometry based on the position and now we want to fill this by using a polyfill so we're going to fill the geometry back again so they're actually like closed jump trees now to make sure everything is one big piece i'm going to boolean everything with the union to make sure it's like one big geometry so this would be useful in the simulation we can also now use something which is called the edge damage tool which is a labs node so make sure you have labs installed and you can have some edge damage by default so this is a voxel damaged mode now so as you could see it's like adding more geometry and adding voxel we can also do a boolean edge damage mode so this is then the boolean result so it's a very useful note if you want to quickly add some edge damaging effects you can also play around with settings like using different noises like the alligator noise is very interesting as you could see here it creates some cool effects uh you can play around with the noise types the intensity of this so maybe make it more subtle so it's not like damaging every single edge so it's like a bit more subtle like this and you could see like the parts being chipped away or like subtle cracks here from the alligator noise so that's pretty interesting to to have now in this pillar so this is my basic pillar now now next up i want to add some basic uvs already to this model so i'm not going to like go into like very uniquely texturing so you can for example do auto uving and will like automatically lay out these this for you but i'm just gonna use a uv projector which is just projecting based on the plane so we have a plane here at the bottom and based on the position of that we're just gonna project a uv or texture on that so if i'm now going to use a quick shade to view my texture we're going to see here our basic grids and we can just fill in eight textures so in this case i have something like this so i'm gonna have a mega scan structure that is stylable and at the top i have a concrete part and at the bottom i have debris chunks or like more rough concrete stones here so this is a tileable texture that i'm gonna use for different amounts of props so i can texture a variety of props with one picture so now the only thing here is to actually position this better so i want only the concrete at the top here so i have this concrete here and i can choose what i would like to see as the details here so this is my result it's not perfect but it's very fast to like texture this with just one picture you can of course to have different approaches now i would also like to use the edge damage here and i'm going to make a group from that so i'm going to say at the color at the green if it's 0 we're going to basically then get that red value so now i want to do a uv offset based on that and the easiest way to do that is just for example copying the uv projector again and i'm going to fill in that group that just created now often you should probably give groups better names like edge damaged here for example so it's like a bit more recognizable here and we can basically now use this to offset or have something more uniquely textured in that region so here i'm gonna like position it so it has more like the the chipped damaged version so as you can see now we have like that variation here that there actually like some more chips or you sort of like see the inside material of that concrete so it can just be an interesting way of texturing this uh but again you you can do up the other approaches you can bring this in substance and texture things more uniquely but this works well then next up i'm gonna sort of like think about what pieces i want to destroy so i want the pillar that is not fully destructible and that only sort of like at the middle it's destructible but it's still sort of like holding up in the middle so there's like some still support parts left so i'm gonna grab my box from the beginning so this is the representation of my pillar and i'm gonna copy that and then make a bigger version of that box and i'm gonna boolean these from each other so we have this but i actually want to have the reverse so we can reverse that or you could change it in the menu so this is my result now so i'm gonna then use this to then subtract from each other but what i first want to do is actually adding a remashing for adding more noise so we have more topology so we can work with that we can also do a bevel to actually smooth out the corners so here we're going to smooth out these corners so they're actually like not that hard anymore and we're going to also then do a noise pass with the mountain node and we're going to add some basic shapes so i'm going to add this a bit more subtle um so it's not that intense like this but this is something you're going to have to play around with and see what works best for your model so now i'm going to boolean these from each other as you see here i'm going to blend them and this will then be sort of like the damaged version so after i shoot it this will be the result when the pieces fall off so now i'm gonna actually have to go back to my box and i'm gonna have to make it smaller so by just selecting this and making it smaller this will sort of like be the damaged version afterwards after i shoot it so you're gonna have to choose how much you want we can also grab the other box to sort of like define the area or the region of how much should be destroyed so i'm gonna take something like this i'm gonna play around with noises also adding in normal could be interesting uh so i have something like this and again it's going back and forth between uh the boxes and the noises and so on so we can define uh how much damage we want so we can make it for example very thin you can even add some like metal bars and structures here so this is just the version you build after you basically shoot this pillar so now i have this result and check the uvs and of course we don't have any uvs for this so again you could uniquely texture this in substance but again i'm going to just do a similar system by just first of all making sure i have a group for this so i'm going to call this damaged and the boolean automatically transfers a certain group data so here afterwards i can only like specifically get this new detail so only this value is now selected so this important to know that to do boolean will also transfer certain group data so i can now use a uv projector and only say i want to project uvs that are in the damaged group so as you could see like i'm only now texturing or projecting this area so i'm going to just play around with that and have some interesting here effects so this is my result we can also do a rtu feeding so if you want to do it maybe a bit more cleaner we can use the rtuv we're gonna again use the damage group only i'm gonna then also use the uv layout since i want to target the this in the specific uv layout or spot so we're to enable here the rectangle and we're going to like wrap and select the bottom part so i would like to probably see my texture also in here so i know where this is going so we're going to go here into display options by pressing d and fill in our texture we can also disable the grid here if you want to and i can now specifically target this into an area so also in the uv layout make sure you are using the damaged group so we are only texturing the damaged part that we have and this is then my result so this is way better compared to for example the projector which is hash has some stretching this is just more cleaner in the result so this is my final result uh and it's looking pretty good and now i basically want to then also copy the boolean and get to reverse so i want to reverse this and get to intersection here so this is actually the part that will be breakable and destroyable and used in a simulation so what you could do with that is we need to actually use a material fracturing node to make this into different pieces so we can use the material fracture there are other ways of doing different fractures but the material fraction is pretty useful for this so here we have that we can also do an explode nut to see what pieces we actually have currently but i also often would like to start from one fracture level so now we have two fracture levels but i'm gonna just start from one and build up from there so we're gonna see how much we want like 70 or 100 so don't go too high and we also can change the noises here we can also do chipping and also for example etch detail so we're going to lower the detail size here too so it will be faster in calculation and we'll basically deform the edges of the chunks here so it will be less uniform so if i'm going to increase the noises here you can see that these edges are now like less uniform and more like junkies so before they have like these clean cuts from the fracture node but now we're actually like deforming them so they're actually more interesting so it's up to you if you want that extra detail there it could be interesting to have and again once we do on this fracturing we want to also check our uv and of course we don't have any uvs on the inside so you're going to have to again make a system for that so i'm going to build something similar by the odd uv and the uv layout so we're going to do rtv maybe do a auto and uv method and set our group so we want to use our inside group and this will automatically get the inside of the pieces because this is the output from the node we can again just copy paste the uv layout and i'm going to clear the group here and we're going to make sure it's also set to the inside pieces so let's check this result and it is still not fully working so the reason for that is i also need to include that damaged group that i made before from the boolean so we're going to have to include the damaged group and also in the uv layout so make sure you're adding that on both of them and now this should work so now we should actually see a decent texture or uv there so even if we explode the pieces so we should see a decent uv inside of these pieces and also here the outside should still be intact as we had before so this is all ready and done and we are basically ready then for simulation so if you want to do different material ideas we're going to use the labs quick material i'm going to basically and also use the groups to define what should be different material id so as you can see here i'm having different material ids now just by using this material node so that was a bit on material ids so now this is ready to go we can also add a divide node to triangulate this data so there are triangles so this could be more useful for the game engine uh we can also now assemble this into a back geometry so i often want to do the simulation i would pack the geometry and two points so these are actually now points instead of real geometry so that's important to know and i'm going to just copy paste this to the other side as well and i notice that my pack geometry should be one because this is one big piece so if placing a fuse node here uh actually worked with that now let's merge our pieces and our pillar together so this is then my result and we're going to use the bullet solver so this is a basic node for doing simulations so we can just already press play and it will probably just fall in the air so it doesn't so it needs sort of like a sort of like a plane to fall on the ground plane uh but before we can do that let's just match uh size so it's actually on the minimum here so it's nicely sitting there and we're to add a ground plane here in the settings so we're going to add ground plane we're going to now re-simulate that and this is done my result so it's still not really nice and we want some tweaks so i noticed that we need to actually use the normal uv in wrap that will make sure our pieces are more attached to each other so if you press the simulation now they should be actually properly falling apart so next up i also want to make sure that my pillar is actually not moving so we could either delete this and try to use this as a sort of like a collision system but that might also not be ideal and it will probably be more useful if it's actually in the simulation itself since that is also easier for exporting so i'm going to just keep my pillar in here and put it back in the merge node so i'm going to create an attribute which is called active and active is automatically recognized in the simulation so when active is zero it means don't simulate when active is one it means we are simulating the pieces so make sure you are inputting first your pieces and then your pillar here so that gave me better results for some reason so here this is now my result so i have the pillar and the piece is falling down so very basic nothing special there are many ways of doing simulations here and now i also want to add an explosion effect here in this system so we have this back geometry which are just basically points and what i can do here is i can use the add noise and we can say delete everything but points so this will only like visualize the points here and i want to add a normal on the points for what direction they should be going into so we can use a sphere for my implosion impact so this is where the explosion happens we're going to make sure it's a polygon and we're going to also add a normal node to this so we're going to add a point normal very important so we actually have here these normals if you enable the view and the goal now is to transfer the normal information from the sphere to the points so we can use the transfer attribute node and we're going to transfer that normal so by default they should already work so we should see like small like arrows going in the direction of where the sh where the sphere was so this is basically where the impact happens so where the sphere is placed my sort of like impact or explosion happens so if i place it on the side all the pieces would fly in the other direction so that's basically the goal of this setup here so it's very art directable and easy to tweak so if i plug in a different model i can easily tweak that on what should happen to the pieces so we can also like stretch this out to actually have the pieces more flying out in all kinds of directions so this looks pretty good to me and now i'm going to use a little bit of effect so we're going to place a wrangle node here and we're going to say that at the velocity which is being used in simulation is equal to the normal so that basically the arrows you see multiplied by a channel which is then called speed to control or boost that velocity so we're going to press the icon on the side and now i have a velocity or a speed slider at the bottom so i can now say how strong this influence is in the simulation so set this by done now in geometry spreadsheet pc or velocity so this is automatically recognized in houdini and we're going to plug this in our system and make sure we delete this add node so we actually see our geometry back again and now we need to resim and normally they should all explode in that direction so they're actually not just flying but actually like going away from the pillar like an explosion so based on like this sphere and the amount of speed you set you're gonna have different effects so here if i drag the spear up they will just fall down because the direction comes from above so if i move the sphere down maybe you tweak the the size so it's a bit more interesting like so the pieces will actually jump up before falling so if i now would press play you actually see that small jumping before falling so we can control this by here so we can increase this and now they're actually like really flying away so be careful with the speed value because i mean there are only like a few frames here before everything like flies out the screen so that might not be that nice so you're gonna have to play around with different values don't make it too subtle but make it like still noticeable so play around with these values so maybe gonna grab my sphere and place it somewhere more in the middle if you're more experienced with vax you can improve this you can for example say multiply a random value based on the point number so each point has a number and it will actually get a random velocity now for each piece so some pieces will fall far away some pieces will go not that far based on that random value so you could see that they're now like more randomness in there otherwise every piece would like perfectly travel a certain distance so you're gonna have to tweak these values you can improve this function to make something more special but this is already like a very interesting system by just using a sphere and a wrangle here to sort of control how pieces are flying in the air so just if you can control the velocity you can control how pieces behave in the simulation if you know more about vex again you can just also like do everything in one wrangle you don't need to transfer but yeah i mean it doesn't matter that much um it's as long it's got job done so this is now my simulation and yeah we're basically good to go so everything is actually up and ready we can also check our uv since that is important and we don't see our uvs and that is because we are still working in a packed environment so we need to unpack this here so this is now my final result here before i'm going to export this i'm going to also create a no node called outsim so this is as so i know that this is the output the cleanup destruction tool of labs is also very useful to know about this will automatically clean up destruction so as you could see here it will merge different pieces and reduce the amount of pieces used but in this case it's not really needed since it's already like a bit optimized but very important here is this slider here to optimize and merge pieces so very important to either toggle on or off uh but in this case i'm not going to use that since again my pillar is already like one big piece and it's a bit more optimized so that's already in place there so i don't really need that so let's go now to outputs and we're going to use our rigidbody to fbx node so this will what i'm going to use you can also use vertex animations if you want that so this is where you could find it but i'm going to focus here on the rigid body so now we're going to also need to set a certain frame range so we don't need the whole frame range i probably need something around 80 for 90. so that's sort of like when my simulation ends so let's say 95 and this is done my full range so that's probably good enough and we also then need to set what do i need to export so i'm going to go here and i'm going to use my out sim that i just created and this is then my result so basically i'm ready to go and press render at this point you can set a specific location or other settings but you're basically ready now to export you can also check in the windows built in player to view these models and it should work if you see very weird results you might need to do changes and re-export but normally you should see the same result here more and more interesting is we can always go back and forward and do for example a re-timing so the read-time node is very useful if you want to change timing of the simulation so this can be useful for doing some afterwards some post processing of the timing of the pieces so we can actually control that a bit more like speed up a certain part or slow down a certain part you can also get like very funky results if you like play around with it and do something like so so you're actually like really manipulating that time so very interesting note to tweak or like finalize a certain simulation if you want that now in unreal i'm going to use under 5 you can use engine 4 as well i'm going to just import this so i'm going to import a scout on mesh here i'm going to say none here and i'm going to leave the settings as this for now not going to change that much i'm going to make sure i'm importing the animation otherwise it won't have that destruction and also the scale here is 100 so i'm going to the difference between houdini and unreal is 100 so i'm going to multiply by 100 and basically that's it so let's press import and now i have these results so this is my animation and as you can see works like i would expect so it's actually like exploding uh and yeah so this is what i have for my result notice that we can always reimport this so here we have re-import animation so that's important to know like again if i want to retime this or do something different you can re-import that i also notice here that i have this weird normal issue so we let's fix that here quickly by going into our properties and we're going to disable here a toggle which is called rebuild rebuild or recalculate normal so we don't want to re compute any normals just use the normal from the model so we have that result so that's looking better so now we can drag this in my scene i can also here quickly add my material so i have something which is called trim concrete so this is done that result so let's save and go into my scene then so everything works here as well with the material and let's test it out so just grab the animation uh it's a bit too big so i'm not i was not always like really looking at what i did with scaling-wise so i'm going to just kill it down here in this case so i have my pillar and we can also do initial position so we can actually see now frame by frame uh what the result is and is it looking what i would expect so we have actually different set of pieces with proper uving setup here and again you could do something more uniquely but if you press play it already works so this is my base result here so we have a nice animation playing and you can also do basically particle effects so you can just right click here and add particles so you know our sound effects so you can just add a notify so play particle play sound whatever you want so this could be useful for already adding some more uh interesting effects so for the particle i'm not going to go in detail in about it i basically just took the vfx niagara one and i'm gonna use a template which is already called explosion so here we have simple explosion so click on that and we can use that for our basic explosion so this is done a basic explosion so you can just like tweak it bring in more interesting shapes and textures uh and then you can also use a blueprint sort of like game logic so i have a trigger box and every time i shoot a trigger box i'm gonna start the animation so here whenever there is a begin overlap we're going to do once and play that animation of the pillar destroying or falling down so that's how a very simple meant a very simple mystic implementation for this for in your gameplay purposes so this is basically what i have now and this is also how i made that demo as you can see here so these pieces are all made with the process that i showed you so now the idea is that you could just plug in different models in the system and like tweak things change things and to have something like a wall or other pieces for destroyable and that was it for this video so i hope you enjoyed this video this video was a bit more different since again we did some more pre-baked uh destruction so i previously showed you real time this direction now i showed you pre-break destruction so it's often a good idea to use both of both of them or either one of them based on like what you want in your game and also performance-wise what you could handle for the game so i hope you enjoyed this video feel free to like subscribe thanks for watching and see you on the next one
Info
Channel: Simon Houdini
Views: 9,561
Rating: 4.9675455 out of 5
Keywords: Houdini, procedural, 3d, 3D art, game art, modelling, beginner, tutorial, lowpoly, stylized, destruction, ue5, game
Id: exreMc7CNiU
Channel Id: undefined
Length: 26min 33sec (1593 seconds)
Published: Tue Aug 17 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.