Mapdev:grass

From Spring
Revision as of 02:53, 21 December 2012 by Enetheru (talk | contribs) (cleaned a little.)
Jump to navigationJump to search

Grass

Grass is entirely optional, but can be customized via map parameters and adds a nice touch to your map.

Example Grass Disribution In Game Result
This example represents the blue channel of the feature map.

Specification

mapinfo.lua

local mapinfo = {
   ...
   resources = {
      ...
      grassBladeTex = "",
      grassShadingTex = "",
      ...
   },
   ...
   grass = {
      bladeWaveScale = 1.0,
      bladeWidth = 0.32,
      bladeHeight = 4.0,
      bladeAngle = 1.57,
      bladeColor = {0.59, 0.81, 0.57},
   },
   ...
}

Blade Wave Scale

Blade Height

Blade Angle

Blade Color

does nothing when blade texture is set.

Distribution Image

Formerly Feature Map. Grass distribution is defined by blue pixels, the more blue the pixel is (the closer to blue 255 it is), the thicker grass will be at that location.

  • The distribution map is an intermediary file compiled into the SMF/SMT files using MapConv or MapConvNG.
  • 8 bpp RGB
Spring Map Size* pixels = Spring Map Size * 64
2 128
4 256
6 284
... ...
32 2048
* must be multiples of 2

Shading Image

  • File location: ./maps
  • 8 bpp RGB, any resolution, will be stretched over the whole terrain
  • If a shading image is not present, the minimap will be used in its place.
Example Result

Blade Texture

Need more info

  • File location: ./maps
  • 8 bpp RGB
Example Result

Forum Discussions