Mapdev:grass

From Spring
Revision as of 05:24, 18 December 2012 by Enetheru (talk | contribs) (migrated information from my old spec page.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Grass

Formerly Feature Maps. Grass coverage is defined by blue pixels on the feature map. The more blue the pixel is (the closer to blue 255 it is), the thicker grass will be at that location. Grass is entirely optional, but can be customized via map parameters and adds a nice touch to your map.

(grass distribution image) (in game screenshot of result)
Example Grass Disribution In Game Result

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

  • 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

  • 8 bpp RGB, any resolution, will be stretched over the whole terain
Example Result

Blade Texture

Example Result

Forum Discussions