Midjourney Image to Unreal Engine 5 Nanite Mesh

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
I am going to show you how to take a 2d AI generated image and turn it into 3D nanite mesh so let's get into that here's the list of the things that you'll need and all of the links will be in the video description below so first things first we need to generate an image so we'll slash imagine what are you doing that's what the are you doing so you can generate an image of anything that you'd like I'm going to do Egyptian hieroglyphs this is an important thing to note if you use this dash dash V Space 5 command that's going to use the version 5 of mid-journey and another thing that you want to do is a dash dash tile command if you don't use that Dash Dash style command it's going to give you an image like this where it's on and off angle there's Shadows there's specularity and it's not going to be as easily usable sometimes it can produce results that are usable it's going to give you something like this maybe but more often than not it's something that you can't really utilize so we're going to hit enter and let that generate and another thing that is important to note if you're using this in Unreal Engine 5 is that it uses powers of two for its textures so if you generated a different aspect ratio like a seven by four four by seven three by two something like this you're going to have to go in and manually change the image in Photoshop or or something like that in order to get that to a resolution that is acceptable for your Unreal Engine all right now that we have our image generated we're going to open it up in the browser and right click and save the image as just make sure it's saved as a PNG cool the next thing that we're going to do is go to an upscaler website I'm going to use upscale.media and you're just going to go ahead and select the image that you generated all right now it's upscaled from 1K to 2K and it was fairly quick taking a look at it it definitely looks a lot sharper depending on the image that you generated you might have lost some detail through the upscaling process but it's important to upscale it because you want the larger image for the next part that we're going to do and so we're just going to go ahead and click download image and we'll go ahead and open up blender alright so now that we have blender open we're just gonna make a plane and scale it up by four and make sure to apply the transform for the next part you want to make sure that you have the Deep bump add-on installed right there you just hit the little check box after you install it and we're going to open up a another tab here open up the Shader editor and give it a new material if you have the node Wrangler add-on installed you can press Ctrl t That'll bring this up and we're going to open up that image that we upskilled and if I switch to the material viewer there it is pretty good looking image on this right sidebar here you're going to see deep bump right there at the bottom and your all you have to do is make sure you have this image node selected and you're going to hit generate normal map all right after a few seconds we got our normal map it's looking pretty good and with the normal map selected this time we're going to hit generate height map that was very quick as well and this is our height map what I like to do after I've generated my images is open up the UV editing Tab and with the newly generated height map I'm just going to make sure it's selected and go to image save as and save that image and you want to do the same thing for the normal map because if you don't then if you deleted this object those generated height maps and normal maps are going to disappear we're going to tap into edit mode select everything subdivide a few times I like to do it like five or six times and you'll want to add a multi-resolution modifier and you want to hit this simple button but before you do that you want to come up here and enable statistics so that you don't generate too many faces that your computer can't handle and I know that my computer can handle around 4 million we'll stick with 2 million that's plenty and we'll have to open the sculpting tab now in here there's a few settings that we're going to change and that is going to be over on the sidebar here so we're going to open up the tools for the draw brush and we're going to change a couple things and that's going to be the texture we're going to add a new texture and then come down to this checkerboard here and open the height map you don't have to do anything else here that's all good and then you'll come up here to the tool settings and we're going to change the mapping under texture to from tile to stencil and we're going to change the stroke to Anchored and we're going to change the fall off to constant and so if you Mouse over the viewport here you'll see this image and you can right click and drag to move it around and shift right click to scale it and you just want to line it up as best as you can and I've done this probably a hundred times and I've never gotten it completely correct there's always like one line of pixels on one side or the other that doesn't want to be sculpted so another setting that we're going to change is the strength you want to bring it down between 0.12 and 0.2 something like that I find 0.18 to be perfectly fine and you want to scale up the brush and all you have to do is click and drag and there you go you're going to see it pop out of a low resolution and high resolution and if you don't want that to happen all you have to do is hit this checkbox sculpt base mesh and so we have our height map imprinted onto this plane and that was pretty quick and easy and so I'm pretty happy with that right out of the gate um if you have like a an actual face or something you might see uh the height isn't translating very well you can just come over to the tools here and use the grab brush and grab the mesh move it around a little bit and do whatever you need to do in order to make it look the way that you want it to look I'm just going to leave it as it is there we go it's looking pretty good and like I said you'll see like one line of pixels kind of gets stretched on some of the sides because you can't line it up perfectly if anybody knows how to align the stencil perfectly to whatever you're sculpting that'd be great so now that we have our 2D generated image as mesh we're going to edit it a little bit you want to apply the multi-resolution modifier and I like to tap in the edit mode and get rid of these edges this is going to be pretty laggy because there's so many faces I just go ahead and select those and delete them and depending on what you want to do I actually want this to look like a tile so I'm going to go ahead and go around here and select all of the edges and I want the edges to be completely flat so I'll grab them g z and just bring it down slightly and then I will scale it on the z-axis and scale it by zero and that'll make that nice and flat so the nice thing about the tileable image is that you can use an array modifier if you want to extend this out and look at that you can't even tell where the seam is and you can add a second one change a couple settings here do that on the y-axis there you go that's looking pretty good I'm not going to apply those for this demonstration another thing that I like to do is go over here and add a decimate modifier and you can usually reduce this at least by 50 percent with no loss in quality of the geometry and because we're using Unreal Engine you can triangulate it as well so we'll do that and I'm going to bring it down by 0.4 so we'll lose 60 percent of the geometry and you're going to notice that there's really no difference so there we go I can't really tell if there's any quality loss maybe you can if you have a better eyes than I do but that's looking pretty good for me so I'll apply it now that we have our mesh we're gonna come up here to file export and Export it as an fbx and you can export it to wherever you like and for this settings over here you can just limit it to selected objects and only do the mesh here and under geometry you want to change this from normals only to face and you can Chuck trianguly faces we already did that but why not and you can uncheck this big animation and we'll export it now that we exported our fbx we're just going to open up Unreal Engine and import it in there all right now that we're in Unreal Engine we're just going to come down here to import and you're going to navigate to wherever you save that fbx and this options panel is going to open up and right here build nanite you want that check where the other settings are all looking pretty good so you just go ahead and hit import this is an error that you might see pop up this is something that I haven't found the solution to but it doesn't seem to do anything to the mesh so we have our mesh imported but we need a material for it so we're just going to go ahead and right click material Egyptian tile we're gonna go ahead and open that up from the content drawer figure out where that is and shift click drag them in and you can make this a lot more complicated than it is but we're just going to connect the Albedo and the normal and if you hold one and click bring this up and you just plug that into the roughness and you can change that to where whatever you'd like it to be um I'm just going to do like point eight hit apply and save we'll close out of that and we'll drag in our tile it's looking pretty good and we just need to apply that material to it now we have a nanite mesh and there you go there's the triangles from the nanite and that's looking pretty good nice and easy and if you look closely you can see that it's a little Jagged generally you're not going to be this up close to the mesh so just from looking at it from afar it's a lot of detail that you can add to your scene without uh sculpting this entire thing by yourself which I would imagine is going to be pretty daunting another cool thing about this is if you turn on snapping you can just alt click and drag this and tile it that way and so there you have it it was nice and simple didn't require too much fiddling around I don't think there should be the hero of your scene but I do think for something in the background this is going to help you focus more on what is going to be the hero of your scene rather than the background stuff that people will see but not really notice if that makes sense thank you for watching and I will do more of these types of videos in the future I will probably do one on deforming what we generated into like a pillar or maybe a vase something like that and anything else that I find out that's pretty cool so like And subscribe and I'll see you next time thanks
Info
Channel: CGVizzy
Views: 9,766
Rating: undefined out of 5
Keywords:
Id: nq31WW5LZJ0
Channel Id: undefined
Length: 11min 32sec (692 seconds)
Published: Sat May 06 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.