Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Mapdev:grass: Difference between revisions

From FIGHTORDER
imported>Enetheru
migrated information from my old spec page.
 
imported>Gajop
 
(14 intermediate revisions by 3 users not shown)
Line 1: Line 1:
= Grass =
= 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 is entirely optional, but can be customized via map parameters and adds a nice touch to your map.
{| class="wikitable" style="text-align: center;" width="100%"
{| class="wikitable" style="text-align: center;" width="100%"
| (grass distribution image)  || (in game screenshot of result)
| [[File:Mapdev-grass.png]] || [[File:Mapdev-grass-example.png|451px]]
|-
|-
! Example Grass Disribution
! Example Grass Disribution
Line 10: Line 10:
= Specification =
= Specification =
== mapinfo.lua ==
== mapinfo.lua ==
<code><pre>local mapinfo = {
<pre>local mapinfo = {
  ...
  smf = {
        ....
        grassmapTex = "",
        ....
  },
   ...
   ...
   resources = {
   resources = {
Line 27: Line 33:
   },
   },
   ...
   ...
}</pre></code>
}</pre>
=== Blade Wave Scale ===
=== Blade Wave Scale ===
Defaults to 1. It specifies how much the blades will wave in the wind. Higher makes them wave more.
=== Blade Height ===
=== Blade Height ===
Default is 4. Defines the length of the blade of grass in elmos.
=== Blade Angle ===
=== Blade Angle ===
Default is pi/4. It defines how much each blade of grass curves.
=== Blade Color ===
=== Blade Color ===
does nothing when blade texture is set.
does nothing when blade texture is set.


== Distribution Image ==
== Distribution Image ==
* 8 bpp RGB
Formerly [[Mapdev:features|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.
{| class="wikitable" width="100%"
! width="15%" | File Location
| The distribution map is an intermediary file compiled into the SMF/SMT files using [[MapConv]] or [[MapConvNG]], it can also be specified in the mapinfo.lua
|-
! File Format
| Any that Mapconv programs support
|-
! Colour Depth
| 8bpp
|-
! Channels
| Greyscale
|-
! Resolution
| <center>
{| class="wikitable" style="text-align: center;"
{| class="wikitable" style="text-align: center;"
!Spring Map Size<sup>*</sup>
!Spring Map Size<sup>*</sup>
!pixels = Spring Map Size * 64
!pixels = Spring Map Size * 16
|-
|-
| 2
| 2
| 128
| 32
|-
|-
| 4
| 4
| 256
| 64
|-
|-
| 6
| 6
| 284
| 96
|-
|-
| ...
| ...
Line 53: Line 80:
|-
|-
| 32
| 32
| 2048
| 512
|-
|-
| style="text-align: left;font-style:italic" colspan=2 | &#42; must be multiples of 2
| style="text-align: left;font-style:italic" colspan=2 | &#42; must be multiples of 2
|}</center>
|}
|}


== Shading Image ==
== Shading Image ==
* 8 bpp RGB, any resolution, will be stretched over the whole terain
* If a shading image is not present, the minimap will be used in its place.
{| class="wikitable" width="100%"
! width="15%" | File Location
| ./maps/
|-
! File Format
| PNG, TGA
|-
! Colour Depth
| 8bpp
|-
! Channels
| RGB
|-
! Resolution
| Any, recommended powers of two, will be stretched over the terrain.
|}
<center>
<center>
{| class="wikitable"
{| class="wikitable"
|
| [[File:Grassmap_Map_example.jpeg‎]] || [[File:Grassmap_Map_ingame.jpg|512px|‎]]
|
|-
! Example !! Result
|}</center>
 
== Blade Texture ==
Specify a texture for the individual grass blades. The grass blades go from top to bottom, vertically.
{| class="wikitable" width="100%"
! width="15%" | File Location
| ./maps/
|-
! File Format
| PNG, TGA
|-
! Colour Depth
| 8bpp
|-
! Channels
| RGB (alpha does nothing here)
|-
|-
! Example
! Resolution
! Result
| Any
|}
|}
</center>


== Blade Texture ==
<center>
<center>
{| class="wikitable" style="text-align: center;"
{| class="wikitable" style="text-align: center;"
|
| https://springrts.com/mediawiki/images/3/36/Grass_blade_tex_testing.png || https://springrts.com/mediawiki/images/9/9f/Grass_blade_tex_ingame.PNG
|
|-
|-
! Example
! Example !! Result
! Result
|}</center>
|}
</center>


= Forum Discussions =
= Forum Discussions =
* [http://springrts.com/phpbb/viewtopic.php?f=13&t=27585 Try to keep perspective]
* [http://springrts.com/phpbb/viewtopic.php?f=13&t=27585 Try to keep perspective]


[[Category:Mapdev]]
[[Category:Map Dev]]
[[Category:Development]]

Latest revision as of 04:03, 6 May 2020

Grass

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

File:Mapdev-grass.png File:Mapdev-grass-example.png
Example Grass Disribution In Game Result

Specification

mapinfo.lua

local mapinfo = {
   ...
   smf = {
        ....
        grassmapTex = "",
        ....
   },
   ...
   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

Defaults to 1. It specifies how much the blades will wave in the wind. Higher makes them wave more.

Blade Height

Default is 4. Defines the length of the blade of grass in elmos.

Blade Angle

Default is pi/4. It defines how much each blade of grass curves.

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.

File Location The distribution map is an intermediary file compiled into the SMF/SMT files using MapConv or MapConvNG, it can also be specified in the mapinfo.lua
File Format Any that Mapconv programs support
Colour Depth 8bpp
Channels Greyscale
Resolution
Spring Map Size* pixels = Spring Map Size * 16
2 32
4 64
6 96
... ...
32 512
* must be multiples of 2

Shading Image

  • If a shading image is not present, the minimap will be used in its place.
File Location ./maps/
File Format PNG, TGA
Colour Depth 8bpp
Channels RGB
Resolution Any, recommended powers of two, will be stretched over the terrain.
File:Grassmap Map example.jpeg‎ ‎
Example Result

Blade Texture

Specify a texture for the individual grass blades. The grass blades go from top to bottom, vertically.

File Location ./maps/
File Format PNG, TGA
Colour Depth 8bpp
Channels RGB (alpha does nothing here)
Resolution Any
https://springrts.com/mediawiki/images/3/36/Grass_blade_tex_testing.png https://springrts.com/mediawiki/images/9/9f/Grass_blade_tex_ingame.PNG
Example Result

Forum Discussions