Mapdev:height: Difference between revisions

From Spring
Jump to navigationJump to search
m →Image File: minor formatting.
m added images.
Line 1: Line 1:
= Height =
= Height =
The height of the terrain is generally defined with a greyscale displacement map with black representing the lowest point on the terrain and white the highest. The height map is an intermediary file compiled into the SMF file using [[MapConv]] or [[MapConvNG]]. The height of the terrain can also be modified in game via lua scripting.  
The height of the terrain is generally defined with a greyscale displacement map with black representing the lowest point on the terrain and white the highest. The height map is an intermediary file compiled into the SMF file using [[MapConv]] or [[MapConvNG]]. The height of the terrain can also be modified in game via lua scripting.  
{| class="wikitable" style="text-align: center;" width="100%"
<center>
| ||  
{| class="wikitable"  
|+ Example
| [[File:Mapdev-height.png|256px]] || [[File:Mapdev-height-example.png]]
|-
|-
! Example Height Map
! Example Height Map !! Ingame Result
! In Game Result
|}</center>
|}
== Specification ==
== Specification ==
=== mapinfo.lua ===
=== mapinfo.lua ===

Revision as of 04:29, 19 December 2012

Height

The height of the terrain is generally defined with a greyscale displacement map with black representing the lowest point on the terrain and white the highest. The height map is an intermediary file compiled into the SMF file using MapConv or MapConvNG. The height of the terrain can also be modified in game via lua scripting.

Example
Example Height Map Ingame Result

Specification

mapinfo.lua

The relevant sections of the mapinfo.lua file that effect the height of the ground are in the SMF subtable

local mapinfo = {
   ...
   smf = {
      minHeight = 1000,
      maxHeight = -300,
      ...
   },
   ...
}

Image File

  • 8 or 16 bpp Greyscale
Spring Map Size* pixels = Spring Map Size * 64 + 1
2 129
4 257
6 385
... ...
32 2049
* must be multiples of 2

8 vs 16 bpp

These two images show the differences in prescision that the bit depth of the image makes. The effect has been exaggerated here for clarity.

8bpp 16bpp

* must be multiples of 2

+1 pixel

When each pixel represents a vertex you need one extra pixel than the number of quads you are attempting to represent

Example
Example

Additional Information

ROAM terrain engine