Exterior Lighting in URP | Unity 2021.2 (Updated Workflow)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys in this video we will learn how to light an exterior scene in unity's universal render pipeline or urp so let's get started all right first of all i'm gonna create a new project from unity hub using unity 2021.2 i call this urp exterior lighting you can also choose universal render pipeline from here but i will implement the urp later from package manager so i am choosing this 3d template then click on create it will take a few seconds to load the template all right the template is loaded for this tutorial i'm gonna use this viking village urp pack which is available for free on unity asset store link is given in the description to import this package click on open in unity then click on import to import the package again it will take a few minutes to load the package after the package is imported i go to this viking villa folder go to the scenes and open this viking scene and as you can see right now everything is pink and that is because this project is designed for universal under pipeline and we haven't implemented the urp yet so first we need to import the urp package from package manager to do that go to windows and package manager and from here choose unity registry and search for urp then choose import or update whatever option you have all right now the package is imported and now everything is looking perfectly fine so this is the scene that you will use to light basically i will delete everything from the scene and we will light the scene again from scratch first of all i save this scene as village lighting okay delete everything that is related to lighting reflection probes light probes volumes direction light and this canvas these volumes we don't need this one okay also go to windows rendering lighting and from this drop down button i choose clear bake data to remove any lighting information okay in the environment i create new light settings so that we can start from scratch in the environment i remove any sky also disable the fork and dark on this ambient color okay and let's also delete these lamps okay and now as you can see everything is completely dark and it's a good starting point for us to light the scene i see the scene and let's start lighting the scene now first of all i'm gonna add a direction light as a sunlight so for that right click go to light and choose a direction light in the color mode i choose a slightly warm color and also enable the shadows okay next position this direction light i'm trying to get a early morning look in the scene now as you can see that the shadows disappear as you move away from the scene and also the quality of shadows is very pixelated as you can see here so to fix this issue i go to edit project setting and select this urp asset and here in the shadow resolution i increase it to 2048 or maybe 4096 but keep in mind increasing the shadow resolution will also affect your game performance and also increase the shadow distance so as you can see right now it is set to 50 but if i set this 200 as you can see now the shadows are visible much further away from the camera but keep in mind increasing the shadow distance will also degrade your shadow quality so if i set this to 1000 or maybe 10 000 you can see now the shadows are looking very blurry and pixelated so be very careful when choosing this maximum distance okay and also enable this sharp shadow option so if i zoom in here you can see the shadows are now much softer next let's add a sky to the scene there are a couple of ways you can add sky to the scene let's first see how we can add a procedural sky to the scene to add a procedural sky right click create and create a new material i call this sky material then from the shader option go to skybox and choose procedural okay then go to lighting tab go to environment and drag and drop the sky material in the sky material slot okay and also drag and drop this direction light into this song you can also keep this auto generate option on but don't enable these two option otherwise it will start making lighting for the scene which we don't want we only want the real time lighting for this scene here you can also control the intensity of this skylight so if i set this to 1.5 okay i think we need to increase our sunlight intensity so i select my direction light and set the intensity to 5 okay and also adjust the color okay much better but as you can see that the sky is not visible in the scene to view the sky in the scene click on this button and now you can see the sky is visible and this procedural sky is totally dynamic what i mean by that if i select this direction light and adjust this angle you can see the color of the sky is automatically changing according to the sun position okay now before moving any further i would like to add two post effects which are really necessary in order to correctly visualize your lighting to add post effects right click go to volume and choose this global volume i call this post process then click on new to create a new profile and first of all i'm going to add tone mapping and from this mode choose aces okay it will slightly darken your scene and provide you a cinematic contrast next i'm gonna add bloom okay so now why do i edit this post effects so if i move my camera here you can see if i turn this off you can see how boring and overbite this sun is looking but if i enable this post effect you can see how smooth and natural this sky is looking so make sure to keep these two effects on whenever your lighting is seen if you want more sky textures you can also import this fantasy skybox pack which is available for free on unity asset store so i can import this on unity now to use this skybox pack go to lighting tab and in the environment slot here we have different kinds of skybox materials to choose from and it will instantly update in the scene you may need to adjust some of their parameters in order to balance the scene lighting like this overall these skybox materials are really cool i highly encourage you to check them out you can also use hdr images as a sky texture for that you can download lots of free hdri from poly heaven website here you will find lots of free hdris which you can use in your project i have selected this hdr drive so i download this hdri i have imported that hdri and also slightly masked this area in photoshop to get a clean hdri to use this hdr image again right click and create a skybox material and from the shader choose skybox and choose panoramic then simply drag and drop this texture here and now you can use this skybox material in this skybox material slot okay i said then does it do one because i think it's too bright and also slightly rotate the hdri and here i also want to show you the effect of this post process you can see this is without the post effect and this is with the post process next i want to add a reflection popular scene as you can see the reflection in these puddles are not looking natural so for that i right click go to light and choose a reflection probe okay and place this in the center of the scene something like that and then increase the size from this box size option to cover the entire area next make sure all the 3d object in your scene are set to reflection prop static what i mean by that if i select this prop and go here and make sure that these are set to reflection probably static otherwise those objects will not be visible in this reflection probe so as you can see in this project by default all the objects are set to reflection problem static so we don't need to do that next we need to bake this reflection probe but since we have already enabled this auto generate option that's why this reflection probe is already baked otherwise if you don't enable this option you can click on this bake reflection probe to bake this reflection probe okay but for now i keep this auto generate option enable now as you can see after adding this reflection prop the reflection on these petals is looking much more natural next i'm going to add ambient occlusion to get more contact detail in this scene to add embed occlusion go to edit project settings and click on this urp asset and from this urp renderer here you click on this add renderer feature and now you can choose screen space ambient occlusion and you can see now we are getting more contact shadows let's increase the radius maybe 0.5 or maybe one okay now you can see we are getting more contact shadows now let's finally add some more positive facts to finalize our lighting so select our so i select this post process volume and i add shadow midtone highlights click all to enable all the options in the shadows i want a slightly bluish tone and in the highlight slightly warmer tone to get a nice morning look next i'm going to add we need to darken the edges of this frame to add some more dramatic look to the scene okay let's also add some fork to the scene to add fog again go to lighting and in the environment slot enable this fog option okay then select this color picker and choose a color from the sky okay something like that and i think the default value is fine okay if you have any queries regarding this tutorial feel free to ask me in the comment section or join my discord server and for advanced tutorials about lighting and rendering please give a visit to my patreon page link is given in the description and finally huge thanks to all of my patreon supporters especially hannah sinkhonen dimitu izukmok alexander alfredo cruz backup account brendan manion francois lube hoodoon few billio john marks luis elvis hernandez automata silas renegal shimonomes and the masti that's it for this video see in the next one bye bye
Info
Channel: UGuruz
Views: 66,996
Rating: undefined out of 5
Keywords: unityguruz, uguruz, unity urp lighting, unity urp post processing, unity exterior lighting, urp, urp lighting tutorial, urp unity, unity urp ambient occlusion, unity environment lighting, unity realtime lighting, unity urp realtime lighting, unity urp volumetric lighting, unity 2021.2 tutorial, unity lighting tutorial 2020, unity hdri skybox, unity skybox lighting, urp post processing unity, post processing unity tutorial, unity outdoor lighting, universal render pipeline unity
Id: 5dRVRyyGR4A
Channel Id: undefined
Length: 14min 59sec (899 seconds)
Published: Mon Oct 18 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.