Tutorial: Weather Control
This tutorial is about making weather on your level. Making weather is a very complex objective. You need to use different combinations of entities, depending on what weather you want to make. For example, if you want to make rainy level, you should be OK we the fact, that different entity combinations will make different feelings for player. Rain can be unnoticeable, so player will see that the weather isn't sunny, but it won't make any sense to him. On the contrary, rain also can be too noticeable, annoying, disattracting player from playing your level. You should control this.
You will certainly need the entities listed below. Let's see exact use of them.
Post Processing Effect
Post Processing Effect can affect player's emotions and feeling several ways:
- EV step, EV max, EV min, EV mid, EV compensation, EV adaptation speed, EV anti-clip treshold. Try to set EV to lower values. This will prevent the player from seeing bright image, so it will suit rainy levels, where the sky is overcast. In contrast, on sunny levels these parameters should be higher. Experiment with it, you will certainly find good setting.
- Depth Of Field (DOF) is also important. Try to set its value to 0.395 and see the effect. This will affect player's focus in close distances. And again - experiment, find the best value, that will only work for your level!
- Cue max blur radius, Cue start distance, Cue end distance. These parameters also should be set for both rainy and sunny levels. On rainy ones try to set it up so player won't see too far. But for sunny levels player should see far, but if you have decorative buildings on background (not sky, I mean background terrain), they shouldn't be discernible very good.
Note: The best way to use cues is to use them in combination with Haze. Set up settings so where the Haze starts, there the Cues starts.
- Saturation Adjust. For rainy levels (by the way, when I say rainy levels they can be not exactly with rain. It can be just the sky covered with dark clouds) try to set values lower than 0. This will add gray shades on your level and it will be looking darker. For sunny ones (again, they can be not exactly sunny. Maybe just no very dark clouds), in contrast, set up higher than 0, that will make colors much more pronounced which is important for sunny levels.
- Lightness adjust is simple. You can use it to fix lightness on your level, so you will be sure there are no places where image can be too dark or too bright.
- Light steaks length, Streaks brightness. These parameters control Light Streaks Sources (see below how to set it up). For rainy levels streaks don't have to be very long and bright, they just should make player think that sun still shining above clouds. But on sunny ones they should be long and bright, because sun is in player's direct sight.
- Screen Space Ambient Occlusion (SSAO) - occlusion of ambient light in the screen space, programming technique in a 3D computer graphics, which is the approximate imitation of global illumination and is a modified and improved version of the method Ambient Occlusion (this is SSAO definition - just to let you know what you are working with). This parameter can hide connections between models or corners that aren't supposed to be seen. Well, is isn't really important which weather on your level - SSAO don't have to be out of 1-5 range, or it will be too noticeable. But experiment! Maybe your levels need value set to 8, who knows?
Of course, to make your level you should choose sky textures. For rainy levels they should be covered with dark clouds, for sunny - with white ones or without them, but with brightly shining sun, for night time you should choose one with stars and moon, and so on. Consider the fact, that your chosen background will strongly affect Global Illumination (GI) (exacter - it will affect lights color). To make the sky you will need Cube Background entity. Drag it to the worldspace and place to position (0,-5000,0), because background cube have to be deeply under walkable zone. Select texture for your background. CT textures are lying in these paths on different folders:
Content/SeriousSam3/Textures/Backgrounds→ SEd3.5 only
Content/Talos/Textures/Backgrounds→ SEd4.0 only
Choose any folder. For example, I will take this one:
Content\Talos\Textures\Backgrounds\CGSkies\010\Background_C.tex→ SEd4.0 only
After applying it your cube will be looking like this:
Cube Background with texture set up.
But why? We selected just one texture! The thing is about their names. Textures for each background should lie in one folder and be named like this:
- *smth*_C for ceiling
- *smth*_W for west side
- *smth*_E for east side
- *smth*_S for south side
- *smth*_N for north side
- *smth*_F for floor
Instead of *smth* can be all you want to write, but it should be the same for each texture. When you select one of these textures to your background, the rest are automatically applying to background sides according to their names.
Once we made our background, let's speak about its properties. Imagine we are making level, on which it is already time for sunset. This background should fit well, but it can only show us the first sunset stage, when sky isn't orange. So let's change modulator color. Try to set it up like this:
And let's see what happened to background:
Cube Background with texture and modulator property set up.
Now it show a bit later stage of sunset. Play with color to reach needed effect!
Note: Changing modulator also affects GI when baked. One of the ways to force GI to be somewhat darker or brighter than the default is to set the Modulator brightness to a certain value, then use the rendering modulator to set the color of the background back to its original state.
Also you can change rendering modulator right during game process. Choose needed color in "Rendering modulator animation target", then crate new Event Animator, copy Simple animator property from Event Animator to Animator property in cube background. Now make a script, that will start animation on Event Animator. Be careful - you should make this change properly and slowly. If background changes too fast, that will be unrealistically.
That's all about cube background entity. And I'll repeat it again - experiment, work around and find properties, which will fit only for your level!
Haze entity will limit player's visibility. This entity can make fog, haze, mist or smoke (here is only limit - your imagination) that will be seen when you enter entity's specified area. It is very important to set up this entity on EVERY level, even if it is completely sunny. The main difference between sunny and rainy haze is its color and density.
But why do you need to apply haze for sunny levels? It is hard to explain, so let's see an example from CroTeam level.
Content\SeriousSam3\Levels\01_BFE\05_CairoTown\05_CairoTown.wld → SEd3.5 only
This level is sunny. Even more, sky here is clear at all. So what haze was used here? Let's see. Here are two screenshots - with and without haze on the level.
View with and without haze
Well, it's hard to see the difference, really, but haze is here and it's doing its job.
So let's set up your haze. Firstly, you need to set its cubic effect area. I don't know what level you are making, but on most levels there is one haze for all worldspace. So, the same Cairo Town example:
Full cubic haze effect area of haze on Cairo Town
Then try to set up haze properties. Choose the place in your worldspace, where you can see close and far objects well and begin to change settings. For beginning, try to apply these settings (without area effect):
Haze properties from Cairo Town level
See the difference? I think no, because it isn't very big. Try to change density or color and see the result. For rainy levels haze is much more important. Let's take one of Talos levels as an example.
View with and without haze
Here the difference is very noticeable and haze can't be ignored. So work around and find the best properties for your level! (and yes, I'll repeat it with each entity).
Note: Do not forget to set a start distance more than 0. Just play with that parameter to find good-looking value. If you set start distance to 0, haze will be rendered right from your face, and it isn't looking good.
Light Streaks Source
To make your sun shining good you should place light streaks source.
Example of dramatic rainy level