SM3 Map Format: Difference between revisions

From Spring
Jump to navigationJump to search
SM3 specification
 
SM3 Map format specification
Line 5: Line 5:
== Map specification ==
== Map specification ==


Instead of a binary SMF file and a SMD file, all map information is now stored in a text based .SM3 file. This has the same basic layout as the original .SMD file, but it includes a [TERRAIN] section:
Instead of a binary SMF file and a SMD file, all map information is now stored in a text based .SM3 file. This has the same basic layout as the original .SMD file, but it includes a [TERRAIN] section and an [INFOMAPS] section:
 
 
[MAP]
{
    ... regular smd information, such as start positions,
            [LIGHT],[WATER] and [ATMOSPHERE] sections...
 
[INFOMAPS]
{
metal=Maps/dry_data/metalmap.png;
type=Maps/dry_data/typemap.png;
}
[TERRAIN]
{
HeightScale=400.0;
HeightOffset=10.0;
Heightmap=Maps/dry_data/1026.png;
NumTextureStages=2; // all texture stages are multiplied
[texstage0]
{
// the first texture stage operation is ignored
source=Snow;
}
[texstage1]
{
// use the incoming alpha to blend between 2 textures
operation=blend;
source=CrackedDirt;
blender=RockBlender1026;
}
/* texture definitions */
[CrackedDirt]
{
File=Maps/dry_data/dirt2.jpg;
Bumpmap=Maps/dry_data/dirt2_bm.jpg;
TileSize=50;
}
[Snow]
{
File=Maps/dry_data/Snow_Sand.jpg;
TileSize=20;
}
/* blender definition, all blenders have "Blendmap=1" */
[GrassBlender] // a generated blender
{
Blendmap=1;
OriginHeight=10;
MaxHeight=0.5;
}
// a rock blender loaded from file for a specific map
[RockBlender1026]
{
Blendmap=1;
File=Maps/dry_data/1026_bm_small.png;
}
}
}
 
== Terrain specification ==
 
The heightmap is specified with 3 tags:
 
 
* Heightmap: This should be either
** An 8 or 16 bit image file readable by DevIL
** A 8 or 16 bit RAW file, such as generated by Terragen
* HeightScale and HeightOffset:
  The actual height of a heightmap pixel is calculated scaled by HeightScale, after which HeightOffset is added to it (height = pixel * HeightScale + HeightOffset)
 
 
== Infomaps ==
The infomaps section defines the metal map and typemap. Both should be 8 bit images in any format DevIL accepts.
 
== TODO ==
 
- map features
- dynamic shadow mapping support
- bumpmapping
- specular mapping
- a caching trick for very low end gfx hardware (partially done)
- shadowmap storage, so the resolution can be increased

Revision as of 21:38, 17 July 2006

Introduction

As opposed to the original SMF renderer, the SM3 map renderer allows multiple texture layers rendered on the terrain. This allows for higher texture resolutions and (eventually) improved lighting such as bumpmapping/specular mapping.

Map specification

Instead of a binary SMF file and a SMD file, all map information is now stored in a text based .SM3 file. This has the same basic layout as the original .SMD file, but it includes a [TERRAIN] section and an [INFOMAPS] section:


[MAP]
{
   ... regular smd information, such as start positions,
           [LIGHT],[WATER] and [ATMOSPHERE] sections...
	[INFOMAPS]
	{
		metal=Maps/dry_data/metalmap.png;
		type=Maps/dry_data/typemap.png;
	}
	[TERRAIN]
	{
		HeightScale=400.0;
		HeightOffset=10.0;
		Heightmap=Maps/dry_data/1026.png;

		NumTextureStages=2; // all texture stages are multiplied

		[texstage0]
		{
			// the first texture stage operation is ignored
			source=Snow;
		}
		[texstage1]
		{
// use the incoming alpha to blend between 2 textures
			operation=blend; 
			source=CrackedDirt;
			blender=RockBlender1026;
		}
/* texture definitions */
		[CrackedDirt]
		{
			File=Maps/dry_data/dirt2.jpg;
			Bumpmap=Maps/dry_data/dirt2_bm.jpg;
			TileSize=50;
		}
		[Snow]
		{
			File=Maps/dry_data/Snow_Sand.jpg;
			TileSize=20;
		}
		
/* blender definition, all blenders have "Blendmap=1" */
		[GrassBlender] // a generated blender
		{
			Blendmap=1;
			OriginHeight=10;
			MaxHeight=0.5;
		}

// a rock blender loaded from file for a specific map
		[RockBlender1026]
		{
			Blendmap=1;
			File=Maps/dry_data/1026_bm_small.png;
		}
	}
}

Terrain specification

The heightmap is specified with 3 tags:


  • Heightmap: This should be either
    • An 8 or 16 bit image file readable by DevIL
    • A 8 or 16 bit RAW file, such as generated by Terragen
  • HeightScale and HeightOffset:
 The actual height of a heightmap pixel is calculated scaled by HeightScale, after which HeightOffset is added to it (height = pixel * HeightScale + HeightOffset)


Infomaps

The infomaps section defines the metal map and typemap. Both should be 8 bit images in any format DevIL accepts.

TODO

- map features - dynamic shadow mapping support - bumpmapping - specular mapping - a caching trick for very low end gfx hardware (partially done) - shadowmap storage, so the resolution can be increased