Unreal Engine 5 Cloth Simulation - For Characters

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys welcome to this video in this video we're going to be doing something really cool we're going to be doing cloth simulation inside unreal engine 5. i'm going to do the setup in maya but you can follow along with any software so if we take a look at this clip i think it's pretty obvious that the cloth is not being simulated as you can see it just has an animation and it doesn't look good so we're going to give it some simulation and set in real engine so the first thing that we have to do is let's open maya have your character here with the rig let's click out python now open the script editor file open and i made this little plugin i'll link it in the description it's free to download we're gonna load it just ctrl a and drag it into your shelf let's call this icon cloth let's save save preferences now we can open it and we have a little plugin for the cloth simulation that we're going to be preparing so the way you do clot simulation in unreal engine 4 is you want to select your part that you want to be simulated so let's say this part and you want to give this a different material like cloth material zero one the plugin is gonna automate this but if you are doing this tutorial on blender 3ds max or whatever instead of using the plugin you gotta do the materials by hand let's actually get started the first thing is we had to make materials now if we open the material editor you can see that we have a bunch of materials again if you're doing this tutorial in an other software just make a clock material zero one and a proxy material zero one the colors don't matter the name doesn't matter as long as it's clear what it is if you're gonna be simulating multiple parts you're gonna need more material so cloth material two three however many you wanna simulate then we just select some cloth what we wanna simulate so let's select this piece then we apply cloth01 and that's good now everything that is blue that has the cloth material one is gonna be its own cloth simulation we have more cloth simulations to do let's select these two and apply cloth 0-2 now these ones are gonna have their own cloth simulation lastly we have two parts right here you can select let's get to selecting it so select everything that you want to have simulated and apply a cloth material i'm going to do the same here now we have four club materials that are gonna have some simulation so that's looking good now that we have all the clothes parts selected we're gonna do the proxy mesh and it sounds a little bit complicated the proxy mesh but all it is is just for your low poly you make a new mesh this is the mesh that we actually gonna simulate in unreal engine so let's start with the first proxy mesh for this part so i'm gonna hide it let's create a cylinder i'm just gonna model a proxy mesh you don't want to spend too much time doing this because you'll probably be going back and forward and changing your proxy mesh all the time i'm just gonna do a quick one so you want to try to match it as close as you can to your low poly so basically you're making a low pulley for your low poly it's the same idea you want everything to match as closely as possible so when you're doing the high to low poly i think that's looking okay it's not perfect but as for the video i'm just gonna do it quickly and the most important part of your proxy mesh is that the squares your quads are evenly spaced like this is bad you don't want to have scratched quads you want to have the mesh squared as possible so let's do this you also want to have them grit like the more grit like the better the simulation you don't want to have them really messy like this and this you want to have them nicely gritted what's really important is that you have the first edge match really closely so for this one i'm gonna move it closer to the edge and the more polygon you put on your proxy mesh the more performance the simulation is going to be so you want to keep this low but not too low that you're going to have a chunky simulation because the more polish you add the more smooth your simulation will be now as final step we want to have an extra loop here so let's take a look at this that's matching nicely so now i'm gonna hit apply proxy zero one it's gonna give the mesh a name proxymaster01 and it's gonna apply a new material let's delete the history on this proxy material zero one that's all we have to do for our first proxy mesh so let's make the other proxy meshes let's start with the proxy mesh zero two so what we can do is we can do an export of this character and we can import it now we have a duplicate now let's just select these and these now we can delete the rest of them so let's select the parts that we need another invert and delete now we can use these as proxy meshes but first let's do a mesh separate well separated because these have the same cloth simulation material they need to be merged together let's go to mesh combine edit the leap by type history let's get rid of the triangles here now we can keep them like this or we can subtify them to have a little bit more resolution so let's go to here and let's click smooth now we'll the simulation will just have a little bit more resolution it's a little bit hard to see right now so i'm gonna click this one it's gonna get rid of all the materials for now it's just a preview so let's do the same let's get rid of all the triangles do the same for the other part let's move again let's do a smooth and actually that's not the best proxy mesh as they are not evenly squared but for the sake of the video i'm not gonna make them better but if you're doing it for project just connect them make sure they have evenly credited so let's get our colors back let's get them out of the group and this one's going to be the proxy 2. you want to make sure that you match the the clock material no way to make sure it's the same with the plugin it's gonna have the same color if i give this proxy tree you will see that the colors don't match that mean that this isn't the right one so proxy too and it's also going to change the name for this one's proxy 3 as you can see the colors are matching and that way we know for sure that's the right one and the last one proxy 4 and you see all the colors are matching so we know we did it right so one thing i forgot to mention let's take our proxy meshes you want to make sure that your proxy meshes they're all single-sided you do not want to have thickness to them like some thickness it's gonna break the simulation and don't do it i also forgot to add an extra edge to all of them so let's do that and i will explain in unreal engine why we're adding an extra edge so now our proxy meshes are fine one thing that we need to do is because it has animation and the proxy meshes need to move with the animations so let's just take this group let's call it proxy meshes let's put this on top so now the final step to get the cloth simulation working is to bind the proxy meshes to the skeleton so if we move this you can see that the proxy meshes are not erect so let's select our rig then our proxy meshes go to skin and you want to make sure that you put it on closest in hierarchy because proxy meshes that are too far from the joints otherwise i'm not gonna be having any scanning so let's hit apply and now they're scanned but one problem now is that if we move it you can see that the proxy meshes are skinned differently from a character so to fix that let's select vampire this is a character with the good skinning then we select proxymesh01 let's go to skin and let's see copy skin weights make sure to put the settings like this apply let's do this for all the proxy meshes first select the first one and then the proxy mesh that's important otherwise it will copy the wrong scanning so now that we did all that let's move a joint now you can see that the proxy mesh is being skinned the same as the original character so that's all we have to do in maya so let's select everything let's export it vampire final so in unreal engine now all that you have to do is re-import the mesh and it will show up where the proxy meshes and as you see it lost some materials and that's because we changed the material to the clock materials so let's open up the mesh and here you can see the material slots so in all the club materials we want to reapply the material now you can see we have a material back in the proxy mesh we're going to leave it empty so let's start the clutch simulations first we go to window you want to make sure that you select clothing that it's selected and let's go to a proxy mesh zero one let's hit isolate now let's do a section selection let's enable that now we can select our proxy mesh now we right click create clothing data from section let's remove the now let's let's keep it uh but you want to make sure that you hit the remove from mesh and the acid name vampire final clothing zero one let's create it now you can see it hided the proxy mesh so now let's go to our proxy material isolate this proxy mesh let's go to clothing click this one and activate cloth paint now let's go down to settings let's change the pressure radius to something like six a bit bigger twelve and everything that's pink it's not gonna be simulated and here's a paint value everything that's white it's going to be simulated so let's start by painting the bottom section and let's change your tool to smooth now we're going to smooth this out and we added the extra edge because you do not want to have this be any other color than purple you want to have no simulation at the beginning so that's looking fine so once that's done we go back to asset details let's not hit isolate the activate cloth paint the asset details let's go to clothing as a details and i mean hold on ah yeah in lod zero let's go to sections and then we have a section so for character section five blah blah so let's look for cloth material one club material one so let's go to clothing and let's apply a cloth data and now you can see that's looking really weird hold on let me figure out why all right got a texture back let me just try to close this and open it up again i'm not sure why it's blown up that much this preview your animation or run animation you can see that we have some some cloud simulation it's looking a bit weird actually um let's go to clothing select the first one and a physic asset let's clear that one now you can see we have a much more normal cloth simulation we're not having any interaction at all so to fix that let's use our physics asset this is just going to give collision to the simulation but the physic asset is wrong so let's fix that so just double click it as you can see the like we have some volumes here and they're supposed to represent the body but unreal always messes these up you gotta fix them by hand it's a little bit difficult to see one thing that i like to do is go to lit and put it to unlit this will just make the little bit more easy to see now all that we have to scale the things down let's kill it down let's rotate rotated you want to try to match the body as best as you can so for now one thing that we can do is we can go back to vampire final acid details and let's go to the cloth material because we don't need that for now you can go to section hold on we can go to sections let's look for the club materials and buy a math proxy proxy club material let's disable let's do this for all the club materials let's also do this for all the proxy materials so now we have everything disabled except for the parts that are not clot these are gonna have the collision so if we go back to a physics asset you can see that will be a little bit easier to work with as we can actually see what we're doing let's take this one left up black and we need to scale that way down rotate it put it in place i like to disable these as these are the snapping you will just have a little bit more control without them [Music] and while you're doing the clot simulation you're constantly gonna be going back to the physic assets and changing stuff around until you get something that works [Music] so just try to match your character as good as you can i'm gonna leave this pointing out a bit so we have some collision for the swords so the last part let's move this one a little bit more as you can see now we have something that represents character a lot better i'm not gonna worry too much about these parts so we don't have any cloth simulation going on there so it doesn't matter for now for the purpose of this demonstration it's okay it's looking a lot better now we can go to preview animation and we can do a run animation and we can see our physics asset or collisions with the animation so if you're working with a lot of animations you want to preview them on multiple animations same for the clot so let's save that now once we go here let's enable the first clothing part back final cloaking01 enable now you can see we have our clothing back it's not being blown up really bad and we have some collision going on as you can see it still doesn't look good so we still need to mess more with it let's close this one close this one let's just open it again let's see it like this you can see we have some problems with clipping so to fix that go back to our physics asset let's just kill this one up [Music] same for this one still clipping a bit still clipping you're gonna be tweaking these settings all the time so let's save sex it out exit this window out again let's open it again now you can see the clipping here is gone it's not going through the legs so we have a little bit of clipping here so once again open up the fisk's asset let's fix the clipping over there so like that same for this part save you want to close the windows i don't know why but if you don't close them they don't update well a lot of the times [Music] so now you can see that we have no clipping at the moment but that's without the animation so let's try the animation it's looking a lot better now it's not clipping too much we're gonna need to edit some of the settings so let's go to the settings let's pause the animation actually let's just reopen it and now go to clothing and we can hit the clothing one go to cloth config now we have a lot of settings that we can mess with like density let's put a bit higher this is going to make it a little bit heavier so if we put it at one you can kind of see a difference but what i usually do is i just mess with the settings until i get something that i like as i don't make actual games i just use this to render for my portfolio the settings don't matter too much as long as it just looks nice the easiest setting to mess with with for the big difference is the gravity skill so you can see if we put this really high it's gonna be really heavy so let's put this at three for now let's go to animation let's preview it let's try something like 10. i think now it's a little bit too heavy so let's do seven now we're getting something pretty nice let's change this to zero let's see how that looks now we just have something really weird that's zero point one [Music] 0.5 but a lot of settings that you can mess with i don't exactly know what everything does but you can read up in the documentary online but i didn't get the chance yet to so i think for now that's looking pretty nice let's change the gravity a little bit less do something like two change the density again [Music] actually let's keep that one so i don't completely like how it looks but to get something that you like you're just gonna need to mess with all these settings but for now i'm just gonna move on to the next part so now that we did the physics asset we don't need to worry about that let's close it again open it again let's go to sections the proxy materials we can't keep and let's enable them for now let's enable everything again this one let's disable it again that should be not needed i like this section for proxy material one disable as we already did the cloth simulation for that one let's move to the second clopham simulation we could have also put it on the same one as it's pretty far apart from each other but just to mess with the settings differently it's easier to do it like this so section selections on let's look for proxy material 0 2 isolate highlight and i think it's still disabled although uh proxy material sort of flexing material zero one proxy material ah it's not double faced let's right click uh create clothing from create clothing data from section and remove from mesh so now here proxy material zero two let's isolate activate cloth paint and let's paint the cloth again and that's the wrong mesh let's delete it delete as the details deactivate now isolation proxy material zero two proximity zero to enable let's go to zero two isolate we can also go to character mesh uh have a good wedding but you can turn on the waveframe if you want to check let's do a create clothing data clothing 0 2 remove from mesh create approximate 0 0 2 isolate activate cloth paint zero two and actually it's the right mesh i've got to smooth it inside maya but i'm not gonna go back and change it just for the video let's paint some simulation radius 2 let's paint this white make sure that you keep this and simulate it that's all the activate club paint go back to acid details isolate oath now let's go to leds d0 clock material too let's apply it closing data now you can see we have some simulation now we just need to do the last two ones so let's start with zero three proxy material zero three right here isolate right click create clothing data clothing underscore tree remove from mesh great go to proxy material 0 3. isolate activate clot paint and let's select zero three let's make the brush a little bit bigger let's do something like four let's paint let's change to smooth let's smooth our mesh out here make sure that you keep this purple deactivate as the details isolate let's also do 0 4 right away isolate create closing data remove underscore04 great isolate again that's selected i just like the other one brush let's paint our white again everything that's right it's gonna be simulated let's go to smooth let's smooth it out again like the white is going to be fully simulated and the more black the less simulation will have so this is just going to make sure that it's going to look a little bit more natural instead of having it white to purple so let's save the activate cloth paint isolate turned off and now let's apply all our clothing data proxy material zero three it's gonna have the clothing data03 that's gonna have none it's the clothing material club material clothing zero tree club material zero four now as you can see all the cloth on the character is simulated now if we go to preview we go to run now you can see that we have simulated cloth and again if you don't like how it's looking you can always go to the clothing you can go to each one individually you can start altering the settings so let's say gravity too let's just gonna change that one and mess with it until you get something that you like and yeah that was it this is how you do cloth simulation in unreal engine 5. this is just a really fast and quick way of showing you how to there's a lot more that goes into it like you're gonna have to tweak the proxy mesh you're gonna tweak all the settings but that's how you get some basic cloth running all the characters and the animations in this video are from maximo if you don't know it you can download characters or rake your characters really easily there and have a lot of free animations that's all see you next time you
Info
Channel: TriGon
Views: 49,382
Rating: undefined out of 5
Keywords: 3d art, 3d, zbrush, tutorial, how to model, moddeling, 3d moddeling, game art, game dev, zbrush tutorial, maya, games, Trigon, trigon art, Unreale ngine 5, ue5, cloth simulation, real time cloth simulation, unreal engine cloth simulation, ue4 cloth simulation, ue5 cloth simulation
Id: zXjpX-SirM0
Channel Id: undefined
Length: 38min 1sec (2281 seconds)
Published: Sat Dec 04 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.