How to Create Planets in Unreal Engine: Ground to Space Transition UE4 Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

It's funny, I specifically looked for this a few weeks ago and couldn't find anything. Definitely gonna watch it.

πŸ‘οΈŽ︎ 5 πŸ‘€οΈŽ︎ u/L3tum πŸ“…οΈŽ︎ Aug 17 2020 πŸ—«︎ replies

Wait... you.. c-can model in unreal??? That’s a freaking game changer!!!

πŸ‘οΈŽ︎ 2 πŸ‘€οΈŽ︎ u/Lokithebeing πŸ“…οΈŽ︎ Aug 18 2020 πŸ—«︎ replies

Damn. I checked out your other tutorials and they're fantastic! Exactly what I wanted from a landscape tutorial series! Keep up the good work! :)

πŸ‘οΈŽ︎ 1 πŸ‘€οΈŽ︎ u/Schytheron πŸ“…οΈŽ︎ Aug 17 2020 πŸ—«︎ replies

Thank you so much!

πŸ‘οΈŽ︎ 1 πŸ‘€οΈŽ︎ u/rotho98 πŸ“…οΈŽ︎ Aug 18 2020 πŸ—«︎ replies

very good tutorial, been looking for more of these relating to planets

πŸ‘οΈŽ︎ 1 πŸ‘€οΈŽ︎ u/eiao238520 πŸ“…οΈŽ︎ Aug 19 2020 πŸ—«︎ replies
Captions
hello everyone in this tutorial we will create a planet in a real engine just like this and then animate and transition from the planet surface into space and what's really cool about this is if i go into my project we can see that this is all one camera so there are no camera cuts so little guy waving we zoom out and we see our planet so we're going to first start off with creating the planet using unreal's new sky and atmosphere system and then we're going to create the planet surface with the little guy waving and finally we'll create the animated transition using unreal engines sequencer so even if you don't plan on creating planet surfaces or planets i still highly suggest you watch this tutorial since we're going to go over a lot of general useful skills within unreal engine so with all that being said let's jump into it to start off i have opened a completely blank unreal project i call it planet animation but i've already gone ahead and brought in some assets you can download right now link in the description that will help us along in the process so these are pretty simple assets and you need to have them downloaded if you want to follow along or you can always create and use your own i want to create a planet and for the planet i could just use the basic default sphere and while this is fine if reviewing our planet from a really high angle so if we're not going to be on the surface if we're actually on the surface we have an issue and that is because our spear the default sphere is really low poly so here i have open an example of a planet and right now it looks great but if we actually zoom in and go on to the surface we can see that we're getting a weird black line and that's because there's not enough geometry to actually follow the horizon so we get a black line in between the surface and the sky which is not what we want now i could open up blender and create a high poly sphere in there and then import that into unreal but that would just take up a lot of time and let's try to keep our workflow just with unreal so i could use unreal's new modeling tools and to activate the modeling tools you want to go into settings plug-ins then click on built-in and then just search for it modeling and here we have it and i'm going to hit enabled and keep in mind this isn't beta so themes are bound to change hit yes and restart now now that the engine has been restarted if i go into modes we have a new mode called modeling and this will eventually replace the brush editing mode so if i go to modeling i can create a new mesh by going to primitives and let's make this a spear type 2 and give its slices of 256 which will really bring up the geometry and then for pivot location let's change base to centered because i want to be able to rotate my sphere on its center not on the top not on the bottom and now just anywhere in here i could just left click and that will create a new sphere so now if i oh bring this up and if i go into wireframe mode we can see that this has a lot more geometry which is great because now i know it will actually follow the horizon and we won't get that black line also it generated a new static mesh within a folder called underscore generated and there we can see the spear we just made yep that just happened we can now 3d model within unreal engine itself which is crazy so we don't have to go through other programs to create static meshes not only can we model but we can also sculpt on static meshes within unreal which is insane so i'm looking forward to see how the modeling tools will improve in unreal engine 5. okay let's create a new map now so i'm going to right click go to level and i'm going to name this space double click to go inside of it and don't save this map because it's just a default map there's nothing there to save and i just want to point out that the original inspiration for this tutorial is a really good talk by horansis called exploring the depths of the new sky and atmosphere system and it's on unreal engine's youtube channel so go ahead and check that out when you're done to start off let's of course add in a sun and then i want to go to visual effects and add in a sky and atmosphere and we notice there is no change right now and that's because i actually have to go into the sun and tell unreal that i want the sun affecting the sky and atmosphere so under the advanced drop downs i want to select atmospheric fog of sunlight and set that to true now if i go into the atmosphere we can see that it's already simulating by default earth's atmosphere and this is really physically accurate it looks really nice there's just one thing i want to change and that is the ground radius right now the ground radius is set to 6360 kilometers and that's the actual radius of earth itself and we could use this but the math will be pretty tricky when we're trying to fit our sphere into our atmosphere so i found a value of 1000 to make the math a lot easier to work with we could keep this at its original value of 6360 but 1000 will just make our lives a little bit easier now we can finally bring in the spear and scale it that's how it's as large as this atmosphere going on right now and this is going to be pretty crazy so keep in mind that we're working in planetary scale so all our numbers will be really big within the millions and billions so for location i want this to be centered directly in the middle of my atmosphere and actually to better show what we are doing i'm going to go to camera bring this up to eight and bring the camera speed scale up to 128 that's how we are literally going as fast as we can in unreal and i'm gonna zoom out really far so keep zooming out and that is our atmosphere so we want this sphere to be in the middle of our atmosphere so what i will do is set x to zero y to zero and z to negative one hundred billion and now it's in the middle so how i got negative 100 billion is some math so unreal uses centimeters and negative 100 billion centimeters is 1000 kilometers which is again the radius of our atmosphere and that's also why we changed it from 6360 to 1000 because that's how the map rounds out and makes it pretty easy so when we made our mesh and if you kept everything at default our spear should be 50 centimeters in radius so now we want its radius to be 1 000 kilometers so 50 centimeters times 2 million will give us 1 000 kilometers so if we go into scale and if i hit the lock icon that's outscaling on all the accesses i'm just going to paste in 2 million in the hit go and now our spear is correctly nested within our atmosphere and that is pretty much it that is the bulk of creating planets within unreal engine which is crazy only in unreal engine can we get entire planetary atmospheres with just a couple of clicks before we move on let's go set up our post process volume so there's drag in a post process go down and make sure infinite extend unbound is set to true and let's play with exposure so go to exposure and set the compensation to 0.5 the min and max brightness both to one and that said that's how we just get a constant brightness throughout the entire scene just to make it easier and then we want to download some earth textures so i found solar system scope to have the best earth texture so just go through and make sure you download all the 8k textures if you worry about memory you could do 2k but we're going to be pretty close to the surface so i recommend using 8k textures and just import them into your project once you have everything downloaded open up your specular map and uncheck srgb since this is going to be used as a mask so it's save and now let's create our earth texture so go to material let's call this m underscore earth and open it up now i'm going to go drag in all my textures except the clouds we're going to be doing this a little bit different from the quick tutorial in that the clouds will be on a separate mesh so let's begin by just hooking up base color the normal map and with the roughness let's drag off from red go to lerp and make sure this is in the alpha and let's set add this roughness and let's set a to be 1 and b to be 0.5 so that's how the land masses have complete roughness and the waters have half roughness so the waters are just a little bit reflective and hit apply let's drag our material onto earth and it is looking it's looking okay right now if i hold down control and l to rotate my camera around we can see that we have one issue and that is we're not seeing any of the cities and okay well you just saw that really wacky this little red line and green lines right here this is actually the if i zoom real if i go back to my world origin point this is actually this gizmo right here so it's breaking apart because we're so far away from the world origin so don't worry this is just we can see it breaking apart right now that's just how it is because we're working in such large scales but with that being said let's go add in the city lights now i don't just want to drag my color into emissive color because if we actually open up our emissive map we can see that it's not just the city colors we also get a bunch of texturing all over the place and this is exactly what we don't want because then our entire sphere will be illuminated so to just isolate all the really bright spots i can feed this through a simple power node select that and if i right click and go to start preview node we can see this is before it's bluish and start preview note on this one this is after we've literally just isolated the cities and with all that being said let's drag this into missive color and hit apply and this is what the emissive map gives and we can see that we're getting a bunch of nice city lights within the dark areas of our planet but we're also getting some really bright spots even in the light part of our planet and obviously this is physically inaccurate so we want a way to just isolate the emissive map only within the shadow portion of our planet and we could do this by using some wacky vector math so first i'm going to get my light direction by typing sky atmosphere like direction and this is giving me a vector and i want to dot this so do a dot project with my vertex normals and if you don't know what a vertex normal is it's basically actually i think i can show it right now so i'm just gonna go into basic sphere just quickly drag that in and open up where it is and i can click on the normals to actually see the vertex normals so these are literally just the direction that the vertex is pointing in and this also tells us whether or not our sphere is pointing inwards or outwards so if i go back into my material and i dot these two together these should give me a mask of the shadows but i have to inverse this since it's i found that by default it's going in the wrong direction if we do it this way and then i'm gonna go clamp it just in case because it can be a value of over 1 which will give us some weird results and then i will multiply this on top of my emissive map which will get rid of the lights within the bright areas of my planet and hit apply now back in my world i'm going to go delete the spear we brought in real quickly for a demo purpose and we can see that in the shadow areas of our planet we can see our city lights but if we go into the bright area there's a slight fall off until we get really bright and we can barely see those city lights again there's one issue in that we can still see them and that's because the fall off of this transition is not strong enough so we can increase the falloff by going into our material adding in a power node and i found a constant exponent of 20 to be good and then drag this into base and drag this out again into multiply and let's go organize my nodes real quickly to make things look a lot nicer stop previewing this and now if i hit apply okay this is the exact effect i want so in the light areas we don't see any city lights and then when we get to the shadow of our planet we start to see all the nice city lights so now we're getting a really nice sharp transition between the light and the shadow and what is great is that this day night cycle is completely dynamic so if i hold down control l i can rotate the sun around and the emissive map is changing depending on the sun's location which is just crazy how our material is updating in real time based on the direction of our sun beforehand we weren't able to do this you'd probably have to use some crazy blueprints or material parameters to be able to achieve this but since the new sky and atmosphere was added in we can get it automatically within our material using this node let's work on the clouds right now so what i would do is i'm going to select my sphere hit ctrl w to duplicate it and i'm going to increase the size just a little bit so within the scale i'm going to change the second 0 from a 0 to a 1. i'll just increase it a bit and now i want to make a cloud material so m underscore clouds and open it up and drag in my cloud texture so first thing i want to do is i want to change the blend mode from opaque to translucent and then i want to make sure two-sided is checked on that's how we can actually see what's going on from inside the spear so on the surface of the planet and then i'm going to drag from rgb into opacity and let's have the emissive color be pure white back in the world let's drag in our cloud material onto the larger sphere and now we have clouds so it's looking nice in the day areas but when we get to night our clouds are really bright so i want to get rid of the clouds within the shadow areas the night areas of the planet and i could do that by just stealing these nodes we just created right here so ctrl c let's go back in here let's control v these add in a multiply and hook it up like this so now our clouds should not be showing within the night areas and yep that's exactly what's happening so right here we get some nice looking clouds in the day and then as night time slowly approaches those clouds fade away and disappear okay now our clouds are a little bit boring so let's go and animate them just a bit so a slight animation that's what's rotating around my world hold down p left click to add in a painter node and connect it to my uvs also add in a texture coordinate node connect this to coordinates and now i want a way to parameterize speed x and we notice we don't have any inputs for speed x that's because both speed x and speed of y are contained within speed so this is actually a two vector so i can drag from this and go to append vector and now b is speed y a is speed x so for b i'm going to keep that at zero and for a right click convert to parameter call this speed x set it to 0.001 which is a very slight rotation and drag this into a like that and then hit apply okay so now if we go back into our world we will notice that our clouds are slowly moving and it just helps add a little bit more realism but you also notice that we don't see our land right now and that's because from certain angles especially when the sun is at low angle we can't see our land mass so i want to raise the sun up just a bit and now we can see our land masses again and our world is looking really nice right now except for this glitching widget okay let's add in some stars we can do that by going into planet animation and going into sm underscore star sphere and just dragging this out and then i'm gonna go zero this out like that and i'm gonna make this something ridiculously large like 1 0 0 0 0 0 0 and now we have stars in our world and this is a very simple material if i just open it up we can see that i have a simple star texture that i made in substance designer and it is tiling 10 times and i just decreased the brightness a bit so 0.25 since i found it was too bright by default and then i added a sky atmosphere light disc luminance to my color like this and what this does is that it allows me to still have the sun right here so if i didn't do this then our sun would disappear now is on to the fun part and that is actually creating the surface of our planet but before we could do that we have to download some free assets so all these assets are free on the marketplace forever so you can download i'm going to be using landscape backgrounds and i'm also going to be using temperate vegetation optimized grass library so download both of those and you don't have to use this grass library you can also use mega scans but i found the look of this to look really nice okay so i have everything downloaded right now and first before i even make the landscape i want to add in the background meshes because they'll just do a much nicer job at blending in our landscape with the actual surface so to do so i'm going to go into photoreal backgrounds maps go into overview map and i want to copy and paste some of these meshes so i'm going to select all of these right here and select some right here so again you can select multiple while holding down the shift key and hit control c go back into my main map and hit control v so now if i hit f to snap to where they are we can see that they're slightly below the ground i'm just going to lift it up a bit there we go so with all these selected i'm going to go scale all of them up by 12. actually no i'll scale them up by 5 at first like that so i'm going to zoom out they're a lot bigger and then i'm going to only select not the mounted ones but the ones that have e in them these and i'm just gonna move them off to the side a bit right there and then i'm gonna scale these up by 12 just like that and now i'm going to go scatter these mounted meshes all around this area right here and now that i have them all neatly scattered around where the actual landscape is going to be which is that little square area right there i'm going to go bring this back that's how it's closer to the origin point which is around here just like that and then i'll also bring up everything just a little bit up above like this okay we have one glaring issue right now and that is our landscape is literally in the middle of the north pole and i don't know maybe you want a landscape in the middle of the north pole but for me i'm gonna go rotate the earth a bit and find a location that's how the color of that landscape will blend in better with the actual surface of our planet so i'm just going to rotate this down and try to find a nice looking location so like this and where is it okay there it is maybe put in louisiana or we don't have to do in the us i'm actually gonna go rotate this around and let's find another spot so let's make this in the alps like this or near the alps right there so right now our landscape isn't really blending well with the earth there's a very noticeable sharp transition between our mesh and the actual earth mesh and one way we can fix this is to actually go through and add an opacity to this entire landscape area so the further we are away from the middle here the less we'll see the landscape so i have up an example so something like this where you can see that in the middle here we have full opacity and slowly when we go away from the landscape we get less opacity now this is going to get a little bit tricky so first i'm going to build out this function on a small scale and then we're going to apply it to a large planetary scale later so i have a very simple scene right now and i'm gonna go create the function that will be applied to everything once we're done now keep in mind if you're following along you do not have to follow along at this point since i already made the function this is just to explain what exactly is happening so if i go into this function i want to have it be masked i want to be able to use this opacity mask so to do so i want to make sure that under blend mode mask is selected now i'm going to grab this fade text and plug it into opacity mask and hit apply so we are not getting what is expected right now we can see that it's literally just a circle and there's a sharp fall off so we don't see it slowly fading into nothingness just like what we expect from the actual texture we are using right now and that's because by default when you have a material domain of surface unreal functions with basically an on and off switch so it's either the materials being rendered or it's not being rendered there is no in between but we can fake this using the classic temporal dither temporal anti-aliasing so if i plug this in alpha threshold and plug this into result and hit apply and now we're actually getting a nice fade slowly from 100 opacity to no opacity and this is actually faking the fade right now so it still has an on and off switch but if we zoom in real close yeah you probably can't see it but it's actual pixels so it's selectively rendering some pixels and slowly rendering no pixels okay so now that we have this there there's one issue and that is this isn't really independent so if i hold down alt and drag out we get another circle and that's what i don't want i want one circle one fade to affect both static meshes and we could do this by using the absolute world position so basically i'm taking absolute world position i'm grabbing an r and g and i'm multiplying this by a fade size to control the actual size of this circle and i'm going to plug it into uvs hit apply and now we can see that both of these meshes are actually sharing the same circles and if i zoom in here we can see a little bit of glitching that's called z fighting so if i move the messages a bit yeah that's z finding will go away but we can see that they're all sharing the same texture position but that's because it's actually using the world as its texture position now i don't want the spears kind of spawning like this where they're off to the sides i actually want to move the spear that's how it starts from the middle so from the origin point and if i select this mesh right here we can see that it's zeroed out to the origin point so i want the spear to start off at zero zero within the middle and right now by default it's actually starting off from one of the corners of this texture so to actually move the spear down that's how the origin point is at the center of our texture i will use a 0.5 and append that to make a two vector and then add that on top of the multiply and plug that into the uvs so now if i hit apply our texture should be centered okay nice now we actually do see a spear that's starting off at the origin point and even if i move this mesh around we can see that the spear will always start off from the origin point and from the center of our texture last feature i want to add is the ability for our meshes to fade away the farther we are so for far away we won't see those meshes anymore and that'll just be a really good way to blend it in more with the planet that's how we're far away and when we're witnessing the planet we don't see the landscape at all but when we're close up we do see the landscape and we can do that with a distance blend so if we take a distance blend invert it and multiply it with the output of our texture into alpha threshold and basically start offset is where the blend starts and blend rage is how large that range will be hit apply okay now that the material has been compiled up close there is no change but if i go far away they disappear so up close they're here and if i go far away they slowly disappear and that is exactly what we want keep in mind this is one way you could have achieved these features in unreal there's literally a billion different ways you could have achieved the same effect i even discovered a way where we don't have to use a texture but that would have caused just a lot more hassle than it was worth so we left it as texture for now but if you go into the assets you could download right now i've already included all of that in a function called mf underscore landscape fade and if we go into it it's literally the exact same thing we just made except we are using material parameter collection right here and that's so we can control everything universally within here so we don't have to go through each individual instance and change the parameters when we make a change finally now that all that technical stuff is out of the way let's actually add the mf underscore landscape fade to our landscape background meshes and keep in mind this will only work if the middle here is at the world's origin point and we can tell if it's at the world's origin point by dragging in a static mesh and zeroing it out and yeah that looks like it is at the world origin point if it's not make sure you move everything so that's how it is so to actually apply it to the landscape i'm gonna go find where my function is which is and then i'm just gonna select one of the materials open it up and now within this material i'm gonna go drag mf underscore landscape fade plug this into opacity mask and activate that input by changing blend mode to mask and hit apply and we can see the fade is working right now so i'm going to go through the rest of the materials and there we have it we have a nice looking fade going on right now and if we zoom out i don't know if you can see it but it's slowly fades away until it's non-existent when it's all the way up here then if we go back in it fades back in now what i think i'll do right now is just copy around some more mountain ranges just to give it some more variation outwards and a little bit more fade and that's pretty much it so now we have the landscape and it is blending really well right now with the actual earth so keep in mind if you don't like the way it's fading right now if you want to make this fade smaller or larger you can literally change everything by using this material parameter collection and since we made our function using material parameter collection it will affect everything so we don't have to go through each individual material and change it there just saving us a lot of time also i just noticed an issue and that is with the clouds right here if i zoom in we can see that at a certain point we start to intersect with the clouds and this can look really weird so i'm just going to add a very very slight fade to the clouds that's how when i'm close up to the clouds the clouds disappear so we'll just do that with the distance fade again with a multiply like that and i notice for the blend rage with the clouds 1 million is good and at negative 100 000 for the start offset is also good so now if i hit apply we can see that when i go into the clouds they disappear and then when i go back away the clouds reappear so disappear reappear and that's just going to make the transition a lot nicer once we start animating the camera so now that all that is out of the way let's go over the fun stuff and that is creating the landscape and animating our camera with a sequencer okay so now let's add in our landscape i'm going to modes landscape keep everything at default except change sections per component to 2x2 and hit create now i'm going to leave landscape mode and select my landscape and try to bring it in like this and now scale it down just that it's barely fitting that hole like that and try to now i will apply a material to this so under planet animation go to landscape material and then we have a landscape material and if you're wondering how to make this i have an entire tutorial series going over how we can create literally this exact same landscape so go check that out if you don't want to check it out you could just use this landscape but keep in mind for your landscape version these texture slots will be empty so go ahead and fill those in with some good mega scan textures also there is one difference between this material and the one we made in that tutorial series in that i just added one gravel texture just to help blend it in with the actual gravel of our background landscape so i'm gonna go apply that now to my landscape the material instance of that go into foliage paint and let's go add in an auto paste shared assets that's fine and a gravel now before we go in and start sculpting the landscape let's brighten the shadows here by using a skylight so just drag it in and now our shadows look a lot more realistic we can actually see what's happening in there but we just have one issue so the way the skylight works is that it just samples its location and projects that location onto all the meshes and this includes our planet and that just looked gross the entire dark side is right now illuminated and this is completely inaccurate to what a planet would actually look like now if we're talking about a moon let's say orbiting jupiter then this side can actually be illuminated since there's bout slight from jupiter onto the moon but in this case earth is literally just a planet by itself so this entire place should be pitch black now there is a way to fix this but i was only able to find a way by going through c plus plus and we're not going to do that in this tutorial so instead what i would do is animate this skylight property right here so when the camera is far away i will just manually set to zero and when it's on the surface i will set it to one and if you don't know we can animate any object and any properties within the details panel which is really cool we could just keyframe that so i'm just going to fly back in there and i'm also going to add in an exponential height fog so come here exponential and drag it in like that and bring it down because that's way too intense and that is also right now breaking our planet you can see this looks really weird but we will again turn it off when we're zooming out but and turn it on when we're up close like this now it is time to sculpt our landscapes now i could go into landscape mode sculpt and just manually go in here and try to sculpt realistic formations but that's going to be really hard and time-consuming so i included within the downloadable content and alpha brushes so this texture comes with three different texture stamps so if i go change circle to alpha drag this into the texture bring this up not even 8192 let's do 40192 check use clay brush uncheck auto rotate and bring your strength up to 1 all you have to do is left click and we immediately get some nice realistic formations and we can select the different alpha brushes by going on our texture channel and choosing green or blue so i can choose green stamp there blue stamp there so just go through and start stamping randomly to get a nice looking landscape okay so now i think the landscape looks nice again this is some very subtle sculpting i don't want anything too intense since the main focus will be on our character the grass and the actual planet itself not the landscaping done before we move on to foliage let's actually blend this landscape better with a surrounding area with gravel and then we're going to go in and just paint a little bit of foliage and then start animating so i'm going to go back into my landscape mode go to sculpt no paint gravel and then just go in here with a brush and try to have these gravel trails that they scree slowly spill into my actual landscape and yeah i'd say we're done with that part now keep in mind this looks really bad but at the rate the camera will be going it will only be on screen for maybe 15 or 20 frames so it can be bad it just we want to be able to visually see a nice transition when we're up in the sky so let's go add in some foliage right now and i'm gonna go into foolish mode and i already have a little bit of foliage loaded up right here to load up the foliage you want to go into pn underscore grass library go into foliage types grass foliage control a everything and then drag it into this location so i'm just going to select maybe the first 20 or so grasses and activate them by clicking on this little check box i can see everything is activated right now and i don't want that so i'm going to control a select everything unactivate them and hold down shift select the first one go down let's go select this one so this is a good amount and let's go paint some grass but only the areas where i know my camera will see it that's how we can save on memory and space so right here is where i plan on my camera being so i'm gonna go in and just paint in a lot of grass okay yeah just like that this is looking nice i'm also going to paint in a little bit of grass around this area because right now i mean this is obviously just a circle of grass it'd be weird if grass naturally grew like that so we'll go in and change my density from 1 to 0.25 and then just add in some grass around here like this okay everything is looking nice right now and i think we are ready to go through and start animating this with the sequencer so to add a sequencer you want to go into your content browser find an area right click and let's go to animation then level sequencer and let's call this main anim and drag this into my world now we have a little sequencer right there so i'm going to click on open level sequence and we have a timeline this is where we're going to be doing all of our animating so let's go spawn in a camera right now by clicking on this camera icon now we're automatically piloting a new camera that we can adjust like this and i feel like the focal length is a little bit off right now so i'm gonna go in the focal length and play around with it a bit let's make this a wide focal length like yeah 16 and set it like this so this is good right now so to stop piling it i'm going to hit on this arrow icon on the top left so now we can see we have a camera right there and let's go add in an actor or a mannequin that will be waving at us so i've already included a mannequin within my plan animations mannequin character mesh and just dragon sk underscore mannequin and have him turn around like this so let's see if he's actually showing up in our camera and it looks like he is we can also pin this camera to the bottom right hand corner of our viewport by clicking on the small pin preview that's how we can always see this camera no matter what we are doing within our viewport so you just be like that looking at the camera now is the fun part and the bulk of our animation and that is animating our camera starting from the surface then going all the way out into space and yes i know our cloud texture is a bit wonky right now we will fix that in a bit but first let's animate since i know everyone's excited to do that now we're going to animate this using keyframes if you ever use a blender or any other motion graphics software like after effects then you know exactly what a keyframe is if you don't there's really no way to explain it except to show you so with this camera i'm gonna go to frame zero zero if it's on frame zero zero you could just drag it into it like that and hit transform hit this plus icon right here so this will set a keyframe there now i want my camera to wait a bit that's why we can actually give our mannequin time to wave and say goodbye to us so let's if i hit space we can actually play the sequencer and i think right there is enough time so i'm going to hit the plus icon again to add in a new keyframe now we're going to start animating it so these two keyframes are just telling the camera to stay still so if i go all the way over here i can move my camera up actually i can pilot my camera by clicking on the camera icon right next to syn camera actor and i can just move up a bit like that and hit on this plus icon so now when i move the sequencer back you can see it's animated now so if i start from zero zero i can press play my character will wave a bit and then the camera starts to move up and then it's going to shoot up so that's what a keyframe does it basically just tells unreal where an object should be at a certain time and then it interpolates animates in between those two positions now that we have the first part of our camera animation done let's actually move the camera out so i'm gonna hold down control and use my scroll wheel to just make the sequencer smaller and then i'm gonna make it larger by moving this red line out like that and moving my camera cut my clip out like that so now i'm going to hit my camera icon again to make sure that i'm piloting it and let's go all the way out to here so towards the end and let's zoom out so i'm going to make my camera speed 8 again and zoom all the way out like that and i'm going to hit on the transform plus icon again to add in a keyframe so now we can see that we start off like that and we go there so if we press play waves a bit moves up and then it should shoot up just like that and we're gonna animate away the exponential height fog and the skylight okay so right now i think i'm gonna animate the camera to make it a little bit snappier because when it comes to this right here it's a bit too slow and it just speeds up like that so let's make this a little bit faster by moving the keyframes me actually zoom in using control and left mouse button to pan within the sequencer and i can move this down like that just to make it faster so now if i hit play it goes up faster and it shoots up like this so this is looking nice go into the mannequin and if i come up to add track add actor to sequencer if i search for the mannequin bring that in now i can select an animation for this i'm going to go select ue4 mannequin skeleton wave so now i can just position this in a way so now he's waving at us and we shoot up so that was pretty cool and now let's go get rid of this exponential fog that's how we don't get this looking weird thing right here and our skylight so i'm going to come back here go to add track and let's start with a skylight like this we're gonna have to add another track and go to skylight component add another one again and we're gonna go to intensity set that a one to begin with we move forward a bit and right there when the camera starts moving up like that right there let's hit one again and then when it goes up like this let's change this to zero and set a keyframe there so what is happening is that it's one right here and then we can slowly start to see the one decrease and it keeps decreasing until we hit zero so it's like a transition and now if we go all the way out we get the nice darkness again so let's do the exact same thing we just did with the skylight to the exponential height fog so i'm going to track actor class let's find the high fog add it in add another track with it high fog opponent and let's go add in fog density so set this to 0.002 at the beginning and go to the same location as the transition actually a bit more out like right there maybe says 0.02 and then right here we will set this to zero and make another keyframe so now we don't have that issue anymore and it's just a smooth transition so heat waves we start to go up a bit and then we just shoot up and we are in space so now if we go all the way back here at the beginning we hit spacebar to play he waves a bit we slowly start to go up and then we zoom out from the surface all the way into space last thing we need to do is fix the clouds because if we go all the way in there actually right now our clouds are looking really good but sometimes we can get glitches and we can also see the pixels since our cloud is so large and we're only using an ak texture to encompass this entire planet so one way we can fix this if we go content browser go back to where my cloud is in my assets clouds we can tile this over and over again now i don't want to use this one so i'm going to create a new one ctrl w clouds surface go into this one and let's tile this five times to give our clouds more density and let's change the speed from 0.001 to 0.0025 just to decrease the speed just a little bit and then hit apply now i'm going to select the cloud sphere go back into my sequencer add it to the track actor sequencer and right there add sphere 2. add a track add a static mesh component add another track and now we're going to add a material element 0 switcher so we can actually animate what materials we are using so to start off with i want to use the cloud surface so we're starting off with that and we will fix that in a bit and when we look right at the ground we will have it switch from cloud surface so first i'm going to do a keyframe right there to indicate that we are using cloud surface at that moment and then over in the next frame or the next two frames i'm going to switch this over to m underscore clouds and hit a keyframe there so now we're going back to our original cloud so it goes surface clouds and goes back to our original clouds and our surface clouds are moving a little bit too slow so i'm going to go back into them and let's just delete that zero and finally the last step to fixing our clouds is to actually rotate the entire cloud sphere to get rid of this uv stretching at the poles of our sphere so i'm going to zoom out like this and rotate it that's how it's not right above my landscape and also rotate this a bit like this that's how the clouds are going in the direction of the horizon so now if i snap back to the surface and we move up right here we can see that we have some really nice high density clouds and they're moving at a fairly realistic speed then if i go to sequencer move up a bit we can see we get our original clouds they do not look good on the surface but if we zoom out they look great in space so i originally planned on not going over this but i think it's pretty important and that is how to implement this from planet surface into space as a gameplay feature kind of like battlefront 3 or no man's sky so first off i'm going to press play we can see i have a little spaceship that i stole from the unreal engine and content examples and if i press space he goes up pretty fast but then he just dies he gets killed and he's removed from the world outliner so if we actually go into our logs by going to window developer tools output log we can see that there is warning our spaceship's name is outside the world bounds so this tells me that under world settings in world i need to go in advanced options and uncheck enable world bounce check because by default with unreal levels sometimes the object will be destroyed if it goes too far away from the world origin point so now if i press play move up pretty quickly and yeah i can keep on going up and up and up and now we have the problem of the exponential height fog and the skylight still activating so before that we use the animation the sequencer to actually shut down those but that won't really work for gameplay so instead we're actually gonna have to use the blueprint levels so if i go to blueprints i can open up the level blueprint and i already have set up some math right now so first off i'm getting a reference to the player aka the spaceship and i'm getting its location in the z-axis and then i'm getting a reference of our landscape and getting the z-axis location so this will basically just give me how far away our spaceship is from our landscape and if you're confused how to get references to an object within the level blueprint all you have to do is if i could just fly back here click on any object and then with a level blueprint if i left click we can see we create a reference to that object so that's how i got the landscape then i feed this through a distance blend and if you're wondering how i got this i literally just went into unreal's distance blend nodes within the materials and then i transfer that over to blueprint nodes and then i'm going to set the fog max opacity and set the intensity and then i have a lerp that basically just it's essentially like a one minus x so it's inverting everything before i put in there so the farther we are away from our landscape then the less we'll see our fog and our skylight also for values i did negative 100 here so it's going to start fading at negative 100 and negative 100 1 000 for the rest so if i hook this up like this hit compile go back to my role press play now we can see that our fog is still here and our skylight is activated if i fly up everything disappears and now if i could even go into the shadow area of my world yeah this is pretty glitchy because this ship isn't meant to fly this fast but we can see that our skylight isn't ruining our world right here so it's still looking nice and like an actual shadow so that's how we would implement this as a gameplay feature also i need to point out that performance isn't a concern for me right now so i'll just use the event tick but this will actually cost a lot going on right now because this runs on every frame so on every single frame all this map is being activated and all these functions are being called and while it's fine for this case if we're talking about a high performance video game i wouldn't do it this way instead i would set it up with maybe a collision box that would activate all of this logic so just for now just for test purposes i think event tick is fine if you're not caring about performance and that concludes this tutorial so in this tutorial we literally made a planet and then we put a surface on that planet and if i press the space bar we can see there is a transition between the two so i highly encourage you to not just make earth since quite frankly earth can be a little boring actually create your own fictional sci-fi or fantasy worlds because with unreal the possibilities are endless also make sure you share your creations with the community down below by exporting this animation you can do that real quickly by clicking on the export button right here and choosing a location and maybe changing your resolution to 1080 or even higher now with all that being said i hope you enjoyed this tutorial make sure you like and subscribe and also check out my other videos so i would say all i have to say now is goodbye you
Info
Channel: Unreal Sensei
Views: 147,800
Rating: 4.9173617 out of 5
Keywords: ue4 tutorial, planet, unreal engine, ue4, unreal engine 4, earth, sky & atmosphere, sky, animation, atmosphere, tutorial
Id: otOPdOHWqWY
Channel Id: undefined
Length: 55min 35sec (3335 seconds)
Published: Sun Aug 16 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.