Surface textures
A texture is just a tiled image file that appears on a surface or a whole block. When double clicking on a texture in the [Textures] window, it is applied to the currently selected block.
Textures can be selected either from WAD texture collections, or from image folders on your PC. Any number of WADs or folders can be added to your map for selecting textures from them. For adding a WAD, right click on [Presets / Textures] and select [Add WAD]. For adding a folder with images, right click on [Presets / Textures] and select [Add Folder]. The WAD or the folder then appears in the [Textures] window, and the textures inside are available for the block surfaces.
You can import your own textures into a WAD collection. For this, first add the WAD as described above, and open it in the [Textures] window. Right click inside the WAD and select [Add Texture]. Then navigate to the image file that you want to add. Please note that you can't use just any image; surface textures images must fulfil some requirements listed below:
- They should be tiled,
which means that they fit together at all 4 edges and repeat endlessly (see image).
- Their width and height should be a power of 2, like 64, 128, 256,
512 etc. They need not be quadratic - sizes like 64x128 or 8x256
are possible. Textures with non power of 2 sizes can theoretically also be used, but are then automatically resized by
the engine, which reduces the rendering quality, consumes memory, increases
load times, and will look wrong in the preview windows.
-
Except for sky cubes, textures should not exceed 2048x2048 pixels because some 3D cards can't render bigger textures. If the 3D card does not support the texture size, the texture is automatically scaled down, however at the price of loading time and quality. Old 3D cards work
best with texture sizes of 256x256 or below; sizes above 256x256 render
noticeably slower.
- Image file names must not contain spaces and must not exceed 15 characters.
-
The image color depth should be 24 bit (True Color). 8 bit (indexed color with palette) can be used, but is not recommended. 32 bits transparent images can not be used for normal surface textures, but they can be used for special purposes, such as specular maps or heightmaps (see below).
-
The image file format must be either PCX, BMP, TGA, or DDS; other file formats are not suited for surface textures (see also file formats).
Image formats for surface textures
The image format does matter. For high quality, use the TGA 24-bit format;
for low memory consumption and fast rendering, use the DDS DXT1 format. PCX or BMP textures are internally stored in medium quality 16 bit color depth. 8 bit (256 color) palettized PCX and BMP textures are also supported for legacy reasons, but
must share the same color palette per level, and have low quality. The first color of the palette (color
#0) must always be black, the last color (color #255) must always be white.
If you don't know what a palette is, or if you don't need to support very old PCs, don't use 8 bit textures.
PCX and BMP textures can be automatically converted to the DDS 4-bit
compressed format on level loading depending on a script setting (d3d_texdepth).
The 4 bit format reduces the texture quality further and increases the level
loading time due to the conversion process, but can save a lot of video memory.
Native DDS images can be created with the DirectX Texture Tool, with ATI's
Compressonator or with a DDS plugin for Photoshop. They can contain mipmaps
and use a compressed 4-bit surface format (DXT1) for saving video memory
at the expense of image quality. They
have the advantage of small level
file sizes, fast loading, and fast rendering, and are the preferred format for all medium quality surface textures.
4 mipmap levels for TGA, PCX, and BMP textures are automatically created when compiling the level. Mipmaps increase both the rendering speed and the visual quality of far away textures. DDS textures contain their own mipmaps, so no extra mipmaps are created for them.
An alpha transparency channel is contained in 32 bit TGA textures and on DXT2..DXT5 DDS textures. Surface textures must not be transparent, but alpha channels can be used for shader effects, for instance for a specular map. For transparent objects in the map, use entities.
Sky Textures
A texture with a name beginning with "sky" can be assigned
to the walls of the sky box around the level. The texture proportions
determine the kind of sky mapping. If it's width is twice it's height, it's first
half is used for moving clouds below a sky dome and
it's second half is used for the sky dome texture (see image).

If it's width is six times it's height, the texture is used for a sky
cube around the level (see image below). For displaying the sky cube in
the 3D window, activate 'Sky Cube' in Preferences
-> Advanced.

More complicated multi-layered skies can be defined by script; see the sky
entity section for details.
Normal Maps
If a texture name ends with "_n"
, the texture is used as a normal map for a base texture with the same name. For instance, a texture named "stones2_n" is expected to contain a normal map for the texture "stones2". The normal map needs not be applied to a surface - it's automatically included with the texture. But for using it you need to apply a material with a normal mapping shader (for details see How To Appy Shaders). Several normal mapping materials are included in the mtlFX.c library. If a normal map has an alpha channel, it is used for a height map in the parallax and occlusion shaders.
Memory Requirement
Video memory is consumed by the textures as well
as by the shadow mapped surfaces in the map.
Due to the mipmaps, each TGA texture pixel consumes about
6 bytes
of video memory. Every 64 surface pixels consume 1..4 additional bytes
for the shadow maps (depending on the light resolution).
On levels with huge surface areas, the shadow maps can easily consume several 100 MB. For reducing the shadow maps, prevent shading by using the Flat surface flag on large surfaces.
If the video memory
available on the 3D card is exceeded, the game will still run, but will swap
textures, which may result in slow rendering and sudden 'jerks' at some places in
the map. You can check the current video memory consumption through the [F11]
engine panel.
► latest version online