Web Update 19.10.2024

Water

You are here:
Estimated reading time: 1 min
This article describes the old version of Trainz, source code and features may differ from the new version.

The new water animation in TRS (type water2) replaces the previous UTC water (type water). Therefore, the water type is no longer supported by TRS. In case the UTC map refers to an old water type it will automatically update to one of the new animated water types. Basically, the new water system consists of an animated, bump-mapped, transparent surface. Animations, variables are controlled via water.anim.txt. Tile size and material properties are controlled though the water.config.txt file.

kuid:123456:1226;
trainz-build 2.5
category-class "EW"
category-region "CZ"
category-era "2010s"
username "Tutorials agent"
kind "water2"
description"To to je návod woater 2."
thumbnails
{
0
{
image "thumb.jpg" width 240 height 180
}
}

Animation:

// Water DetailAnim configuration file
// Is used from DefaultWater.config.txt
DetailAnim
{
  animSampleRate = 10; // Sample rate (samples per sec)
  animPeriod = 5; // Looping period in sec.
  animSpeed = 2.0; // Speed of waves
  animSize = 128,128; // Bump map dimentions
  animWorldSize =.0; // scale X,Y coordinates of the normal map for better interpolation
  FFT 450.0; // "Size" of one tile
  animMaxHeight = 0.4; // Max height of the wave
  animScaleNormXY = 4
  {
    animFFTWindVec = -15.0,5.0; // Direction and speed of the wind affecting length of the waves
    animPhillipsA = 1.0e-3; // Phillips spectrum constant affecting heights of the waves
    animFFTSeed = 0;
  }
}

Water configuration:

// WaterManager config data
WaterManager("WaterManagerGeneric")
{
WaterMaterial
{
materialColor = (0.20, 0.45, 0.45, 0.8);
materialRI = 0.3;
opacityTex = WaterOpacity.texture;
opacityAmount = 0.5;
}
// Compiled DetailAnim or text ConfigData file ‘water.anim.txt’
// This is now loaded manually by Trainz so Trainz can cache the anim file in a separate folder.
// DetailAnimFile = water.anim;
}
// WaterGeometry config data
WaterGeometry
{
UVScrollVelocity = 0.0, 0.05;
TileUVScale = 1.0, 1.0;
GridSpacing = 10.0; // "Size" of one cell of the grid (is used if MaxAmp > 0)
TileGridSize = 2, 2; // Number of vertices in one tile (use more if MaxAmp > 0)
WaveFreq = 0.0; //0.15;
MaxAmp = 0.0; //0.25;
// Mesh animation
// TileGridSize = 3, 3; // Number of vertices in one tile (use more if MaxAmp > 0)
// WaveFreq = 0.15;
// MaxAmp = 0.25;
}
Was this article helpful?
Dislike 0 0 of 0 found this article helpful.
Views: 4
Alpinetrainz
Logo
Shopping cart