Mapping/Materialsystem

From UFO:AI

General

Since version 2.3 we have a material system. You can easily and flexible enhance your maps with it. The map loader searches them in base/materials - they have to have the same basename as the map - just not bsp as extension, but mat. You can think about it as a set of properties for world textures. You can create animations, terrain blending, scrolling, zooming and environment reflections with it. But i think it's just easier to show some examples:

# scrolling texture
{
	material tex_pics/tonight_honuda
	{
		texture tex_pics/tonight_honuda
		scroll.s 0.25
	}
}

This one will scroll the texture horizontally - the scroll.s parameter is the speed. This example also shows the basic syntax. You can define several stages for one texture/material via:

# terrain with two stages
{
	material tex_nature/desert006
	{
		texture tex_nature/desert001
		terrain 0 64
		lightmap
	}
	{
		texture tex_nature/desert002
		terrain 128 192
		lightmap
	}
}

Here you can see a terrain definition with two stages. The lightmap must not be taken into account, it's switchable via the lightmap parameter.

# a metal surface with reflections
{
	material tex_material/metal
	{
		envmap 0
	}
}

This is a metal surface with reflections using the build in envmap (valid build in envmaps are 0 and 1) - you can also define another texture as envmap.

# a pulsating surface
{
	material tex_misc/pulse
	{
		texture tex_misc/pulse_blend
		pulse 2
	}
}

This is a pulsating surface - the speed is the value after the parameter pulse.

You can find more exmamples at base/materials.

project-navigation