#UE5 Series: 04 Introduction to Lighting Tools in UNREAL Engine [ Part 1 ]

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone rezzy here and welcome to my channel we're going to continue with our unreal engine 5 for beginner series this week we're going to start with basics of lighting in unreal engine we start by making our very own cornell box and talk about errors you may run into when you export an fbx into your unreal engine scene we then talk about lumen why we use lumen and how to use it then we start exploring light types inside unreal engine 5 and all the key attributes you need to know about so you don't spend all the time scrolling through a long list of properties for every single light only then we switch to a much bigger scene and explore some complementary tools such as volume clouds and sky atmosphere remember this is just an introductory video and my intention is to add a lot more to this by using these tools during production from now on and hopefully in the future videos so understanding the basics of lighting in this video is actually quiet important as usual i've added timestamps so you can always go back and repeat a specific section with this out of the way let's get started [Music] now let's spend only a few minutes inside autodesk maya and create our own cornell box and in case if you're wondering what a cornell box is it's a commonly used 3d test model it's basically a box with a skylight and that allows you to test your textures text your materials and shaders texture lights and of course takes your renders um i i'm going to put a link in the description we are going to kind of use that and the reason that i'm not actually starting from the ready to go one inside unreal is because i'm going to use this tiny chapter as an excuse to show you the errors that you may run into even when you create a box so i'm just gonna go into new by the way once this is done i will happily post this cube on my patreon page i'm going to delete one of the faces now you can see that the inside is black and the outside is gray meaning that the direction of the normals are pointing outward it should be the other way around however what you can do is to give this box a thickness and that is going to fix the issue i'm probably going to hide the grid here now i'm going to really quickly go to multi-cut tool i don't want this chapter to be too long it's not about modeling inside of to this maya i'm going to use multi-cut tool to create a cross and then i'm going to select that vertex in the middle shift right click and i'm going to chamfer it i'm going to select the face scale it up a little and press delete now we're ready to extrude shift right click and i'm going to extrude and extrude along z axis and you can see that fixes the normal situation it doesn't matter how thick or thin this model is now this looks good you can even go in there into edges and start sort of tweaking and adding bevels so on and so forth but to be honest with you for a simple scenario like this it's a bit of an overkill i'm gonna go into um these four faces and uh faces on the ceiling and on the side and the back and give this a black lambert so assign new material lambert and i'm going to make this lambert black and i'm going to call this black because my intention is to bring um in shaders into unreal as well would be a good idea to delete by type history makes it a lot easier and now i'm going to go and select all of these guys and i believe i did give this a tiny bevel so i'm going to select all of them and i'm going to select this one and this one shift right click new and i'm going to go to lambert this is going to be a white lambert the color for the white is um usually 80 white so 0.8 for white i don't need any specularity or any uh highlights that's why i'm using lambert as opposed to blin or funk or any other type of material now um as we talked about this we the left wall is going to be red so right click and i'm just going to bring another lambert call this red and i'm going to use one of these presets in the color chip make it red and the other wall is going to be green another lambert green and make this one one of the presets green and we are ready to go what i usually do especially with a cubic model like this i always go to mesh display and i harden the edges at the end of the day once everything is done what i can do is to go into delete by type and history and we are ready to export our model now a bit of a disclaimer when you export this model you will be getting some warnings and i intentionally not going to fix any of these issues right now because we would like to kind of use that as an opportunity to learn something new so with that said i'm just going to select that i'm going to go to file with the object selected export and export selection into and i'm going to go all the way into fbx export and go export selection and one thing i try to fix from the get go is advanced options axis conversion up axis in unreal is z so i don't need to convert this scene when i do that so i'm going to go to desktop and i'm going to call this cornell actually i'm going to go to unreal folder that i have and i'm going to create a new folder i'm going to call this zero for underscore lighting and under that i'm going to create another one fbx and put cornell box in there export selection now let's go to unreal and see how we can import this model i'm going to double click on the unreal engine shortcut and we are going to use games a blank scene and the path is going to be uh this folder that we just created if it's not there you can always right click and create your folder but we already have it so let's select the folder and i'm going to call this lesson4 underscore lighting we want blueprint to stay there we want starter content to be enabled we don't use it but let's have it there and raytracing off and let's create here we are inside unreal engine 5 and now because i enabled starter content i'm getting this but that's no problem at all you can always go in here and start with a brand new level before i do that i would like to create my own folder structure so right click create a new folder zero four and well actually i called it lesson04 underscore lighting again these are the things that we keep repeating every single session of course you all know this by now call this one levels and i'm going to have another one new folder and call this props so we can bring our cornell in there i'm just going to create another one and call this textures you will know why we do have some textures that i would like to bring and that should do the trick i'm going to go and create a new level i want that level to be basic and i'm going to basically open the scene we've got a static mesh we really don't need that i'm going to hide it for now but chances are that i am going to actually delete it i'm going to go to prop and let's bring our cornell box inside fbx and cornell box and open now because i change the up axis to z i don't need to convert the scene and everything else looks okay but if i press import all i'm getting three errors or three warnings rather now it is important to understand why we're getting them and how to fix them because yes we are you know bringing a simple box but sometimes you bring some delicate objects that you really need and you kind of need to know how to address these warnings and how to fix these issues so the first one is about smoothing groups that needs to be enabled when you export anything from maya into unreal engine now the other two talks about tangents and binormals now let me show you what these errors are and how to fix them i'm going to select all the of these guys and press delete on it because i would like to re-import this cornell box and let's switch to maya all right here i am inside this scene now what you need to do and the two errors that we're getting are mainly coming from uvs you can see we have overlapping uvs and this can cause problem there's a very simple solution at least in this one and that is for me to select the model actually i need to know what i'm doing here so select the model go to uv and you can do a planar go one by one and do a pretty neat job but because we do not have any textures i'm just gonna go with a simple good old automatic um so six probably is actually a good number with the model selected i'm just gonna go project and enable the checkerboard making sure that i'm actually getting evenly distributed quads all across yep that's going to fix that now this is going to take care of the tangents and binormal errors the first error smoothing group that i was getting is when you export your model so i'm just gonna go export and go to fbx and when you would like to export it's uh under geometry you need to make sure that smoothing groups is turned on now with all these um warnings addressed you can easily overwrite this model now let's go ahead jump back to unreal engine and see if we can bring our model into the scene with no error this time here i am inside unreal engine i'm gonna go to import cornell open i don't need to convert scene and import and voila it just worked of course it's tiny so i'm just going to select the scale click on this padlock and probably increase that 10 times maybe move it up see if that works it definitely is working i'm going to press e to rotate it ever so slightly press f on it um having a quick look just to make sure that everything is kind of working fine maybe rotate it in 90 degrees yep we are ready to go at any point of time if you would like to edit any of these materials you can just double click on them and we already talked about materials so you kind of need to know how they work so on and so forth so for example if you're getting a little bit of reflectivity in there that's really easy number one on the keyboard left click to create a constant and you apply it to your roughness value and make this roughness set to one and you can press apply and that is going to fix that for you so hopefully with the knowledge that you have you should be able to go back and tweak a few things if need be you can do the same thing in here and what once everything is set up we are ready to start with our lighting so let's go to the next chapter and explore lumen [Music] now our scene is ready let's talk about lumen i've gone ahead from shapes menu i've brought a sphere and a cylinder and used the starter content material tab just to add some materials to our primitive something really really simple so we have basically something to start with what is lumen so until unreal engine 5 for all the um supplemental indirect lighting illumination unreal engine had to rely on screen space global illumination ssgi to pre-compute either all the lighting bounces that was a very expensive and limited process now thanks to lumen everything is a real time so we're not going to rely on costly calculations everything is almost fully dynamic instance and global illumination and reflection system can be calculated real time that's a massive improvement in performance and in accuracy when it comes to gi global illumination and how unreal engine calculates light bounces how to enable lumen how to make sure that lumen is enabled that's actually um enabled by default so you go to edit and you go to project settings you look for rendering or you can just type in lumen and you can see oh with 1m and you can see that global illumination is set to lumen and reflection is set to lumen at any point of time we can go in here and change that to ssgi or to a standalone ray traced a plugin which is used for offline rendering and it's very expensive now with that out of the way let's go ahead and hide all of our lighting setups here and start from scratch start from the very first lights in the scene and explore all the attributes so i'm just going to hide that lighting and everything goes black we go to add light and let's start with a simple point light you can either click on it and you can left mouse drag and drop it in to the scene so instantly you can see that we're dealing with a fall off so if i just alt right mouse button we can see that fall off is our attenuation how much of this world this light is affecting and this falloff or this attenuation attribute is something that is common amongst all the light types we can see the icon here we can reposition it scale it rotate it but because this light works much like a light bulb and in emit light in all directions rotating it is not going to much of a difference now another attribute that all of a sudden we see appears is the mobility we've got static we've got stationary and we've got movable although it's a little bit difficult to explain how they work because we're not in the gameplay and the only time you see the difference in these three is when you play game just to put it very simply static lights as you can see as soon as i switch to static they need to be baked they are the least expensive type of light they give you the best performance basically but they're very much limited because everything will be baked they cannot be changed or they cannot be moved in any way at run time and if you do that um your light will break another problem is because you're baking the light then the the character the object in the gameplay is not going to react to it or the other way around that light is not going to cast shadow on a moving object during gameplay so yes the performance is fantastic but they're very very limiting the other type is stationary where it's semi-dynamic no it doesn't need to be baked every single time but as the name suggests they wish to stay or remain stationary so you cannot move them during gameplay but you have a slight degree of flexibility or freedom over their brightness which is the intensity and the color temperature so they can be changed but they cannot be moved so it really comes down to why you're using this light what role your light is playing is it in the far background is it something that the character is carrying is it going to interact with the character now the most expensive one is movable but at the same time it's the most flexible tight which is a fully dynamic light which is capable of changing all of its properties during runtime so if you know that your light is going to interact with an environment your light is going to interact with a character it's going to bounce and receive a color from the environment and you know from its shadow as well and everything is going to be dynamic and interactive then you need to make sure that your light is set to movable now with this out of the way let's talk about some of these attributes i'm just going to scroll down and get straight into attenuation radius right under light roll out now if you pay attention to this you can see that changes how big of an area this light is going to have an impact on i can just bring this light a little bit closer so you can see it will have an impact on our objects in the scene of course you can change the intensity bring the intensity low or up and the unit cd is called a candela or cd which is a light unit you may want to bring this down a little bit just to lower the intensity or you want to intensify the effect you can see how interactive this looks i can just zoom in a little bit so you guys kind of get to see better i can bring the intensity down or bring it up you can see how interactive and responsive this light is the other one is interactive lighting intensity and again that's where lumen really shines because if i increase that you can see the number of light rays bouncing around and illuminating the scene instantly so you can see no light bounce light bounces no light bounce and indirect illumination kicks in and gives the scene more elimination and that's because of the ray bounces around the scene so that is very very cool um borderline incredible that we see this all real time and it's physically accurate of course we can make a decision uh objects to cast shadows or not uh if this light is going to affect our world or not and source radius actually looks at if i select this sphere and zoom in and if i look at the edges or the core shadow or the shadows that it is casting on the ground you can see that we can actually blur them like so using this attribute but make sure not to go overboard with this because as soon as this sphere goes bigger than our attenuation it creates artifact it will have an impact on our shadow and you can see uh it's now messing up with our shadow so a little bit of source d source radius is going to be quite helpful to get a much useful result now with that out of the way before we get into the second type i would like to bring one node that is going to help us get a much more accurate result and that is post-processing volume now this allows us to basically define the overall look and feel of your scene through a combined selection of properties and features that affects color and tone mapping and lighting and so much more so every time i tweak around with or play around with lights i always have post process volume in the scene just to make sure that what i'm doing is correct now right now this post-processing volume only affects what's inside this volume but there is a an option called infinite extend if i tick that on any change i make in any of these attributes will have an impact on the entire scene because i set the extension to infinite for example if i go to exposure and say all right i want to do exposure manually then i can go in here and say all right i'm just going to set the exposure and that's the exposure for the entire scene and of course that goes hand in hand with the intensity that i have on my light so you kind of need to be mindful of these two nodes at the same time or even more lights if you're having the scene at the same time so what i suggest is every time you start testing lights make sure your post process volume is in there so you can basically keep track of overall look of your scene that out of the way let's go to the second light that we would like to introduce [Music] and the second type of light is spotlight i'm just going to bring in a spotlight and i'm going to hide my point light now just like point light which is a omni type of light you will be getting an attenuation you will also be getting this cone the reason that you're getting this cone because a spotlight emits light from a single point in a cone shape so it's very similar like a flashlight or a torch if i may where you get if i um could showcase the light roll out you get inner cone and outer cone where the inner cone gives you full brightness and as you go from the edge of the inner cone or inner radius to the extent of the outer cone angle that's where the fall off takes place so right now the inner cone doesn't exist i can just extend it or bring it up now you can see we've got the inner cone with inside this inner cone you'll be getting the full brightness and as you move forward from the inner to outer that's where the gradient happens just like other types of light including point light you get static you get stationary and you get movable um a very very useful type of light i can move it in i can change the inner cone and you can see now it's kind of limiting my exposure so it's only brightening certain areas within the same roll out i can go and make use of all of these attributes that we had for example intensity candela set to 8 is one of them and as you can see as i increase that i'm getting more bounce lights coming in but we have indirect lighting intensity that kind of helps us to make the scene even brighter you may say reza can we just move this up uh well as soon as you move this up as if like there is light coming through this skylight uh all of a sudden everything goes dark and it's because yes you guessed it because of the limited attenuation so we had attenuation in point light we have attenuation radius in spotlight all you need to do is just to let this spotlight that all right cover more areas further areas so increase this attenuation radius from thousand let's say to 1500 and all in a sudden that light will reach a further distance in space everything else stays the same you can see that's where it um the resolution kind of drops a little you can select your post processing type in lumen and within here you can see that the global illumination set to lumen and you can look at the final gather quality and increase that to something like 2 to get a much better result so um pretty much everything else in spotlight is what we expect to see i'm going to get rid of this filter here we do have shadows we can soften the shadow of the object so if i kind of zoom in select the light and zoom in you can see that i can go in here and play around with source radius and all of a sudden we get a much softer details shadow details i can make use of temperature so i can go in here and just say i would like to use temperature instead where the cooler color will be achieved through higher value and if you want to get a warmer color you just reduce the temperature and everything gets slightly warmer now one use of this type of light is where you have ies ies is a type of a data file and that defines um how your light looks like you can actually i can cancel this you can actually download ies data files online and attach that to your light to get a slightly different shape let me show you how i'm just going to get rid of this use temperature and i'm going to bring my light inside this cornell box so i'm just going to bring that in so you can see the fall off that i have right now looks like this it's more of a cone shape and the base of it is more like a circle i can bring down the intensity to maybe something like 120 even the default should work a little bit more indirect illumination by the way these numbers can be overridden if you want now i'm just going to attach a ies to this light to show you how the look of the light can change for this particular example i'm going to download my ies from this website it's called ies library you just look at different profiles whatever you would like to pick just to give it a more realistic look you scroll down and you just click on this download ies and you can download the light profile that you have it's a data file so you need to bring it into unreal engine so what i'm going to do i'm going to go to listen for lighting i'm going to go to textures and i'm going to drag and drop my ies in there my light profile gets added now where to add it on this light you need to scroll all the way down and you've got light profile ies texture all i need to do is drag and drop it and done now if i click away you're not going to see much of a difference because you still need to tweak the um inner and outer cones or radius for your light to be able to see things better so i go to my spotlight and i'm just going to start adjusting some of these um inner and outer cone radiuses and of course i'm going to just tweak some of these lights a little bit so i'm just going to frame this really quick move it against the wall so you kind of get to see the profile like so and now if i click away you kind of see uh what sort of profile this gives us if i click on the actual profile of the light um you can see it's actually quite similar i can actually zoom in on this spotlight and just show you that even inside this um light you get a slightly different profile for the physical light which results in a much more interesting fall off for your light so that's another use that i try to kind of benefit from when i work with spotlights just keep that in mind that ies can be applied into any lights we have light profile in point light as well i can just um have a look here you can see you got that there but usually in real life you do have a light profile ies data file assigned to down lights and down lights are mainly spotlights so i thought it would be a nice addition to kind of demonstrate that on this type of light now with that out of the way let's go and explore the next light type i'm going to hide this and go into light and i'm going to bring in a rectangle light now rectangle lights are an interesting ones they emit light into the scene from a rectangle plane so i can go ahead and kind of press e on the keyboard to rotate it and you can see it's pretty much a rectangle i can scroll up just to be a little bit accurate i can rotate it 90 degrees i can select the light and move it up and even i can press f to sort of zoom on it and if i look at it really closely it's a rectangle i'm dealing with i can even select that and just map it to my skylight that i have so i can just go in here and play around with source width and swords height i can make this slightly bigger i can bring this forward you can see how you can kind of close the barn make it open or close it and make sure that you can just bring this down a little to avoid that artifact and we can you can see that you can actually change the length of the barn doors to really get a very very sort of stylish look very kind of different type of looking very indoor-ish looking using area light good thing about area light is because of that barn door it looks like the light is projecting on the ground as opposed to naturally shining and that can be used uh in many ways for example you can project textures on the ground because of the nature of the area light you can use area light as a type of soft light that we use in photography so if you feel like a corner is way too dark in your interior scene best way to add a little bit of illumination is to bring an area light close by close to the dark area and just increase the number of bounces through indirect lighting intensity so i can actually do that and you can see um what an interesting compromise where you have your focus but at the same time the areas that we do not have the barns um you know the exposure is not there they still receive a little bit of bounce like just like any other types of lights we get to have intensity we get to have attenuation of course which is um indicated by that blue circle we get to have effects world cast shadows and all the other type of properties that we've had in other types of lights another very common use for these lights is to attach gobo to it so we've got source texture as i mentioned where you can just attach an image and receive different very interesting looks like this where you may not have trees or the shad or the actual leaves in the background but all you need is a map something like this a black and white map just to fake the details that you have on the ground for example i have this image which is super low resolution but you can see how it fakes the look of the trees you can easily bring that image into your textures and just assign that to your light and you can see instantly we're getting a very different look where the light actually projects the image on the walls so very very useful very handy and that's another reason or another motivation to use rectangular lights as opposed to other types of lights again this option is available on spotlights you can definitely use these gobos on spotlights you can use them on point lights although again because point lights emit light to all directions the omni type of lights you may not get an ideal result because there is no area of focus pretty much 360 degrees around the light is going to be the area of the focus but best is to use ies and source texture on rectangular lights and spotlights the rest is pretty much the same let's go talk about another type of light i'm just going to hide this and let's go to the next type [Music] i'm gonna go to light and let's bring my favorite probably and that is directional light now directional light is where you see uh life because they simulate sunlight i can actually rotate this around and that's where you kind of it looks like you're getting a sunlight coming in just like any other type of light you have source angle to soften shadows you get to change the intensity i'm just going to lower the intensity ever so slightly but that's basically where the magic happens again the scale and the position of this light is irrelevant what is relevant is the angle of the light so you can go in here and basically press e and start switching things around and you can see how beautifully and dynamically the light changes so um that's pretty much it the advantage that we have in directional lights because ninety percent of the time you would like to simulate sunlight using directional light many many times where you're using directional light you actually want to use light shafts with it so that's one advantage that that directional lights have over other types of lights so if i scroll down you can see we've got light shaft and we've got light shaft bloom unfortunately right now they're not going to do any work because this type of light directional light needs to be associated with the sky and the sky dome in order to work now while i have this light in here i'm just going to turn this off and i'm going to introduce another type of light to you i'm going to go to light and this time i'm going to bring a skylight now for exterior scenes skylight is a must skylights are extremely powerful they capture distance part of your level based on the distance that you set and they apply that to your scene as a light so let's say if you're in a sunset environment that sunset casts orange color this object or this node is going to attract all of these color information and scatter it on to your scene injects that color flavor into your scene it's very powerful if you look at the icon you can see that this light is actually capturing all the surrounding and emits this to the scene just a visual cue to memorize the functionality of this light the only thing is this light doesn't do anything by itself well first things first because we don't have anything in the scene even if i bring in this um rectangular light or let's say i'm gonna bring the directional light you can see the sky the environment is peach black so basically what this guy does it brings black color into the scene basically no illumination no information in to the scene so in order for this light to work we need to have more nodes in the scene more information in the scene i think that's our cue to switch to a much bigger scene where we have objects and vegetations and that allows us to see things clearly how the combination of a skylight and a directional light is going to help us to illuminate an outdoor scene and of course to do that we need to add a project to this scene now this will be covered in the next video but let's prepare for it first i am going to just hit save in here so save current level and i am going to launch epic games go to marketplace and in the search bar type in modular neighborhood pack right now dokoyo is kind enough to make this product available for free and i thought it would be a great idea for us to be able to download this amazing pack so we can do our test study on this amazing work so make sure to uh check it out just search for modular neighborhood pack add this to your card at the moment of the time of the recording this product is free so um hopefully it will remain like this so you can basically follow along and do the same once you download it you can add this to any projects i can just click on it right now i'm working on lesson four lighting sessions so i can just add this to my project go to unreal you can see on their content now i have modular neighborhood pack of course you've got you have access to everything to the animation audio blueprints so on and so forth but what i would like to have a look at is all the levels which you can find on their maps and then you have demo map you can double click on it and it asks if you want to save objects that we've brought of course they can stay no problem and it loads the map now let's end this class right here because this video is getting too long and let's go to the next video next session and that allows you to go over these lights that we just talked about and get the hang of them understand them and even play around with other attributes because we just targeted all the key ones and in the next video we are going to bring up this scene and talk about those complementary tools how to add sky how to make use of exponential height fog so on and so forth which some of them work in conjunction with our direct lights and skylights and basically put our knowledge into a real practice cornell box that's great but having those lights on a real environment is a different story so let's go to the next video and explore how we can use the knowledge that we have right now to light an exterior scene thank you very much for watching this tutorial until the end and let's pick up where we left off in the next video
Info
Channel: SARKAMARI
Views: 7,389
Rating: undefined out of 5
Keywords: unreal engine, unreal engine 5, unreal engine 5 tutorial, unreal engine tutorial, unreal engine 5 beginner tutorial, unreal engine lighting tutorial, unreal engine lighting and rendering, unreal engine lighting basics, unreal engine lighting course, unreal engine sky tutorial, unreal engine skydome, unreal engine directional light, unreal engine directional light soft shadows, ue5 tutorial, ue5 lumen, unreal engine ies lights, activar lumen ue 5
Id: Ry0ZmZFMkDI
Channel Id: undefined
Length: 46min 57sec (2817 seconds)
Published: Fri May 20 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.