Unreal 5 Rendering Animation with Lumen | Maya User Beginners Guide

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello michael here from small robot studio with another maya and unreal engine tutorial today we're going to be having a look at how to take an animation from maya and render it in unreal engine and this is going to be a beginner's step-by-step guide so if you're already a little bit experienced with unreal i will be covering some stuff that you possibly already know i'll try and make sure this chapter is in the video so you can skip forward and back as you need so we're starting from the dead start here before we jump into maya to get the animation out we're actually going to start a project in unreal first because i want to create some directories in which we're going to export to so we are in the epic launcher at this point i would assume that you've managed to install unreal engine and if you haven't done that i'll link a tutorial in the description that's been covered quite extensively so we're going to launch unreal 5.0 and you can do this in 4.27 and higher but i want to use the lumen rendering engine so we are going to be using 5.0 so we're going to create a film and video and we're just going to start with a blank scene and we'll also rename this project i'm going to call it tutorial and i'm putting it in my unreal projects directory so this will create a tutorial directory and project defaults will also enable real-time ray tracing and this assumes that you have hardware that can support that so we will create that and what you'll get is a scene that looks like this and uh the first thing you'll notice is if you try to pan around that all your controls are backwards if you're used to my and this is the first thing that i will always change we'll go to edit preferences and we will up the top here type invert so we can find invert middle mouse pan so we'll select that so now when we alter middle mouse click and i'll left click it's the exact same as maya there's your right click as well and we are also going to start from a uh a completely blank canvas here so there's a bunch of stuff here this is sort of like your outliner here this is all the actors in the scene and we're going to select all of them so just shift select all of them there and we'll delete them and uh yes to all so now we've got a completely blank scene with nothing in it and that's going to work nicely for us so we need to save this thing so we'll save it and it's actually saving current level and under the content this is going to be the directory that we use within our project which i'll show you here so that's the root level of our project and in the content directory this is where we're going to be putting everything so you can pop your map in here if you like we will call this tutorial and it's called animation so and you'll see that that is now visible there in windows explorer so now we're ready to go into maya and bring across this animation okay so here in my you'll see i've got a animation here which is actually quite old from a few years ago from a compositing tutorial that we did here but we're not going to be doing the compositing aspects in unreal we're just going to be grabbing the geometry animation so the animation of our character and this method will work with any rig whatsoever though once you have exported this animation you cannot update it in unreal after this point we're not sending across a rigged mesh we're just sending across the animation data of an animated mesh there is a thing called live link for unreal and maya and that's not fully integrated at the moment it's still a work in progress however it's also worth noting that it won't work with every single rig that's if it existed and it doesn't work with this rig and it actually doesn't work with any of the rings that i've got so that's only going to work with a certain rigging workflows so if you've got a rig that's already been created or you created a rig yourself this workflow is going to work nicely just make sure you have your animation locked down before you do the export so what we will be doing is we'll be creating an alembic cache from our geometry and bringing it in to unreal and we will also reassign all the materials in unreal so you get a little bit of understanding about that material workflow in unreal and i will just find all my geometry here so these are all the geometry pieces so to get our camera clark subdivisions or a approximation of rather than using a normal map which we could do on a low poly mesh we're actually just going to export the higher subdivision now this will be a restriction depending on your computer and the size of the wreath that you're working with when i subdivide this rig it's only 150 000 so a roughly slow-ish um rig this will work fine for this is probably higher than it needs to be so it should be fine if you've got something similar so we are going to select the mesh we're going to go to smooth with the option box and we'll go to two levels and smooth and that's fine and then we'll just make sure that we reselect that so now yes uh 144 000 and this will work fine so what we need now need to do is create an alembic cache so under the modeling toolkit we can go to cache alignment cache and this should be enabled by default but if it's not you can always just go to windows settings preferences and plugin manager and just ensure that absorb abc import and export are loaded so cache alembic cache and we're going to export selection to align back now so make sure you are only selecting the geometry that you want to export and do not select blend shapes and things like that so just the geometry that you want to be visible so we're going to select the time range so how many frames and this is going to be 160 frames i'm just going to use the time slider which will give me that 160 frames we'll also scroll down to the bottom here we'll make sure we have uv right and right face sets selected and then we'll click export selection then we'll go to our unreal project and under the contact directory we're going to create a new folder and we'll call this folder maya import you can call it whatever you want and then we need to give this a name we're going to call this guy tongue face underscore anim that is his name and then we'll click export with that now exported if we jump back into unreal you will see a change to the source content has been detected would you like to import it we will import it so that's our alembic file and you'll see it's got a bunch of different things here those are all the individual pieces of the mesh so with this particular character a couple of eyes tongue teeth and the horns and we want to change the alembic import type we're going to change this to skeletal this does not mean it's going to have any rigging controls it's just the version that works the best the other option is geometry cache but this does make it a little bit more difficult to set up the materials if you do it this way so i'm preferring skeletal at the moment that may change with the geometry cache i will just point out there is the option to if we do the drop down here you can calculate motion vectors now with the skeletal mesh we still will be able to get motion blur so that's not a problem for us now we can create the materials on import we're not going to do that we're just going to import it as is now just bear in mind that may take a minute or so to import depending on your system and the size of the file so just be a little bit patient um just let the computer do its thing so on the left here our content browser will show everything that we have in our project directory and you'll see the my import folder there and this will expose the alembics that we have just created we've got these three nodes here which we don't really care about any of them except for this middle one here which is the one with the animation on it we need to put them on something so we need to create a bit of geometry here so we'll go to create and we'll just create a plane and we can scale that up using the same hotkeys as maya so that would be r to scale and there's no lights in the scene currently so we'll just create a simple light so create lights and we'll use a rectangle light and this light works the same as a lot of the lights that i've taught you guys to work with in the past uh however you'll notice that with the gizmo that when i'm rotating it's actually rotating on the world axis that's not a lot of use for us so we just want to press this button right here it's going to give us our local rotation so that will make it a little bit easier to rotate on the right here has got our options for setting the light intensity and all that we won't do that just yet uh we'll actually just create a create a quick material to begin with for this floor so we can actually see it so go back to the content directory and we'll right click here and then we can create a new folder and we're going to call this folder materials and we'll just dive in there right click and we'll create our first material and this is just going to be called floor underscore matte and we'll double click on that and when you do so it brings up the blueprint editor which is essentially the same as your hypershade editor in maya though the navigation is slightly different in this sense that uh it is right click to pan around so we're just going to set a base color to this material essentially a diffuse material and to do so we need a vector input so we'll just type in vector hit tab type in vector and we'll get this vector node which essentially will give us our rgb output so we'll take this top pipe pipe it into our base color and if you miss by any chance you can just alt and left click on it to delete it then we just select the node under the default value click the left side and we'll just give this a grayscale value of something like 0.8 and okay now if we left-click and drag this onto the floor geometry you'll see that it applies material but it's also applied it with this default normal map and possible default color and that's because any time that you make a change to this inside the blueprint we need to click apply to update it you can also save your materials as you work on them that will save them in case of a crash and it's always good to save your work as you're working in case you do end up crashing it so now we have a floor here we've got a light let's bring in our animated geometry so we'll go to maya import and we will just left click and drag him into the scene so at the moment he's tiny we can just select the right hand side here i'm going to make him quite a bit larger if we click this lock icon it will constrain all the proportions so we could set something like 32 which is about the right size maybe 30. you know you'll notice he's down on his face at the moment he does fall over but this is not the default position he should be in so we'll select this and we just need to rotate this along now i've got currently got it snapped so we can snap to the 90 degrees you can do that with the snapping icon there now the character is floating at the moment he is actually floating in the first frame when we have him animating you'll see him land on the floor and that will be fine we do want him to also run away from the camera so we're going to have him sort of run away from the light on about that angle and we can move him into place like so so that's the initial setup for him um he currently doesn't have any materials on him actually we'll just rotate him around so we can see them a little bit easier when we add these materials so we've already created one material we're going to create a couple more jump into the material editor and if we select our mesh our animated geometry we scroll down here on the attribute editor and you'll see we've got all these material inputs and these will be all the different pieces of the geometry so we just need to reassign all of our materials and we're just going to generate those one by one so we can right click and create material and the material is going to be called tf underscore body underscore matte and for this one this is his body material we're going to use the texture map that i already have so what i'm going to do is create a textures directory so we'll just go up to the content directory right click there new folder call this textures and what i've done here in windows explorer is just imported all the textures that i needed which i've done in a test run so a lot of them have been already converted to unreal engine packages so if we jump into the textures folder here you'll see them all there with some terrible uvs from a few years ago we'll go back to our materials and we'll start assigning these so to call these textures into this project they do need to be in this project directory can only search within the project you should have those good project directory habits from using maya correctly all these years so that's going to be fine for you and i so here is our tongue face body material we're going to grab a tab texture sample and we will just go to the texture and there's a drop down here and we'll just type in body and that's going to give the body diffuse map that i've already created and we'll run that into the base color now remember we want to click apply and we'll minimize that so we're going to click and drag this body matte instead of directly onto our mesh we're going to drag it onto one of these elements and i believe the top one will be our body let's find out so this is all good however on my on my other rendered versions i actually have a mask that i set up so i can have a different amount of specularity inside the mouth as to the outside of the body so to set that up we'll jump back into this material and i'm going to use that mask so we're going to create another texture sample and run that result rgb into roughness and then we'll just go to the search option here and we'll type mask and i've got the mouth mask that i already created so something i did notice and this will depend on where you export your textures from is that i had to invert this mask for this to work correctly in this rendering engine it was the opposite way around and to have some specularity the other thing we'll need to do is define the specularity input and we need to do that by creating a constant so just a value so hit tab and type constant and we're going to run the constant into the specular and then we'll give it a value of say 0.25 okay so with our specularity set we just want to click apply again now we can close that for now and if we zoom into the mouth here and a bit more of an angle you can see that the inside of the mouth has got that specularity where the outside and the rest of the body does not so very similar to what you would have already experienced in maya and very similar to set up so if you've got pre-existing maps very easy to work with so i'm going to generate the materials for the remainder of the rig and just like i did so you don't need to see me do that so there they are and all that remains is to assign them to the remaining pieces of the mesh so the problem is here is that we don't know which is which so it's just going to be a bit of a guessing game and we're just going to slide the bone on there that one's correct because that's gone to the horns is the next one going to be the teeth it is okay so we've got those correct then the next one's probably going to be the eyes it is not it is the tongue so there's the tongue and then the last two will be the eyes like so so pretty straightforward stuff so you can see even rendering in real time that's looking quite nice we're not getting too much global illumination on the back side particularly while the camera re-exposes itself but for this style of animation this is going to look really good and render very quickly so we'll save that and now we're going to create a render camera so we're just going to go up to create and to cinematic and cine camera actor and this is just a camera and we can move this into place and what you can see here is if we actually click this little pin icon it will pin the camera to the bottom right hand side of the screen so we can actually compose the shot as we would like and we can set up all the depth of field and things like that which we'll get to in a moment but for now this is pretty much fine uh the final thing is to actually get this to animate and this is the slightly more confusing thing coming from maya where everything is just on one singular timeline everything has its animation assigned to it and you can sort of edit it inside of one browser essentially is how it works in unreal so what we need to do is we need to add a level sequence under cinematic so cinematics add level sequence and we're going to create a new folder again this is going to be called sequences and this level sequence is going to be tongue phase render save that and it will bring up the sequencer on the bottom there it may be floating for you like so i prefer to have it docked down the bottom here so just uh click and drag the tab into there and we're going to do a couple of things here first things first frame rate 24 frames a second it's not a video game this is going to be an animation so we do want to use industry standard frame rates uh next thing we need to put some animation on this timeline because at the moment there is no animation so we'll start by putting the camera on there so left click and drag the camera on there and you'll see it comes up and that's all good still no animation that's because we need to put our animated actor in there as well so we'll grab the tongue face animation from the outliner there and we'll just slide it in underneath where the camera was and so this still won't have animation on it because that track there doesn't actually have the animation activated there's a track button which you'll click and you'll go to animation and you'll see that sequence there and then you can have it start from whichever frame you want so at the moment it's starting on frame nine it's just going to capture that animation we're going to make it start on frame one we're actually starting from frame 0 however and the reason we're going to start at one frame later is just so when we render it the motion blur acts a little bit more nominally now this is a 160 frame sequence and at the moment we've only got 120 n so we're going to extend the sequence settings to 160 and we'll just go to 160 we'll right click there and set end time and now that is going to be exactly right so our camera we might just move him over a little bit and we'll have him running and then pop into the side a little bit more so we can see what he hits this is going to run in hit that and then wobble around for a little bit and pop out we'll also need to make sure that we extend this camera cut here to the full length as well so we get to frame 160. now this is particularly useful if we're doing camera moves and things like that the other good thing about having the sequencer here is that we can click this button here next to the camera and it'll lock us into the actual camera point of view which is quite useful and if you want to undo that you just click it again and we'll probably put some geometry in here for him to run into so let's find the frame where he hits the wall which is going to be that one right there and we'll just put in a bit of a cube all right lovely so there's a nice uh black shiny wall from did you run into there and we might just stick another light in as well we could actually do this just by selecting the existing light and holding alt and dragging and it will just duplicate the light and i don't want to spend too much time lighting this is just sort of something pretty basic to get us started so we will select this light here we'll do some real simple things like temperature so under the right hand side here we can scroll down and we will select use temperature and i'm going to select the temperature maybe 6 000 we'll just warm it up a little bit and then this one above here we're just going to reduce the value of that to say four so we'll get a bit of a darker side and you know what i'm actually going to rotate home around to run to the other side of the scene so you should be noticing that the great thing about all this is that being able to update all this geometry with the lighting in real time is that we can actually do quite a bit in terms of look div without having to go backwards and forwards on ipr's or test shots or whatever you can see what the camera looks like we can make the changes that we want now is it as good as a offline render no it is not it is getting there and i would say within the next couple of years it's going to be pretty impressive what you're able to do particularly as the hardware catches up so we've got a nice little scene happening here it's probably a little bit bright but that's fine the last thing i do want to do is just show you how to do some depth of field we'll just find the pot spot where he is lying on the ground here and we will select the camera actor and under focus settings you do want to make sure that you've got manual focus distance set to focus manual and just use the picker and we'll pick him there so he's in focus now and as he's nearer the camera we'll probably get him out of focus all right so um to get him out of focus because of the focus distance that i'm working with here i'm going to have to use a really stupidly unrealistic f-stop of 0.1 if i really want to show you what he looks like out of focus and the problem with that would be that's probably too narrow depth of field so we'll just change that to 0.5 and just ensure that we get him in focus there so he is slightly out of focus there and then he'll be in focus once he's on the ground and that's what we want we can also set up a material for this black cube here so it looks slightly maybe slightly less monolithic okay great so our animation is all set up we've got the timeline set up we've got a bit of depth of field there is going to be motion blur but currently that's not visible and we are rendering with lumen now lumen is the default you can change it to other things if you want to we can just select the camera actor and we can scroll down to global illumination method will be lumen uh if you wanted to try some of the other ones you may do that uh screen space kind of looks okay lumen generally looks the best the other one you may want to look at but i'm not going to be covering here is if you go to path tracing you can see what a path trace version will look like it actually doesn't look incredibly different from lumen to be honest the shadows are a little bit better but for this sort of thing this is totally fine so let's render this out a couple of render settings that we need to go over first we'll go up to window cinematics and movie render queue and this is where we set up all of our different render jobs if you've got different sequences you could render them all at once which makes it quite handy if you were doing a bunch of shots in one scene so we're going to click the render plus icon and we're going to select the sequence that we already created which is called tongue face underscore render and then we need to set some settings up here so under settings we're going to click this unsaved config and we're going to select the jpeg sequence and delete that i'm going to hit plus and we're just going to do a png sequence here then we're going to go to plus again and we're going to add in anti-aliasing which will just give us a bit of edges and we'll also add our console variables and console variables are just some overrides that we can create and you can think of these as options that you would have in the maya render settings they are not surfaced by default because there are quite a few of them i imagine they will start to surface more of the default ones as they progress with moving unreal into further into cinematic the other thing to note is we can save these presets so once you've done this once you can save it and you can just keep reusing it so i'm going to use some settings that i've seen from a couple of different tutorials and they're pretty straightforward so spatial sample count i'm going to set to temporal sample count i'm going to set to 16. i'm going to override anti-aliasing and make sure that's set to none now we're going to go to our console variables and we're going to add in a couple of variables the first one is going to be r dot motion blur quality and this is just an override to increase the quality of the motion blue and we'll just set this to 4. and then we'll click the plus icon again and we're going to create another one r dot motion blur separa well and we'll set that to one and finally we're going to select output and we're going to select our output directory now i'd recommend that you don't put your outputs and into the project directory of the sing and the the unreal project that you're working with because every time you do you'll load all those textures into the project and you don't really want to be doing that so i'm going to go above that tutorial directory to a folder that i already created called renders and i'm going to select the tongue phrase tutorial directory and select that folder and make sure you want to check your output resolutions correct 1920x1080 so full hd so now that we're happy with that we're going to go to presets we're going to save preset as and i'm just going to save this under my sequences and i'm going to call this render basic save we'll accept that so now anytime that we want to use that preset we can just click this drop down box and use render basic and they'll be the exact same settings just double check that you aren't using the incorrect file path so you may need to go in and change that output directory when you do future ones now there are two options for rendering there's render remote and render local render remote is for rendering to a farm render local is for your local machine so that's what we're going to do here and what will happen when i click render local it will bring up a low quality preview of our render and it will slowly go through there so you can see it's ticking off the frames rather quickly even while i am recording okay so that is now finished that was about two minutes for those 160 frames which is quite nice so we'll have a look at that now so i'm just going to open up that image sequence in photoshop so just open and we'll find that image sequence just make sure you select image sequence and open select your frame rate which will be 24 and you can see this first frame here is messed up so that's why we want to make sure we crop it out and there we go now unfortunately with this particular render because of the position of the light with this deformation that i have on the mesh it's actually causing some pretty bad reflections on the eye you probably won't have this problem because you're not using a specific deformer on a piece of geometry that doesn't really want to deform like that in maya but that is just something to be aware of that can happen if you're using deformers also i didn't quite get focus right it doesn't look like because his eyes aren't in focus but his belly is so just pay a little bit more attention to that in future but you can see that work quite nicely and the motion blur you can see those individual frames they do interpolate quite nicely and they are fairly smooth as you can see and actually very very clean which is one of the hardest things to get right and offline renderers is that motion blur can get pretty grainy so if i did want to export that i can just go to file export and render the video as whatever video file i want to call it and render it to whatever directory that's fine so that's all there is to it that is the basic workflow for rendering any animation from my essentially and signing the materials and getting everything set up from scratch i'm going to continue to cover a lot of unreal stuff in the future so if you're interested in the more cinematic aspects of unreal that's what i will be looking at so make sure you're subscribed and if you found the tutorial useful make sure you click like as well it does help the channel out a lot give us a little comment ring the bell do all that lovely stuff all right thanks very much for watching i'll see you next time that's it for this tutorial if you found it useful make sure you leave a like so other people can find it and if you haven't already make sure you subscribe as we're bringing out cg and illustration tutorials every week just like this one become a patron and access tutorial assets bonus content a private discord and more by clicking the link below
Info
Channel: Small Robot Studio
Views: 19,692
Rating: undefined out of 5
Keywords: tutorial
Id: 4BrantUw6ms
Channel Id: undefined
Length: 29min 9sec (1749 seconds)
Published: Thu Dec 16 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.