Rain (.fx) Guide

Started by Hardcore, January 18, 2010, 09:39:37 AM

Previous topic - Next topic
January 18, 2010, 09:39:37 AM Last Edit: January 18, 2010, 10:03:09 AM by Hardcore
Small guide to adding rain because someone was asking:

Below is the code needed to add rain into your mod map, it is put into the .fx file (kamino.fx) for example.

If you do not have one you will have to make one, this is also the file to add water, lightning, and lighting effects in.

Effect("Precipitation")
{
Enable(1);
Type("Streaks");
Range(12.5);
Color(216, 220, 228);
VelocityRange(1.0);
ParticleDensityRange(0.0);
CameraCrossVelocityScale(0.2);
CameraAxialVelocityScale(1.0);

GroundEffect("rainsplash");
GroundEffectSpread(8);

PS2()
{
AlphaMinMax(0.8, 1.0);
ParticleSize(0.06);
ParticleDensity(80.0);
Velocity(8.0);
StreakLength(1.7);
GroundEffectsPerSec(7);
}
XBOX()
{
AlphaMinMax(0.2, 0.3);
ParticleSize(0.02);
ParticleDensity(256.0);
Velocity(9.0);
StreakLength(1.0);
GroundEffectsPerSec(15);
}
PC()
{
AlphaMinMax(0.3, 0.45);
ParticleSize(0.02);
ParticleDensity(256.0);
Velocity(9.0);
StreakLength(1.0);
GroundEffectsPerSec(15);
}
}


Overview:

Effect("Precipitation") - Effect type

   Enable(1); - Tells the engine you do want to use the below settings.
   Type("Streaks"); - The only other ooption here, as seen in the hoth.fx is "quads" and is used for snow.
   Range(12.5); - How long the rain will fall before disappearing.
   Color(216, 220, 228); - The color the rain will be.
   VelocityRange(1.0); - The rate the rain will fall to the planet.
   ParticleDensityRange(0.0); - I do not know the effect of this line, would need to be tested.
   CameraCrossVelocityScale(0.2); The speed the rain would cross the camera, giving it the angled falling feel making it (///) vs (|||).
   CameraAxialVelocityScale(1.0); - Untested, i would suspect its similar to the above line.

   GroundEffect("rainsplash"); - The effect when a raindrop hits the ground.
   GroundEffectSpread(6); - The area the effect will spread before causing another effect (to avoid multiple effects in the same spot at the same time.

   }
   PC() - Tells the engine to use this for the PC version
   {
      AlphaMinMax(0.3, 0.45); - Unknown: My only guess is this sets the minimum and maximum size of rain droplets, this would need further testing.
      ParticleSize(0.02); - Size of droplets.
      ParticleDensity(256.0); - Density of droplets.
      Velocity(9.0); - Speed of droplets falling.
      StreakLength(1.0); - The size of the streak left by a raindrop falling
      GroundEffectsPerSec(15); - The number of ground effects per second (for changing if you want a lighter, or heavier rain.

Lines from other worlds .fx files that may be helpful:


   Texture("fx_snow"); - The texture used in place of a droplet for snow, or any other falling particle depending on your world.

Other:

If you wish to have it so it will not be raining you will have to set that by creating a rainshadow region/s, this is done in ZeroEditor and i have not tested it to see how well it works.

Hope this helps, if you see a problem let me know and i will update this, it is not all tested so please, if something isn't working as i think it should test it out, and let me know thanks!

QuoteSow the wind and reap the whirlwind
Through the rain and through the shine
Only something with a meaning can stand the test of time