in this section, I will explain how after integrating the rain system I added cloud density to make the rain more realistic and also adding the gloom with sky color when rains or change of time happens.
Cloud Density:
For cloud density in the weather controller blueprint where we integrated the rain method, I create a new method for updating the sky.
For this method, I defined some new float type variables for cloud opacity and get a reference to the sky variable and get cloud opacity from sky BP also. After that, I subtract the cloud opacity from sky cloud opacity and take the absolute value of it and check if it is bigger than 0.1 and connect it as a condition to a branch node.
In branch Node, if the condition is true I get the sky variable again and from its reference as the target, I set the cloud opacity. ( for cloud opacity pin, I take the value from subtracting the cloud opacity and sky cloud opacity, and check if it is bigger than 0 and connect it as a condition in select float Node, in select float nod I defined A input as 1.0 and B input as -1.0, in addition of that I took the return value and multiply it with our change rate variable and add the result with sky cloud opacity and plug the result to the Set Sky Cloud Opacity Node and connect it to the output pin.
after this method, I connect it to the event Tick.
Gloom:
for the Gloom effect, we follow the same mathematic formula as update sky, however, before any integration, we need toı to define our gloom as a scalar parameter in Material Parameter, where we defined our RainLevel and set the value to 1.
in our method as update gloom level first, I get the scalar parameter value and as a collection, we set our MP and for parameter's Name, I choose Gloom parameter and take the return value. Also, I added the new variable called gloom level and subtract it from my return value from scalar parameter value Node and continue the previous method to update the sky.
and connect the method to event tick as well.
Sky Color Effect:
for updating the sky color I manipulate the existing method of update the sky in the sky sphere blueprint. there is a method called UpdateSky and in this, I will add some extra nods to achieve our desired color.
for this approach, I defined some variables such as Skylight and height Fog and set them with light color component node, and connect them to the vector parameters value of Update Sky.
Comments