Creating skylines using procedural textures, part 3
Things are about to get a little more complex now, so roll up your sleeves! If you do a render now, everything should look quite nice. But we need to add fog to each hemisphere for the final bit of realism. This fog will be instanced through blend materials, so that we can easily adjust the fog colour if we need to.
The first blend material
In the material editor, select the 'matSky' material. Click inside the material type, where it says 'Standard'. Change the material to a 'Blend' material, keeping the original material as a sub-material. You now have a blend material with 'matSky' inside the first material slot, name the blend material 'blendSky'. Put our 'matFog' material into the second slot, either by dragging it there or picking it from the material editor. Make sure you are creating an instance this time, by selecting instance inside this box:
Blending the two materials with a gradient
We need a mask to transition from the sky to the fog material. Click inside the 'Mask' slot and create a new gradient map, then name this ramp 'maskFog'. Edit the map to match the screengrab below. I added a key almost at the end of the gradient, and set it to black. Rotate the gradient by 90 degrees in the W channel to orient it properly, and set its UV 'Map Channel' to 2. The white part of this gradient will decide where the fog goes. Also, set the texture 'U Tiling' to 0.99 and turn off the 'U Tile' checkbox, then we don't get the bottom of the fog repeating at the top of our sky.
The remaining blend materials
Then we do the same for the other two materials, 'matBrightClouds' and 'matShadowClouds', creating blend materials with instances of 'matFog' as the second material and instances of 'maskFog' as the mask texture. Now there should be three blend materials in the scene, arranged like this:
- Blend material 1 (which we created above): 'blendSky', with 'matSky' as material 1, an instance of 'matFog' as material 2, and an instance of 'maskFog' as the mask.
- Blend material 2: 'blendBrightClouds' with 'matBrightClouds' as material 1, an instance of 'matFog' as material 2, and an instance of 'maskFog' as the mask.
- Blend material 3: 'blendShadowClouds' with 'matShadowClouds' as material 1, an instance of 'matFog' as material 2, and an instance of 'maskFog' as the mask.
You are done! If you do a render now, the finished image should look something like this:
Not bad! And since everything is procedural and instanced, it's very easy to make changes and create a whole range of different skies. Before we end, let's take a quick look at what we can do to make this sky even more flexible and better looking.
Taking things further
There are plenty of things we could do to improve this setup. We could add a sun between the sky gradient and the clouds layers. With expressions and controllers, we could set up a system for animating the clouds. Also, by playing with the output curves we could easily adjust the thickness of the clouds, the scale and the amount of clouds and so on... Quite a lot of fun stuff to do if you want!
I have made a slightly more advanced cloud system, that includes all the additions I suggested above. I have set up six different types of skies, ranging from a blue caribbean sky, a colourful sunset, to a sombre rain filled sky. I giving it away for free. Click the link below to download the full Procedural Skies Pack.
If you like this tutorial or find the cloud pack to be useful, why not donate a dollar or two. That way you will help support more tutorials like this. Thanks :)