Beginner Lighting for Games in Unreal Engine 5

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome to Unreal Engine 5 Basics tutorial on setting up lights in this video we'll explore the fundamentals of lightning in real Engine 5 and learn how to create stunning visual effects to enhance your project lightting plays a crucial role in creating immersive and realistic game environments and mastering the basics of lightning will give you this extra polishing that your game need we're going to cover all the basics of lighning and in the end of this video I'm going to show you how I lit up this Star Wars scene so let's get started if you watch my previous video you already know that my channel is demonetized so I've decided to switch to patreon becoming a patreon member you'll support me and this channel to keep evolving to keep creating more and more interesting videos besides that you'll have access to all the files that I've created from the start of my YouTube channel so right now you can download the water Shader you can download the auto material from my previous video if you didn't watch it go and watch watch it and you can have access to more in-depth videos about how the things work like the auto material the water Shader in few more videos and also you will have access to a BP Discord server only dedicated to my patreon members where I am active most of the time so if you want to support the growth of this Channel and if you want to see more and more videos like this go to my patreon page and roll now and also you will have access to everything that I'm creating thanks everyone so the first steps that we need to take is we need to set up our project to use Lumen how to do that go to edit project settings scroll all the way down here in the engine section and click on rendering after you click on rendering here you can find all the settings for each light situation for example here are the settings for the mobile so if you are developing a mobile game here you can find the mobile shading this is the forward shading this is the first shading however we need to scroll all the way down and here for the dynamic Global illumination method we need you need to select Lumen so when you create a new Fresh project using Unreal Engine 5 Lumen will be selected by default but if you are migrating your project from Unreal Engine 4 to Unreal Engine 5 this won't be selected as default so you need to go here under Global illumination and select Lumen the next one is the reflection method you should also select the Lumen if you have a video card which is from the RTX series that means that your video card is supporting hard Ware rate tracing so if you have an RTX card just click here on use Hardware rate tracing when available so it will use the hardware RTX to create more detailed shadows and Reflections then for the ray light mode you need to select surface cache and the final settings is you can enable the rate race shadows as rate race shadows will give you extra detail and softness in your shadows after we set up all those settings we need to restart our Unreal Engine and start with lightning Basics all right before we we Deep dive into each lighning I want to dedicate this part for the settings that you need in order for you to have this good lighning and I'm going to explain few of the basic settings of the light so the first thing that you need to do is you need to add a post process to your scene so go over here add a post process drag it onto your level and few settings that you need to set up here the first one is you need to search for infinite bound so infinite and this one infinite extent Unbound you need to check it then we're going to search for exposure and in this exposure we need to set up the Min EV 100 and the max EV 100 to one we are setting those to Once because we want to have an even lightning across our complete scene without any burn effects turn the first one check the second one and set up one one all right so those are the basic settings that you need to setup for your pause process in order to have this nice realistic lightning all across your scene The Next Step let's start creating our first light and let me explain you the basic settings of it so go over here click on light and let's create a point light so in this point light let me explain the basic settings the first one is the intensity from here you can set up the intensity of the light right now is8 but if you tweak it up all the way up you can see that your light is getting stronger and stronger from here you have different intensity units you can use candess you can use unitless you can use lumus or E depend on your preferences you can set up different intensity units so let's work with lumens right now the next step is the light col from here you can select different type of color to your light and after you are satisfied it with your C click okay next one is attenuation radius from here you can set up how far the light will affect your scene keep in mind that bigger attenuation radius will cause more performance into your scene then we go to the source radius this is the radius of the light of the emitter of the light so when you bump up the source radius you can see that all this yellow sphere we are start to emitting in the radius of the sphere you have bigger Source radius you have bigger higher intensity for emitting and by increasing the source radius you can see that we are killing here the Shadows because we are emitting too much light in the shadow those are not compensating from here then the next one is our soft Source radius you can see here on the floor refraction so if we want to have a softer radius we can increase it from here and you can see by increasing our radius we're softening the emitting of the light through our scene right now it's pretty much focused over here in this area and if we bump it up you can see that we are washing it away and also you can see it on the cube here this cube is reflecting from our light here we have very sharp soft Source radius which is zero but if we start tunning it up we are just softing it out so if you want to have a little bit softness in your radius of the light this is the settings that you want to do the next one is the source length what you can do by increasing the source radius you can create different cone shape forms right now we are creating this kind of source length what else you can do you can turn it all the way around like that and as you can see we have this kind of roof lamp and in offices that you can simulate and by creasing it and decreasing it I'm just changing the shape of the source L all right the next parameter for our light is use temperature you can also use temperature and not C here you can increase it to have cool white or go all the way down to have this warm light so if you want not to use col just make it white over here and start working with the temperature itself the next setting is to cast a shadow if you don't wants to cast those Shadows just Stir It Off and no shadows will be represented in your scene so for example if you want to fill a little bit an object with just a little C of light you can turn off the Shadows if you don't want to use the shadows in this particular light the next one is the indirect light intensity let me show you what this does if I move the shadow over here and a little bit like that so if I start boosting the indirect light intensity the indirect spots this one and and those sides of the cube that are not directly lit up by this point light will start to have a little bit more light information in them so let me start tuning up and you can see how we are increasing the light information there so all the spots that are not directly influenced by the light you can use this indirect light information the next one is the volumetric scattering intensity this scattering intensity works with fog so later on I'm going to show you when we start using using ful now if we scroll all the way down here in the rendering settings you can say is this light visible or invisible so you can turn it on and off through this parameter in your scene for example through a blueprint if you want to lit up a room or something you can enable the visibility and disable the visibility and the other things that I want to show you is the advanced panel so if I open the advanced panel over here we have additional light parameters that we can tweak up I'm going to show you the most important that use the first one is the specular scale for example if we are arranging some lights in our scene and if this light is using a lot of specularity in our scene for example this Cube has the specular amount of 100 so it reflects 100% And here on the floor you see this specularity in our tiles and if you don't want this SLS to affect the specularity of your object you can go here in the specular scale and start tweaking it all the way down so right now we have less specularity in our object that are reflecting and if you want to disable it you can disable it completely by setting up to zero so if you want this additional parameter to control only for this white for example if we have different lights and I want this light to affect like 04 and I want this light don't affect you can set it up like this all right so this is pretty nice parameter to set up and the final settings that I want to show you is pretty important and it is the liting channels so in the liting channels right now this light is affecting Channel Zero if I start affecting channel one and disable it all my objects here are on Channel Zero so nothing is affected by our light okay so if I want this Cube to be affected only by this light I'm going to scroll all the way down and select channel one in here here as you can see only this cube is affected by our light and right now the other surfaces is bouncing and getting Global illumination information from this one but if I start moving you can see that only this cube is affected by our light so if you want to have this specific case where you want to affect different objects only by this light you can set it up by choosing the channel for the light and the channel for the object over here in the lighting channels so by setting up those you can connect this light to this object only affected this Cube so those are the basics that I want to show you here before we Deep dive into each light type and go further but before we continue with this video let me introduce you today's sponsor of this video which is atlook atlook is a breakthrough plugin for Unreal Engine that helps artists produce hyper realistic 3D showcase renders with ease Outlook in its core is a digital twin photo studio containing highly realistic lightning assets camera animation perets and a streamline oneclick render interface it is the perfect Gateway solution for 3D artist looking to leverage unreal's rate racing power without getting bugged down by technical details for example when you create lightning setup in Maya Max or blender it takes a lot of time to set it up here with Outlook plugin for Unreal Engine 5 it happens in just under 90 seconds so let me show you how easy it is to set up a quick rendering scene now I'm going to show you how quickly you can set up a scene to render your 3D mesh go to outlooks I'm going to use an AI randomizer I'm going to click few times on it and let's say I like this setup then I'm going to go to my outliner I'm going to delete this 3D element and I have downloaded a Roman statue from quick so Mega scans I'm going to move it in the center of my turntable I'm going to rotate at 90° so it can face up the camera then I'm going to select to be movable so it can rotate with the turntable I'm going to move it under the outlooks platform so it can be a child of it I'm going to select the outlooks platform I'm going to choose turntable the duration will be 6 seconds and I want it to rotate on 360° so my setup is ready but I also want to add a little light on the right side so I'm going to go to my lightning I'm going to select a solt boox 30 by 120 and I'm just going to move it a little bit like that because I want to feel a little bit from the side of my statue all right so the next step is to set up my camera right now I'm just focusing on the middle of the statue I'm just going to push it a little bit back and right now my camera Target is outlooks Target 2 so I'm going to go to my outliner select the Target and move it a little bit down but right now I cannot see how the camera is viewing so I'm just going to pin it over here select the Target and start moving it all the way like that okay so I'm just going to select the again my camera move it a little bit back and this is the angle that I want to shoot from then I'm going to jump to the render settings then I'm going to select real I'm not going to render in production because it's going to take too much time I'm going to choose sequence for the frames I'm going to select 300 because you have 60 frames per second and the rotation is 5 seconds so I'm going to multiply 5 by 60 I'm choosing my output pad the resolution is 1080p the quality is ultra I've enabled the path racing and I'm going to render straight to Mo I'm going to turn on the noiser and then what I need to do is just click shoot and it will start rendering my frames this is the final render and the quality is super good so let me show you how you can use outlooks the first step that you need to take after installing outlooks is go to edit plugins and enable the outlooks plugin so search for outlooks and enable the plugin from this check mark then you need to restart your Unreal Engine 5 after you restart your in real Engine 5 you have a new button over here which is the open outlooks interface or you can access it over here from the dropdown and selecting outlooks there is also a shortcut which is shift+ 9 after you open the outlooks interface you need to loging with your credentials and you have four tabs the first tab is Studio the second tab is about lightning the third tab is about sequence and the four tab is about rendering so let's take a look at each tab in the studio tab you can find different already madeup presets so the first one is photo studio so if you just click on it outworks will automatically create a photo studio for you and just by clicking one button the photo studio is created you have your lights over here as a setup you also have your camera over here setup and a placeholder for the object that you want to shoot then you have a light box you have a turntable which is a 36 Dee of an object already set up for you you have a reveal animation you have Glide you have mist and so so on here at the Glide object you have rails over here on which the camera will be moving so if you want to create a movement of the camera you can create different type of rails you can place them onto your scene for example if I select this curve I can move it a little bit down so my camera will follow the rails from the start point to the end point and make an animation sequence out of it you also have a ready to use setup for character shooting and it is called meta portrait so here you can place up your meta character and just shoot it from close up and get this nice and crispy details and the final interesting preset is you have an AI random generator which will generate different kind of light setup for your scene so if you don't have an idea for exact lightning setup the AI will help you out so when you click once on this it will start to set up a different kind of scene so if this one is not on my taste I will just simply click one more time and the AI will generate a new scene so let me show you you have this scene I don't like it click again the AI will keep generating different and different kind of scenes every time you click it keep clicking the AI button until you have something that you like and then you can tweak it up on the go also you have the ability to create your own presets name them and save them up here on the top you can find assets the first asset is just a simple setup of a studio then you have a Cycle Rama you have a dome you have a room you have ceiling rail system and you have a rotating platform let me show you pretty quickly how the scene is set up so right now we have three different type of lights let me select this light and this is our outlooks soft box over here from the drop down you can select different light types right now I have this 50x 70 soloft box but if I want 30X 120 I can just select this one and the light will just change itself to the new lights type you can select Rink White Spotlight light wind Etc so if I select Spotlight for example it will create this Spotlight for me if I want a rink light I'm just going to select it and I'm going to have ring light so you can tweak up your lights from over here you can change different light types so from here you control the intensity of the light also the Light can be controlled by using the temp temperature so you can make it warm or you can make it cooler The Tint itself is working for the color of the light so I can change the color to green from this one you can choose also a support right now it's automatic which is a tripod for me but you can choose scissors or nonone so if I choose scissors it will start connecting to my railing system and if I start moving you can see that in real time it is updating onto my railing system you can also choose to hide the mesh if this lamp for example is behind our object that we are going to render you can click over here mesh hidden in render so this will hide the lamp in the render but still it will give this lightning that you need on on the back of your surface and the final thing that is super important is the actor to track this is defining which actor this light will track so if I start moving my light you can see that right now it is focused on this object and where I move my light it doesn't matter because it will always focus on the object and it will always lit up my object over here but if I select this eye dropper and select my camera right now my light will face the camera over here and if I move my light you can see that the light is just leading up my camera so from the eye dropper you can Define Which object this light should be focusing on also you can use the drop down to select the object that you want to focus on you can pretty much do the same for the camera right now the camera is targeting our object over here and if we start moving the camera will keep focusing on this object but you can change the focus again from the eye dropper and I'm picking right now the light and my camera will focus Only onto my light and here in the lighting typ you have few settings first you have a lightning presets just like the studio presets but those presets are working only for the light so if I click on good side it will automatically add my lightning over here if you want to have a force you'll have this light and you can start working with it and from here you can add different type of Lights from the assets here is overhead light blank you can just drag and drop it here it is again facing the object that we want so you can lay it up from here you can add a soft box you can have a different soft box you can have 30 by 120 you can add an area light if you want so and everything is facing our object over here and the final one is a target which is just a helper to Target on so if I select my light over here and from the eye dropper I select this Target right now my light will face this Target and I can start moving this targets and not the object and fix a point on my object that I want to Target this is helpful for for the light this is also helpful for your camera you can easily switch by rate Trace Lumen and Pa tracing just click on rate tracing and right now I'm working with rate tracing if I click on Lumen I will enable Lumen right now and my light will work with Lumen and if you want to enable the path racer just click here on the path racer and it will start working with the path racer it is simple and easy as that and right now my path racer is working and rendering the scene in the sequence typ you have different type of cameras so right now in this scene we have DSLR but you can add 360 camera you can add again a Target you can add a ring rail from here you can select different ring rail presets just select your camera and start clicking on the ring rail presets and this preset will automatically add it to your camera so if you want a semicircular you can add it over here if you want a full circle maybe a roller coaster here you have additional settings for the real system and then we go all the way down to the level sequencer how this works work is let's create a new sequence we want the total frames of movement of this camera to be 180 we want to shoot in 60 FPS then you have the rail interpolation how do you want the movement to be you want to break it you want to have a linear movement constant or Smart Auto Select your type of interpolation then click on prepare level sequence after you click it your level sequencer is ready and then you can click play and see your animation created just with one click so let's hit play and you can see the movement of my camera and the final tab is your rendering tab here in the rendering tab you can select quick render real or production so if you are just testing your shot you can use Quick and just render it out pretty quickly to see how it looks but for your final rendering you can use the production also if you want to shoot just a single frame just select a single shoot and not a sequencer so it will render out one frame but if you want to create a video clip use sequencer and Define your total aoto frames of the animation from the drop down over here you can select different resolutions you can use all the way up to 8K or you can use a custom resolution if you need a specific different resolution here we have different presets for the quality medium high Ultra or apex apex is the highest quality but it will take significant time to render depending on your machine you can also enable the path tracing rendering you can choose between file formats you can export in PNG jpeg exr or straight into moth you can use the noiser motion Bo also one additional thing that is pretty good is you can warm up the engine this is pretty useful for particles so if you added few particles over here inside your scene and if you want to warm them up here you can Define how many frames it will warm up before start shooting your scene also you have ability to have a custom batch events or batch options you can learn more about the plug-in at outlook. Ai and here you can get more information about how this plug-in is working you can see the samples the the pluging is great for industrial design architecture 3D gaming fashion automotive and everything that you can imagine so if you want to grab a license click on get a license and right now outlooks is on sale so you can grab it by paying monthly 1475 or you can get onee license for 280 bucks so let's continue on with our video let's continue on by reviewing each light and show you how they works the first light that I want to talk about is the directional light and as you can see here in my scene I already have my postprocess volume I've set up the infinite bound and the exposure so how to create your directional light go over here go to light and choose directional light and the directional light is pretty self-explanatory this is acting like a sun and it have this little Sun icon so right now our directional light is shining through our right over here and it's getting to an angle maybe around 60° over here and you can see see here we have this nice Shadows if I start rotating it we can create different shadows and this is working like a day and night cycle so if we go all the way up like that we're going into night and then if we go all the way like that we have Sunrise we have midday and we are doing this cycle all over again and here in the reflection you can see how it is representing like the sun over here so the directional light is working like that this is your base lightning if you are creating an open world you need to have this kind of sun in your open world and if you are creating an indoor scene when you need to have a little bit lighting to a window for example with some God Ray you can use this or you can fake it with other type of lighting that we are going to cover but for outdoor scenes use this directional light and for indoor scenes where you have a lot of Windows for example you can use also this directional light but for closed indoor scenes I recommend using and arranging different type of lightning and one more thing that I want to share with you is here you have three different options you have static stationary and movable movable is Real Time Light so it can be moved around in real time in your game and if you use the static and stationary the static is lighting that needs to be baked and this is common might use for games so you can bake different lightning into your mesh to have better performance and right now you have this message that you need to rebuild and bake your lightning so in general directional light is used as a sunlight and of course you can use the C you can use the temperature let's make it a little bit warm over here another useful thing for the directional light is when you use fog you can turn on the light shaft occlusion and light shaft Bloom I'm going to show this a little bit later but those settings I used to mimic and create God Rays for example from Windows or through the branches of this tree here is a little example how it will look and I'm going to show you a little bit later how you can set it up but basically this is the idea to create gold Rays through different meshes and this is pretty much about the directional light so let's move to the next one the next one that we are going to cover is our Point light so go here go to lights and create a point light and this is simply like a light bul as the icon itself says and it spreads light over here and I've already showed you few of the settings and the most used cases for this point light is when you have some static objects like a light on your street like a light bulb maybe uh some fire torch Etc and it emits light in radius and you can tweak the settings from the intensity from the light cover you can use temperature to create different kind of mood and tweak all the settings that I've already showed you previously this is one of my favorite lights to use across my games moving further is our Spotlight so I'm going to delete our Point light and I'm going to create a spotlight and this is simply like a projector as you can see it is creating a light Based On A Cone and this is super handy for that type of lightning when you want to create some projector lightning or let's say a car headlights here for example if we have a car and we can set up two headlights over here and this is how you can set up your car headlights you can set up the rotation so it can emit light further also there are a few settings that you can tweak here in the spotlight let me just boost up a little bit the intensity and here you have the inner cone from which it start emitting and from here you can create this hard Edge over here or you can soften it out if your inner cone is less than your outer cone it will have this soft transition between the inner and the outer but if you want to have this pretty hard Shadow over here just have the same values for the inner and for the outer and you're going to have this pretty nice and very strong and sharp Shadow if you need that for your game and just by tweaking out the outer corner it will automatically tweak out the inner corner and you can set up here a light that you can see in the stage shows for example if my tree and my table over here are the center uh or you're creating H let's say a comic over here which is telling a jokes Etc this is how you can do it by setting up the inner and the outer corner at the same radius and if you want to have again the soft Shadows over here just twak up the inner corner and the outer Corner let's move to the next one which is the wck light so let's go here and create our W light so the light is like a light in a photo studio that you can create it creates this pretty much very soft Shadows let me boost up a little bit the intensity so you can see it creates those soft Shadows that you can use this is also one of my favorite lights with the point light with those Rec lights you can create different kind of lightning across you're seeing you can create interior lightning or you can set up a photography studio based on this lightning let's say if this is something like a soft box you can create two or three of those also you can control the source width and height let me show you how this works if we start controlling the width you can see also the shadow how they're starting to soften out a little more and here in the reflection you can see the representation of this recck light and it looks like a rectangle soft box and you can do it like that and you can L up from above for example let me just move it like that and you can see pretty soft Shadows it is a little bit different than the point light the point light is making more hard Shadows also you can tck up the length over here so if I twick up this this will decrease the length I can increase the length over here can decrease this so you can create this kind of uh which is concentrated in just this rectangle let's say we have an interior lightning and we just need to L up something like this or you want to make some dramatic scenes you can use this the Barone angle and the Barone length in order for you to create this kind of lightning over here all right so Rec light is also very useful for games and you can also control all the parameters the temperature The Source width the radius over here and the intensity and there is one more which is a skylight but I'm going to cover this later on in this video when we recreate and lit up our scene and there is one more light that I can show you you need to go to edit plugins and search for HDR and enable this HDR plugin and reset your Unreal Engine after you restart your Unreal Engine let's create this HDR so go over here lights HDR backdrop and when you create it you can see here you have an HDR Dome so if I zoom out you can see here our HD Dome is ready and if I zoom over here you can see that our objects are black and this is because our HDR is too big compared to our level so I will select the HDR backdrop and I'm going to put the scale of 05 and as you can see when I scale it up I have this pretty nice lightning and this is very common to use HDR in your games let me show in our current game that we are developing in unity how I set up the HDR for mobile so here in this simple level this is for a mobile game I've set up the HDR over here the dome which normals are facing inside and this HDR is contributing to my lighting over here which the lighting is baked and also this HDR is captured and is working for my reflections over here so HDR is pretty important to use in mobile games and in any PC games this HDR is set up manually in unity in order to have pretty good optimization but here in un real engine you can have it out of the box or you can also simply create it by using a sphere in any 3D program like blender Maya or Max set it up into your scene reverse the normals to face inside your scene and then use this HDR as a f for your scene for the sky and for the Horizon and use this HDR also to have Reflections as you can already see over here we have good Reflections through our surface over here through the HDR so HDR is pretty important for game development and those are the two ways that you can create the HDR using the default HDR over here by creating a cube map or setting up a custom like I did here through a 3D application in your game engine you can set up the size from here not from the scale let's say let's set up a size of 50 of 30 oh so you can set up the intensity you can boost it up all the way to three to one this is working like a field light in your scene and combining the HDR with a directional light for getting the shadows will work pretty fine for your game now the next one that I want to show you is how you can create an emissive lightning and this is pretty common also in games to create an object that emits lights so let me just duplicate this Cube I'm just duplicating it and let me create an emissive material so I'm going to right click go to the material section click on material I'm going to name it Cube emissive going to double click and I'm going to set up for the base col I'm going to set up something like let's say bluish and the other thing is here emissive C I'm going to duplicate this one and I'm going to create a parameter so I'm holding one on my keyboard and then I'm going to multiply and I'm going to multiply the C by the parameter and I'm going to put it into the emissive color I'm going to save and for my specular I'm going to put zero because I don't want to have specular I'm going to save again and right now I'm going to apply this to my Cube and right now my cube is not emitting anything but if I start tweaking up this value all the way to one we can start that our cube right now starts to emit lightning and if I move it over here you can see that we have a little little blue over here emitted from this Cube and if you want this to be a parameter outside of your material right click convert to parameter and let's say the slider Max up to 10 slider mean zero let's say the group priority emission and set the priority of zero then save this close it rename this as mm for my master material going to right click create material instance and I'm going to name it Mi for material instance Cube emissive all right so this is an instance from the master material now I'm going to apply it all here going to double click and we have this emission slider that we can tweak and we can tweak it in run time we don't need to go back to this master material change of value save Etc so this is how you can do it and this emissive material is emitting lightning even if you don't have any lights in your scene let's say this is not visible so let's make it invisible and this is the only object that emits lights over here and this is something pretty cool if you want to make different kind of emissive materials maybe a little LCD display that emits a little bit of light Etc you can change it over here and if you want to change also the c as a parameter go to your master material select your C here right click convert to parameter emissive color and just put it under the group emission set priority of one click save then go back to your material instance click on the emissive cover and you can start tweaking up your cover in real time so this is pretty handy to set up your parameters outside from your master material and tweak them in real time in your material instance this is something that you should always do because it saves a lot of time let's say a little bit of orange so this is how the emissive material works and finally if you want to create different type of Shadows right now we have this soft Shadow as I've showed you before you can tweak up the source radius over here and the source radius will tell how the shadow will act so the smaller the source radius the harder the shadow will be the higher the source radius the softer the shadow will be is something that you should know from The Source radius you can twick up the shadow hardness and softness for each light another thing that I want to show you is right now the Shadows itself here are pretty smooth look pretty great and this is because I'm using the rate tracing on the Shadows okay and here from Advanced cast rate Trace Shadows if I disable it you're going to have different a little bit different shadows they're not looking too ugly but if you Ena the r tracing your shadows will look look a lot more realistic all right so this is something that I want to point out that the rate Trace Shadows are way way better than the Shadows casted without rate racing so the next topic that I want to touch is how you can use bake lightning and bake lightning is pretty commonly used in game development because it saves a lot of performance for example if you use all across your game just real time lightning it will cost you a lot of performance so mixing bake lightning with realtime lightning it will work just perfect for your game so right now I have this wck light which is stationary and I want to show you how first you can create a static bake lightning and what are the requirements for it the static based lightning is pretty commonly used in mobile games if you don't want to have any real time lightning or maybe just one realtime lightning and everything else could be static and I'm just going to hide my tree over here and I'm just going to focus on this one so we have a soft Shadow and we have this night drawer and right now what this drawer has is UV channels just for the textures so what you need to do is you need to go to your 3D model double click on it and right here in the UV you can see that we have UV Channel Zero so UV Channel Zero is getting the information for the texturing for the texturing part of this 3D object and we need one additional Channel where we can bake the lightning so what you need to do is here in the search search for light and here under generate light map UVS check this save it and when you save it you will see that you have UV channel one this UV channel one is generated automatically by an real engine and in the UV channel one you'll have inside bake the light map keep in mind that you must not have overlapping UVS because if you have overlapping UVS the light map won't work because this for example this UV if it's overlapping with this one they will get the same light information and it will be not accurate so the first step is to prepare your 3D model to have this UV channel for light mapping the static bake lightning is the best performing bake lightning that you can have and it is quite useful for mobile gaming so it has the fully bake lightning and the fastest rendering so let me switch to static over here and right now nothing is happening we still have our lightning Dynamic so it is still in real time so what we need to do is go to build and click build lightning only now the lightning will start to build and once it's finished it will say that my Forest which is my tree doesn't have the wrapping UVS so as I told you you need a second UV Channel but right now nothing is working and this is because in Unreal Engine 5 by default you are using Lumen and right now I'm using unre engine 5.3 if you are watching this somewhere in the future it might not be the same case for you but right now woman is not working with bake lightning so what you need to do is you need to open your project settings go all the way down to rendering and you need to disable Lumin for your Dynamic Global illumination so I'm going to click none and I'm going to click none for the reflection mode okay so this is the bake lightning over here and it is pretty ugly right now now I will show you how you can tweak up and get a good shadows and lightning the trick is as follows you go here in the light and type light and here you need to check for light map density and here if your object is in green it means that this object is getting enough texturing detail for the light map and the scale of the light map texture is perfect how you can tweak this let me select this object and let me search for light and here in the override light map resolution right now is 64 let me bump it all the way to 520 and if I deselect you can see that it's red it says too much resolution for this object twak it down all right 128 that's pretty good but it's going to yellowish so 64 is perfect resolution for this one see our ground over here is blue so it says that this is not enough resolution again on the light I'm just going to boost up my resolution to 56 still not good 1024 this is the perfect resolution and now I'm just going back to the lid and I'm going to rebake my lightning once your lightning is rebaked you can see now that we have more resolution onto the ground and we have this soft lightning over here of course it doesn't look perfect and you need to twe all the parameters here in the lightning in the shadow settings so this is how you can achieve this lightning and I'm going to show you a real example in a production game how I use this light mapping I'm just going to tell you the theory behind it so this is a level that I've created for our game Counterattack and as you can see here the Shadows are looking pretty good and how I done that I've select this piece so the ground itself and I set up the scale in light map to B3 it is the same as setting up this here the override light map resolution and the idea behind setting the scale of light map to be bigger let me just open the light map you can see that over here we have this piece of light map this sheet is for the entire map and the idea is that our character when you walk with your first person character you can see these Shadows pretty often and how I compensate so I increase the shadow resolution on my floor because I want to have this nice shadow Shadows casted from the buildings and I compensate the resolution from the roofs so if I select those roofs you can see that in the roofs my scale in light map is 0.2 so it is a balance between getting out the resolution from your roof because when you're in fps game you won't see too much often here the roofs itself but the very important thing is to have details on your ground so giving one object less resolution that won't that visible and it won't matter too much to the game and giving this resolution to things that are very important is the key of balancing this light map resolution and especially when you're making a mobile game this is crucial in order for you to have good performance W draw calls and the scene itself to look pretty good so it is the same in unreal if you're developing a mobile game you need to set up per object how much resolution the baked light map should give to that object for example if I want this object to have less resolution I'm just going to give it 32 and I'm going to compromise from resolution on this object and I'm going to give a lot more resolution to the ground object so this is the basics of the baking how you can use this baking tool in order for you to save a lot of performance if you're developing a game for low-end devices mobile devices or maybe you want to mix up the real time lightning with your back lightning in order for you to boost performance and use that performance in other subject of your game like networking programming game features Etc another thing that I want to talk about is Reflections and how you can capture them in a real engine and what is the idea behind it and how you can create optimized Reflections so right now this sphere is reflecting only my lights over here because we have nothing over here to capture pretty much so one way to do this is go here and search for Reflections and you have three types box sphere and play laner let me drag and drop box and here you have boundaries of those box so in those boundaries you're going to capture everything and you're going to start reflecting it onto your surface which has a reflective material but right now nothing is happening because we have only this dark scene with everything is gray and here from the reflection Source type I set to capture the scene right now as I'm capturing the scene nothing is transitioning onto my bow but you can go to specified Cube map and you can use a cube map for Reflections I'm going to select this and now my reflective bow over here is reflecting everything from this Cube map if we get out of the boundary box over here if I move it over here all the way over here we are not reflecting anything and this is the optimized way to reflect something and I'm going to show you in real life example in a game in production how in theory this is used so this is the first method that you can use and let me show you the real life example here I'm in unity but I'm just going to show you the concept I have a sphere here which is capturing my entire environment and here we are capturing the houses Etc and the sphere bounding box is capturing the entire level so I have one reflection Sphere for my entire level and this reflection sphere is capturing everything and this is the optimized way to fake Reflections onto your weapons and right now I just put this AK-47 and let me just turn off this and if I move a little bit around it you can see the house over here and it is reflecting and this reflect information we are getting from this reflection prop over here so this is the way how you can fake Reflections and still be in believable CS into your scene this is the very optimized way that you can use for AAA Mobile games and it is not in real time of course you can select your probe to be be real time over here in unity and the same goes for Unreal Engine if you capture the scene this will capture in real time but if you want to fake it and save up a lot of performance this is the right way to do it Define different zones and create different captures so this is the first way another way is to add a skylight so when I add a skylight over here we have the same thing as the Box capturing but this is affecting the complete scene the whole level so if I turn on Real Time Capture we need also a sky atmosphere component to capture everything this is the real time capturing and giving the Reflections in order to have Reflections you need to have something in the environment so this sphere can reflect to but if I turn this off and let's say we specified the cube map I can specify this one for example and this is affecting the entire scene right everything that has a little reflection will start reflecting my floor also has Reflections but if we zoom over here we see that the floor here is gray what you can do over here is you can open the Skylight and go into advanced and turn off the W Hemisphere and now you will get also the ground reflection so this is another method if you are making a PC game a triaa game you can use the Skylight to fake reflection with Cube map or just capture the entire scene and just feed your game with real time reflection data all right so for the end of this video I'm going to show you how I lit up this scene how I have this pretty nice lightning and the indirect lighning is just filling up my cave exit just the right amount also I have those nice gold Rays over here that I letting up Ray and R2D2 so let's break this down and let me show you how I set up the scene so if I turn off the lighting you can see here that I have an emissive material just for the lightsaber and it is a a little bit of bluish if you want to create a little bit more hwo around this what you need to do is you need to add a point light and you need to set up this point light let's say let's set up a bluish C over here let's tune down the intensity to one maybe 0.5 0.2 and let's tweak up the source radius and now you can see that we have this nice blue effect that is having this emission Channel over here in to the material but we are also emitting a little bit of light through this point light all right so this is how you can create your emissive channel and how you can add an extra depth to your emissive material over here the flickering we don't have enough resolution for the shadow but you can fix that so I'm going to delete this one and let's start by breaking down everything first I'm having a directional light so my directional light is liting up the scene through this little Gap over here where the exit of our cave is and we are just liting up our character which is Ray and a little bit of R2D2 just his bottom over here right and this is ideally as an our direction that I want those things to be on the focus all right so in my directional light what I set up is I have intensity of eight I have a little bit of big Source angle 3.5 let me show you how this affect the scene see the Shadows the bigger the source angle a little bit softer Shadows we have over here so 3.5 working great for me for the source soft angle I've put 0.12 moving further this indirect lightning intensity which is 2.5 if I boost it up to six to seven you're going to see how we are letting up a little bit inside of the cave but when we apply later on the post process 2.5 will be okay let me put 20 and when you put 20 you can see that we are liting up a little bit more of this indirect places that are lit up from the sunlight if we put 40 just for the sake of it to see how it works see how we are filling it up but I'm going to put 2.5 as this is working with my pause process for the volumetric scattering we're going to go back to this when I enable the fog and the other thing that I have in my directional light is my white shafts those white shafts are needed in order for you to create God Ray so I enable the light shaft over here and the light shaft Bloom and I have occlusion of 0.3 all right so the next step let me enable the post process when I enable the post process you can see that our scene is letting up and I have few settings over here let me show you so when you go into your exposure right now I didn't set up the minan and the max EV value over here but I've set up the M ring modes to manual I've set up the exposure compensation to 15 so from here you can lit up your scene a little bit more so let's say 18 16 let's say five so from here you can control how your scene is letting up how much exposure you're going to have so 15.5 is good for me and you need also to apply the physical camera exposure because if it's false it will start burning out your scene and it will not have this accuracy in the C and lightning so I have those settings and the next thing that I have is as I've mentioned before you need to set up the infinite extent Unbound because this will work for the complete scene so this is the setup for my post process all right so far so good what else I have I have volumetric clouds which are working outside and they're just adding a little bit of cloud functionality to my whole Sky I have Skylight so when you turn it on I have a little bit of Skylight then I have Sky atmosphere I didn't touch the the settings over here everything is by default then I added the sky atmosphere again the sky atmosphere is by default and you can see that we have over here a little bit cowers from the sky atmosphere a little bit bluish in our rocks because we are letting up from this side from the left side and right now our scene is looking good but still not fantastic I don't like the change of Cs between those and those rocks and that's why I an HDR backdrop when I turn it on you can see that this HDR is fixing the Cs over here and for this HDR backdrop I use just the storm template and the intensity of one but by using the HDR I'm fixing this area of my rocks to be the same as this one not to have this big change in CS and that looks pretty good to me and the final source is to use exponential height Fork when I turn the fork I have those pretty nice gold race and let me show you the settings for the exponential height fog the HDR backdrop doesn't have any specific settings so here I have a fog density of 0.05 if I tune this up to let's say one you can see how my gold Ray are start to getting a little bit dense at the start of the god race and if you want this kind of effect let's say it's a desert outside and the Sun is burning too much you can tune up the fog density maybe one two of course you can do that but I'm going to use 0.5 for me just to have this little SLE effect of the gold race then moving further I have enabled the volumetric fog this is pretty important you need to enable the volumetric fog if you don't enable it you're going to have this blue Hae over here which is not natural and if I enable it I have everything looking good and I have those pretty nice gold Rays for the scattering distribution let me show you what this does if I go all the way to zero it will scatter around even so from the start till the end of this gold Ray but when I start bumping it up you can see that we are bumping up the start point of the gold race and the end point is fading out and this is the effect that you want so I'm going to put 084 let's say 74 so we can have this pretty nice effect and the idea of this shot is to have those two characters as a pinpoint so when a person look at this shot it will immediately see the characters and know that the focus of the eye should be going there and those are pretty much the settings that I use for this scene it is pretty straightforward and see how easy it is to set up something looking as good as this one if you know the basics of lightning and one more advice before I wrap this up when you're creating a light scene let's say there is a dark scene and you need to LIT it up for different games what you need to do is you need to collect a lot of references and start working with references I did this lightning composition by using references from Google and pinest so I highly recommend to use photography as a reference for your lightning and before I end up this video I want to let you know that I've created a blueprints master class for Unreal Engine 5 it is available right now on UD me so if you want to expand your knowledge and not just only create art pieces in an real Engine 5 but create some characters create some game logic my course is the perfect solution from beginners to intermediate and real ng5 users the course itself is 15 hours long and it has all the foundation that you need to Kickstart your blueprint knowledge in unreal ng5 so if you want to keep evolving yourself Beyond just creating art in EN Engine 5 en roll now so I hope you enjoyed this video and if you want to support me and get access to all my files also to the auto material that I've created previously join my patreon page for fortnite 9 and with your pledge you're supporting me to keep creating amazing videos like this each one of you can make a big difference by supporting my channel so I can keep making those videos thank you guys for watching this video Happy game development I'm out
Info
Channel: CG Dealers
Views: 3,702
Rating: undefined out of 5
Keywords:
Id: eiilcq-YjMc
Channel Id: undefined
Length: 58min 12sec (3492 seconds)
Published: Tue Feb 27 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.