Unity HDRP Tutorial - Setup Volumetric Clouds (Part 1)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome to the first part of our tutorial series on creating breathtaking Skies using volumetric clouds in unity in this tutorial you will learn how to add stunning volumetric clouds to your Unity project using unity's high definition render pipeline you will learn how to customize your clouds and create a wide variety of cloud styles that suit your project by the end of the tutorial you will have gained a deep understanding of unity's volumetric cloud feature enabling you to transition into more advanced concepts for even more variety and customization also we are very happy to tell you that this video is sponsored by the nice guys over at Unity before we begin setting up our volumetric clouds we must know what they are and when and when not to use them volumetric clouds are relatively new to video games due to the performance cost they rely on the technology known as Ray marching and are designed to be used on high-end PCS and consoles and not meant for low-end devices such as mobile phones or VR the main advantage of volumetric clouds is that they have a perceivable thickness can interact with wind cast shadows and are affected by lighting and fog this enables us to create Dynamic real-time believable looking clouds it is also important to note that the volumetric cloud feature is a part of unity's high definition render Pipeline and is not available for unity's built-in pipeline our unit is universal render pipeline [Music] now that we have a high level understanding of what volumetric clouds are and when you can and can't use them let's jump into unity and get them set up we will create a new project for this tutorial start by opening up Unity Hub and selecting new project we are going to be using Unity 2021.3 LTS next we need a 3D hdrp project to render volumetric clouds if you have not yet downloaded the 3D hdrp template you will first need to by clicking on the download template button on the right hand side of the unity hub with the 3D hdrp selected and the template installed you can now give your project a name and select the safe location of your choice I will call mine volumetric Cloud's underscore tutorial in the bottom right of the unity Hub select create project to open your new project [Music] with our project open we want to create a new scene for setting up our volumetric clouds to create a new scene go to file and choose new scene in the pop-up you will see that Unity provides us with a selection of basic scene templates we want to select basic Outdoors hdrp this template comes with some basic presets we can use as a foundation for setting up the volumetric clouds with the basic outdoor hdrp scene selected click create in the bottom right of the pop-up window and save your scene I will save my scene under assets scenes and call it volumetric Cloud's underscore tutorial [Music] in the newly created scene you will see in the hierarchy that Unity has provided us with three game objects main camera sun and sky and fog volume the main camera game object contains the camera component required for rendering the scene the sun game object contains a light component with the default settings set to simulate sunlight as if on a cloudy day with the sun high in the sky and the sky and fog volume houses a volume component and a volume profile sky and fox settings profile created by unity when the scene was set up and contains Global scene settings for the visual environment physically based Sky fog and exposure we will come back to these game objects later what is important to note is that we now have a foundation to start setting up and rendering our volumetric clouds before we can render volumetric clouds we must first check that volumetric cloud support is enabled in the Project's hdrp settings to access the default hdrp settings we have to open up the project settings to open the project settings go to edit project settings then lock the window in the project settings window under Graphics within the drop down select hdrp global settings scroll down to frame settings and open up the lighting drop down towards the bottom you will see an option for volumetric clouds now check that it is activated next head over to Quality in the project settings and under rendering right click and select properties to open up the properties of the render pipeline asset in the pop-up Windows scroll down and open up the lighting drop down and the volumetrics drop down and check that volumetric clouds are active close the window and repeat the previous action for All Quality levels that you want volumetric clouds for foreign [Music] by default the scene view is not set up to render volumetric clouds in the same quality as you would expect to see them in game to ensure we see the volumetric clouds as they appear in game we need to make some minor adjustments to the scene view settings open up the scene View Camera and set anti-aliasing to temporal anti-aliasing later we will have the option to set the volumetric clouds to local clouds this means that the clouds are not just part of the Skybox but that we can move through them for local clouds to render all the way to the Horizon we need to increase the camera's far clipping plane set the far clipping plane to 100 000. I also want to ensure that we can see the clouds move in the scene view to do so set the effects to always refresh now that the project is set up we need to set some scene settings to accurately render volumetric clouds and Lighting in the hierarchy select the sky and fog volume game object with the sky and 4 game object selected select the visual environment drop down within the inspector we want to make sure that the sun affects the sky so that we can dynamically simulate the time of day and simulate sunlight scattering through the Earth's atmosphere as it would in the real world to ensure that the sun affects the sky set the sky type to physically based sky now when you select the Sun and change its angle you will see that the sky changes foreign [Music] within the sky and volume under the visual environment set the ambient mode to Dynamic so that the ambient light is taken from the sky visible in the scene without the need for light baking finally head back to the sun game object and in the inspector check that volumetrics and shadows are enabled our project and scene are now ready to render volumetric clouds to activate the volumetric clouds select the sky and fog volume in the hierarchy then in the inspector select add override under Sky select volumetric clouds you can now see that the volumetric Cloud's override has been added to the volume before doing anything else we want to ensure that all editable properties are visible to us to show all properties select the three dots on the right side of the override and check that show additional properties is active enable the volumetric clouds to activate them you will now see clouds appear in the scene now scroll down to shadows and activate Shadows so we can see Shadows being cast onto the environment to see the Shadows we also need a game object to cast Shadows onto in the hierarchy add a plane to the scene and reset the transform Now set the scale in the x and z axis to around 10 000. you may need to zoom out a little to see the Shadows on the plane's surface [Music] when you zoom out you will notice an edge to the Cloud's shadow to increase the range you can increase the shadow distance in the sky and fog volumes Shadow distance settings just keep in mind that as you increase the shadow distance you may need to increase your Cloud's Shadow resolution if they appear too soft as previously mentioned when we increase the far clipping plane in the scene camera we can set the volumetric clouds to be local clouds [Music] this sets the clouds to World space and enables us to move through and above them if you do not intend to move between the clouds it is recommended that this option stays switched off as it increases performance cost however for this tutorial we will activate local clouds to better visualize how the customization settings affect the volumetric clouds to activate the volumetric clouds select and enable local clouds you can now move through and above the clouds [Music] [Music] foreign you may notice some quality issues to improve the quality you can make some adjustments in the quality settings of the cloud volume override play with the temporal accumulation Factor as well as non-primary steps to get the look you want just be aware that the settings will improve the quality of the clouds but they will also increase the performance cost now that our clouds are being rendered in the scene we can begin customizing the way they look the look of the clouds and their impact on the environment is driven by multiple factors the shape of the clouds the wind affecting them the lighting and the Shadows they cast we will go through each of these shape wind lighting and shadows independently starting with the cloud shape Unity gives us an incredible amount of control of the volumetric clouds enabling endless customization with the sky and fog volume selected within the volumetric clouds override in the cloud control drop down you will see three options simple Advanced and manual both Advanced and manual modes require the use of external authoring tools to create clouds so for this tutorial we will focus on simple custom clouds as this enables us to create a wide variety of cloud configurations directly within the editor once you understand how to configure your clouds and how unity's volumetric cloud system works you will easily be able to transition into more advanced customization for even more variation [Music] to activate custom clouds in the cloud preset drop down select custom to better understand the changes we are making to the clouds and how the customization options affect them it can help to be positioned in the clouds we will also want to be able to quickly jump between the ground View and the cloud View to do this create two game objects call 1 ground View and the other Cloud View make sure to reset the transforms then set the position in the y-axis of the cloudview game object to 3500. this way we can select the game objects in the hierarchy and quickly switch between them in the scene view by pressing the F key now select the sky and volume to begin configuring the clouds the first step in customizing your clouds is to understand what lowest cloud altitude and Cloud thickness are lowest cloud altitude refers to the height of the bottom of the clouds in meters Cloud thickness refers to the vertical distance between the cloud space bottom and its top you will notice that when you adjust the cloud thickness you will get flat or tall clouds depending on the value foreign what is important to note is that this affects the total volume thickness or in other words the height of the volume within which the clouds are rendered not the height of individual clouds we will come back to this shortly when looking at custom density property and it will become clear why it's important to understand let's take a look at the density multiplier this affects the density of the cloud volume in the real world clouds darken as they gather more water and ice the denser they get the more light scatters resulting in less light penetration the underside of the cloud then begins to darken a this visual effect becomes more pronounced the larger water droplets get for example before it is about to rain or snow use the density multiplier to simulate the amount of water and ice in the clouds creating a thicker denser darker look [Music] look now let's take a look at the shape vector what the shape Factor controls is the coverage of the clouds you will notice how the cloud coverage changes as you move the slider from zero which is a full cloud cover to one which is no cloud cover you can use the shape factor to create heavily clouded overcast Skies or lightly clouded skies and anything in between next we will take a look at the shape scale this changes the relative scale of the clouds by tiling the noise texture used to generate the cloud volume keep in mind that shape scale will only change the scale in the X and Y axis as the cloud height is controlled by the cloud thickness lower values create larger Cloud shapes whereas higher values create smaller shapes [Music] now we will look at how we can control the shape of the clouds within the volume proceed as clearly make sure to use the default settings and move the camera to the cloud View [Music] we have some level of control of the cloud shape with the custom density curve the curve lets us control the cloud density through the vertical axis of the cloud volume enabling us to create some unique shapes the y-axis of the curve controls the density over the relative thickness the x-axis of the cloud volume see how this works add a flat curve then right click in the center of the curve and add a new key drag the key down to around -0.1 you will now see a clear gap between the top and bottom of the cloud volume by adjusting the custom density curve you can quickly create a wide variety of cloud shapes remember that your Cloud volume must have sufficient thickness to see this effect in action [Music] we can also control the erosion of the clouds enabling you to add more or less micro details to your clouds to see how erosion affects the clouds set the erosion factor to zero you will see that the clouds now appear soft use the erosion factor to adjust the amount of micro detail visible in your clouds with erosion scale we also have control over the scale of the erosion noise lower values increase the erosion size whereas higher values decrease the size [Music] finally we will look at the custom erosion curve the erosion curve name is a little misleading rather than affecting the micro erosion as the name suggests it acts more like the shape Factor enabling us to manipulate the cloud coverage along the vertical axis of the cloud volume again to see this in action let's make sure we have a clear separation between our top and bottom Cloud layers for the custom erosion curve create a linear curve then drag the right key down to around 0.4 [Music] as you can see we increase the coverage of the top layer of the cloud [Music] that concludes the customization of the cloud shapes using the built-in customization options at this point I recommend pausing the video playing around with some of the settings and experimenting with generating various Cloud shapes if you are striving for physical accuracy you can read up on the various cloud types and their properties via the link below it should be noted that although you have great control over the look of your clouds with the built-in customization options there are still limitations for example cloud coverage and style is consistent throughout the sky Unity offers more customization possibilities with the advanced and manual Cloud control options and we will cover these in another tutorial will look at adding wind effects to our clouds as in the real world volumetric clouds and unity can be affected by wind we have global wind settings and Cloud volume wind settings that give us more control over how wind affects the look of the clouds to set the global wind speed navigate to the visual environment override activate Global speed and set the value to 2000. you will now visibly see the clouds moving in the real world 2 000 kilometers per hour is faster than clouds would move clouds move between 50 and 100 kilometers per hour with speeds reaching around 300 kilometers per hour in the jet stream but for the sake of this tutorial we will keep the wind at 2000 to see how it affects the volumetric clouds now head back to the volumetric clouds override and under Global horizontal wind speed you will see a drop down set to Global as default you can multiply or add to the global wind speed within the drop down or create a custom wind speed for the cloud volume we won't change anything now it's just good to know that you can override the global wind speed here below the global horizontal wind speed you will see shape speed multiplier and erosion speed multiplier these properties provide you with independent control over the impact of the Wind on the cloud shape and erosion or micro details by adjusting these properties you can create some nice looking Cloud effects remember that the shape speed multiplier and erosion speed multiplier are only visible when Show additional properties are active for the volumetric clouds override [Music] the orientation property overrides the global wind orientation found in the visual environment override you can create a custom wind orientation for the cloud volume within the drop down or add to the global wind orientation [Music] the final two wind properties worth mentioning when customizing the look of your clouds are vertical shape wind speed and vertical erosion wind speed both of these properties affect the vertical direction of the wind for the cloud shape and erosion or micro details independently playing with these properties allows you to create dramatic looking Cloud effects and movement in your clouds [Music] next we will look at adjusting how light and shadows affect the clouds [Music] Unity does a good job of simulating physically accurate looking clouds with the default lighting and Shadow settings however you may sometimes want to make Minor Adjustments or create stylized dramatic looking clouds the first property we will examine is the ambient light probe dimmer this property reuses the ambient light affecting the clouds lower values create darker contrast Rich clouds [Music] the sunlight demand needs little explanation reducing the value reduces the effect the scene's main directional light has on the cloud volume erosion occlusion is a great property for bringing out more micro detail in the clouds higher values increase the contrast of the details remember that adjusting these values will have little visual impact with low erosion Factor values the following property is scattering tint this tints the light scattering color of the clouds adjusting the property breaks any physical accuracy but enables you to create beautifully stylized clouds for example pink candy floss clouds the powder effect intensity controls the amount of scattering in the clouds high values create diffuse or dirty smoggy looking clouds [Music] the multi-scattering property increases and decreases the amount of scattering in the clouds simply put the multi-scattering property lets you add or remove contrast low values create contrast Rich clouds whereas High values desaturate creating dull flat looking clouds although I want to have mentioned Shadows we won't go over every shadow property in this tutorial as they are self-explanatory there is however one significant limitation to be aware of as of this tutorial is recording when using local clouds shadows will also be projected onto game objects that appear above the clouds [Music] you can see how Shadows are projected onto game objects higher than the cloud layer some initial workarounds are simply deactivating Shadows or working with multiple directional lights and light layers that concludes the introductory tutorial on unity's volumetric clouds you now know how to configure your project and scene so that Unity can render volumetric clouds you also have an in-depth understanding of the properties required to create endless customization of clouds to suit your Project's needs I highly recommend playing with these properties to better understand how they work this will give you a solid foundation and understanding to move into the more complex customization options Advanced and manual which will give you even more control over the look of your clouds once you feel comfortable with the custom settings check out part 2 of the volumetric clouds Mastery series Advanced customization Concepts where we show you how to create even more Cloud variation if you have questions please leave your comments below or find the contact information in the video description also stay tuned as a bonus you can see a time lapse of how we create three different types of Skies using the features we learned in this tutorial [Laughter] [Music] [Music] [Music] [Music] [Music] thank you foreign
Info
Channel: Binary Impact
Views: 6,856
Rating: undefined out of 5
Keywords: unity, tutorial, unitytips, #unitytips, #unitytipstuesday
Id: 5R1jG7oUzAM
Channel Id: undefined
Length: 25min 37sec (1537 seconds)
Published: Thu Dec 08 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.