Materialdefinitionen

Mit Materialdefinitionen können Aussehen und Funktion der Materialien, aus denen eine Clonk-Landschaft besteht, bestimmt werden. In der Landschaft eines Szenarios können maximal 125 verschiedene Materialien verwendet werden.

Materialdefinitions-Komponenten (Material.ocg)

TexMap.txt
Lookup table for color indices in static and dynamic landscapes. Colors 0-255 are matched to a material-texture-reference, except in Map.bmp static landscapes, where colors 0-127 are matched to a material-texture reference, and 128-255 are matched to the same list of references, except they are marked 'underground'.
Each line may contain one material-texture-entry in the format Index=Material-Texture. For example, 12=Earth-earth-topsoil would define color index 12 as earth material with the texture taken from a file called earth-topsoil.png.
The engine will draw materials in the order they are defined in the TexMap file, irrespective of assigned palette indices. Materials drawn late overwrite materials drawn early so that, e.g. using the standard table, rough chunks of earth will overlap water which has a smooth border. Mineral resources have an even higher index so that their rough border overlaps the earth and not the other way around. For this reason, there might be differing numbers of total pixels of a given material drawn than you might expect just from calculating the square sizes of the unzoomed map materials.
Wenn eine selbstgemalte Landkarte von der Engine mit der Meldung "Landkarte: Textur n nicht definiert." abgelehnt wird, kann dies durch definieren der Textur n in der TexMap behoben werden. Grundsätzlich sollte man ein palettenfähiges Grafikprogramm (MS Paint gehört nicht dazu) oder den Entwicklermodus der Engine verwenden, um solche Probleme zu vermeiden.
*.ocm
The engine will accept up to 252 material definitions at a time. OCM files a simple text files. The materials Vehicle, Tunnel, Water, Snow, Granite, Sand, and Earth must always be available.
*.png, *.jpg
Es können beliebig viele Texturen in einer Materialgruppe abgelegt werden. Breite und Höhe einer jeden Bitmap müssen Zweierpotenzen sein (also 16, 32, 64, 128, 256, etc.).
Each texture may optionally have a normal map named texturename_NRM.jpg and a shape texture named texturename_Shape.png (see section below).

Material-Textur-Referenzen

An zahlreichen Stellen in Szenario-Definitionen werden Materialien (ggf. mit Textur- und Mengenangaben) bestimmt.
Material mit bestimmter Textur: Earth-Rough
Material mit Textur und Mengenangabe: Gold-Rough=100
Mehrfache Materialien: Earth-Smooth=10; Rock-Rough=5

Texture shapes

Shape textures may be used to denote individual objects like rocks or bricks within a texture. When zooming the map to the landscape, the engine tries to zoom such that only complete objects from the shape texture are used in the final landscape. This is achieved by completing all shapes that have a minimum coverage from the map pixels zoomed at flat shape. The minimum coverage can be set per material using the MinShapeOverlap setting.
Texture files should be named [Texturename]_Shape.png and use one distinct color per shape. Shapes may (and should) wrap around borders, but must not exceed 25% of the total texture size in each dimension. Areas outside a shape must be made fully transparent. All shape colors must be exact, i.e. no anti-aliasing between shapes or to transparency may be used. Shape files should have be sized as a whole multiple of the corresponding texture size divided by its scaler (usually 4). A maximum of 255 shapes may be defined in each texture. See granite_Shape.png in the original Materials.ocg for an example.
For debugging purposes, e.g. for finding problems with spurious single pixels, a summary of all loaded shape textures can be printed to the startup log by setting DebugShapeTextures in the [Developers] section of the configuration to a nonzero unsigned integer.
Sven2, 2015-10
matthes, 2004-04