This type of snowfall looks nice:
If that example was made in Blender Internal or Cycles, I'd say particles were used - but particles clearly don't work in the BGE. How can a weather effect such as that be achieved in the Blender game Engine?
This type of snowfall looks nice:
If that example was made in Blender Internal or Cycles, I'd say particles were used - but particles clearly don't work in the BGE. How can a weather effect such as that be achieved in the Blender game Engine?
What a great question! It was actually surprisingly simple to make.
I started by modeling a few snowflakes, and then used them as the display objects for a particle system. I then rendered out one frame with the screen covered nicely in snow:
I then took that texture, and put it on a large transparent plane. The texture repeats way more than any normal should, but in this case it turned out fine. This plane is the most important part, and the settings are kind of hard to get right.
First, the face orientation must be set to Halo. This will make the plane track (along it's local X axis) to the player's camera. Second (but probably more importantly) the face's normal must be aligned to the object's local X axis so that it will face the camera correctly.
Now, regardless of the object's position or rotation, (because it only has one face with these settings) the face will always appear to the camera as if it were straight on.
The texture for this plane is a simple transparent texture. The Material's Z Transparency has an alpha of 0, and the texture's alpha influences the texture's transparency 100%. In this case, I have the snow texture influencing the material's color 10%, so that the base white color of the material is mostly used.
The physics settings and logic for this object is very simple. Physics type of no collision. Logic: Always - And - Motion (negative along the Z)
The snow plane is now done! if we press play, it should drop slowly, while facing the camera at all times.
Now that we have a nice large snow plane, we can drop a few of them into the scene. We will basically be building a pseudo particle system, except that each particle has many, many flakes, instead of each particle being a single snowflake. (This is FAR less computationally expensive)
Now - we will need a few empties to periodically drop the snow planes. Use more empties packed closer together for more dense snowfall, fewer empties scattered further apart for less snowfall.
The empties have super simple logic: Random - And - Add Object (the snow plane.) Depending on how high up your empties are, you'll need a longer time for the snow to fall before being removed. There should be a long enough delay for the snow to fall entirely below the ground plane, as it looks really bad having snow falling from the sky and vanishing near the ground. While the difference is hardly noticeable, it helps to set a different seed for each empty, to make the randomness a little bit more random.
These empties don't need to be scattered over the entire scene - that would waste computational power. It is enough to have the empties just above the character. Enter edit mode on your charter, and add a vertex at the character's object origin. Then, vertex parent all the empties to that vertex. (In this case to do a vertex parent, select the empties you want to parent, then select the object. Enter edit mode on that object. Select that one vertex, Press Ctrl + P, and click "vertex parent" Now, regardless of the character's location or rotation, the empties will stay in a fixed position relative to the character. If your character's physics type is set to dynamic or character, and there is no way it will ever rotate other than along the Z-axis, you can just use a normal parent for the empties.
You'll need fog set just right to make this effect go from nice to AWESOME. In this scene the following settings work, but depending on how dense you want to make your snowfall, you may want to tweak the fog settings to create the desired amount of visibility.
Of course, you'll also need a nice snow texture for the ground. It is kind of hard to get a good texture for this - I'm using a texture of ice to partially influence the material's color. This same texture controls the bump map. I have a sky texture with the mapping set to reflection, also partially influencing the material's color.
All the important settings for the material:
And the snow plane in the scene:
Add in the snow, falling from a bunch of empties in the sky:
This is the very same method that was used to create the scene in the question. Settings are slightly different from those used in the following scene. To make lower visibility, make the fog end closer to the camera, and make the snow more dense:
When combined with some wonderful explosions, the environment becomes Amazing.
A massive amount rain drops/stripes and snow can be achieved by showing one or more planes with according partly transparent textures in front of the camera.
Multiple planes can result in a depth effect. It adds some variation to the "falling" too. With a certain number of objects it will be harder to notice how many paths they take.
The texels on the texture should be small enough to prevent being recognized as flat object. In your sample above you see at the snow flakes close to the camera. They should be much more detailed as closer they are to the camera.
You can get the motion effect by either moving the plane, playing a video or animating the UV of the texture.
Make sure the end and the beginning of the animation fit together otherwise you get a frequent and noticeable jump.
This is as simple as it sounds. You move the plane from top to bottom. Easy way: play an action.
Be aware the border of the plane should never be visible to the camera.
Have a plane on place, but play a "snowflakes video" via VideoTexture.
The BGE has a simple build in UV-Animation (UV/Image Editor -> property menu n -> Game Properties). This fits pretty well this situation.
Alternative you can manipulate the UV via Python.
A simple method is to parent the plane(s) to the camera. This way you need just a view of them. Unfortunately when moving and turning the rain/snow seems not to belong to the scene.
A more complex method is to place the planes into the scene. This let it appear more plausible.
You need to ensure that the planes borders are never visible (otherwise you loose the effect). So you need a balance between details and efficiency.
You need to ensure the planes are visible with a direct view angle. Otherwise they will be recognized as planes and flat objects. You can solve that with the material setting "billboard".
You need to dynamically add/remove the planes otherwise you would need so many planes that you will get processing problems. This is typically solved by Python due to it's dynamic nature. At a certain distance to the camera you add planes. When the distance between camera an a plane exceeds a certain limit you remove the plane (as it should not be visible anymore).
I hope you get the idea.