How to light a 3d scene in Godot (3d tutorial)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video we are going to see how to start with a basic scene and be default lighting in Godot and take it to a finished polished rendered result while going to look mostly at the world environment and at setting up a sky that's going to give you great global illumination on your scene now the scene in question you can download it it's available and a Creative Commons license and it is made by GL e nitron you will find the link in the video description so i've imported the scene the materials I've put the gltf file and all the resources in guro which has created all the materials for us then you can double click on the scene to create a new inherited scene which will put all the models all the meshes in a long hierarchy now the naming conventions for this model are not great so it's a little hard to filter all the nodes but in order for global illumination to work you have to go through all the mesh instances select them go to the geometry category in the inspector and make sure that we used in bakelite property is on for everything so I've gone ahead and done that to save us a bit of time on the video so that we can focus on the lighting we're going to instantly add a directional light that will represent our Sun so press control a and search for light and add a directional light that's going to be at the center of the scene so I'm going to select it and move it a little bit so we can orient it a little better so already with the directional light we get some sunlight and some shading on our mesh although you can see that the shading is pretty uniform and we don't get any bounce lights by default we're going to activate the shadows on this light so in the inspector expand the shadow category and click on enabled and this will help us place the light properly I'm going to make it face the and part of the scene the main shops that we have here and offset this directional light to the site now in order to get global illumination we want to add a global illumination probe so press ctrl-a again and search for GI probe this is a big box in which goodö will pre calculate the real-time global illumination now I've hidden the widgets in the View menu so go to view gizmo and click on the I in front of Jai probe if that's the case for you and you can toggle it to render it in front of the geometry if the scene is pretty complex so that you can see how it looks like in front of your mesh make sure when you scale the probe to give it a lot of space for the light to bounce in otherwise you might get some artifacts when you bake it I'm going to give it quite a bit of space and center the scene inside of my probe there you go so with that I can hide the probe once again so it doesn't get in the way while we are working on our lighting it is still dead still exist it's just not visible so with that we want to click on beige eye probe with the GI probe node selected this will bake the lighting information I was seeing it this will prepare the meshes for real-time global illumination and this will change their shading a little bit this global illumination is effected by two things one is our directional light here and the other one is the world's environment the default sky that you have in good oh so good Oh will create a procedural sky cloudless and a little blue as you can see by default for you now this sky is a resource and by default Godot is going to use the default environment here as resource that it creates along with your 3d go to project all with every project basically we don't want to use this resource because in each level of your game you might want the lighting the time of the day the environment to be a bit different so you want to use individual resources that you will apply to each level for that you have to add a new node called world environment so let's press ctrl-a again and search for world environment and add it to the scene I'm going to put it at the top and this world environment node takes an environment resource we're going to create one in the inspector and click on it to expand it you can see that as soon as we added an environment to it now godo started using our new world environment if you are to remove the resource it will fall back to the default one let's create a new environment resource and instantly save it on the disk so we're going to select the resource click on the drop down menu next to it and select the save option let's save it in a sensible folder and this will be our test environment alright so the first step in to setting up an environment is setting up the background for the world by default it's going to use the clear color clear color is a color that's set in your project settings we search for clear color you can find it in the environment this one does not affect lighting at all it is just a background color for the environment instead we can use a procedural sky or a sky in general let's start with that and we have to create a new sky resource so guru can generate a procedural sky for you if you don't have a texture to use in this lot or you can use the Karma sky here and use a texture that captures an entire sky in 360 degrees so we're going to use this one for this video now you have to feed a texture in the sky resource so let's click on our panorama sky and we have to drag and drop a texture in here to find high quality skies and HDR textures that contain a lot of lighting information I invite you to check the a GRI Haven website which is why I downloaded in mine from so you want to go to HDR eyes and look environment that you like the textures here are very high-quality and there and the cc0 license so you can use them in commercial projects as well now back to the dough I'm going to head to my skies here and drag and drop one of the two skies I have into the panorama slot and as I do that you can see the indirect lighting update instantly I can change the texture here to completely change the look of my scene and you can also see how for example there is a sunlight baked in my sky here and I can use that to have front lighting on my scene and in general when you do that you want to align your directional light in order to get the real-time shadows on your model because you won't get sharp shadows cast it from that atri is just going to give you some environment bounce lights as you can see if i deactivate my directional light now i don't get any shadows I get some soft shading all around my object and as I toggle the Sun back on then I get my shadows back so I'm going to keep the Sun pointing down and use my champagne castle a texture here so I'll drag and drop it back into the panorama slot now in your game most of the time you don't want to see this panorama so you'll want to have a different background and for that you can change the background mode from sky to color plus sky it depends on the texture that you are using but this is going to add a clear color in the background so I'm going to fold the sky resource and go down to the color property to set it to a nice grey that will make the scene pop a little more okay so we already have a nice result at this point but you can do even better than that we're going to look at the ambient light category and for now the ambient lights of our scene so that is the lights that we have when we react evade the directional light it entirely comes from the sky and you can mix it with a color by changing the color property here so say we want the scene to have some purple and the shadows we can choose a purple color and by default you will see that it does not do anything that's because sky contribution is set all the way to 1 this means that all the ambient lighting comes from the sky now you can blend your sky with the ambient color that you've set on this property by taking the sky contribution down ambient lighting with a direct color will make you lose a lot of information in the shadows in particular so if I turn the sky contributions back on you can see there's a lot more subtlety in the shade in the dark areas of the scene while if I use only a flat color I get a pretty muddy and unrealistic result so that's why we want to use our sky to have a lot more lighting details and information that we've seen but if you want to tone your shadows a little bit you can lower it - let's try 70% here just to have a bit of purple in the shadows and then you can play with your ambient color so a white one will not tin the shadows you'll just make the shade a little more white and uniform compared to using our sky but can't in the shadows in purple or blue for a stylistic effect using that ambient light color you can also change the energy of your ambient light so this affects both the color that we have chosen and our sky here I'm going to increase the energy and you will see that in the shadow areas of my scene I'm starting to get more and more light but also because there's some Sun taken in the picture that we use as I will panorama it's going to burn the whites a little bit and this access to the one vast processing effect that we're going to look at in this video and this is tone mapping it's extremely important when you're working on realistic graphics to grade your visuals a little bit so turn mapping is going to take the colors that go to renders internally and map them on screen with a bit of a curve so by default the linear mode is going to take the colors and just map them on the screen using your screens color profile but you can change the tone map to what is now common in games so Raynald filmic and filmic ac's curves are three different ways to map the colors on the screen that have slightly different results so Reinhard tends to create a fair fairly faded result as you will see you need to tweak the exposure and the white property when you do that because it's going to change how the colors are rendered on your screen but if I increase the white level and I make my scene a little darker with that you will see that this has a bit of a d saturated look especially in the shadow areas in general so this is what Reinhard achieves filmic is going to apply a bit of an s-curve to your image increasing its contrast and it will tend to saturate the shadows as such this is a standard curve used in the movies industry for a very long time although I would guess that in games the processing that you apply is a little less precise but this is going to add contrast your scene and this is a very common curve to play with and finally you have aces which is a variant of filmic that's been used in more recent games that gives you a lot of contrast in saturation in the final render that you get so when you use this tone mapping you want to adjust the white level you want to tell the profile which level which intensity of light in your scene should be the color pure white if part of your image is blown out like the cats or the whites on the wall you want to increase that white level to tone everything down a little it's and gets nicer colors now after you applied your tone map you want to tweak the energy and your ambient light a little bit to open up the shadows once again asus is going to give you a really crisp and saturated look and I love the filmic curve which gives you a bit more of a faded tone natural one but still fairly vibrant colors compared to Reinhard so experiment with these for your game and depending on the scene that you are working on as well last thing we can activate is SS reflection so screen space reflections to get nice reflections on metallic materials like this panel in front of the shop and there you have it your rendered scene if you have any questions please ask in the comments but that says fall now I want to thank you kindly for watching be creative have fun and let's see one another in the next one bye bye
Info
Channel: GDQuest
Views: 33,121
Rating: undefined out of 5
Keywords: godot lighting tutorial, godot global illumination, godot engine global illumination, godot tonemapping, godot filmic, godot 3d lighting, godot pbr tutorial, godot hdri, godot environment, godot post processing, game development, godot engine, godot 3d tutorial, open source, godot 3d environment, godot world environment, game development for beginners, godot engine tutorial, godot engine 3d
Id: iamttSmxA2I
Channel Id: undefined
Length: 14min 24sec (864 seconds)
Published: Thu Jan 31 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.