Jump to content

Resources/Texture

From HEModdingWiki

Textures are 2D textures used in all Hedgehog Engine games for a variety of purposes, such as texturing Models and SWIF UI elements.

Textures use the DirectDraw Surface (DDS) format, developed by Microsoft for use in DirectX.

DDS allows games to load textures more efficiently compared to other formats, and importantly, it supports mipmaps which are smaller versions of the same texture which can improve performance when rendering the textures at a long distance.

Hedgehog Engine games use a wide variety of DDS compression types. The standard compression most often used is BC7_UNORM, which is versatile in that it can support 8-bit RGBA colour (though bit depth can go higher), and it does not compromise on file size.

DDS Compression Types
Compression Uses
BC1_UNORM Heightmap Textures, Heightmap Normal Maps
BC4_UNORM Scale Density Maps, Material Heightmaps
BC5_UNORM Normal Maps
BC6H_SF16 Skycubes
BC6H_UF16 Image-Based Lighting Cubemaps
BC7_UNORM Albedo/Diffuse Textures, PRM Maps, UI Elements
R8_UNORM Splatmaps, Scale Area Maps
R16_UNORM Heightmap Tiles
R8G8B8A8_UNORM Light Probes
B8G8R8A8_UNORM RGB Tables
R16G16B16A16_FLOAT Light Probes

DDS files can be converted to different compressions or between other formats such as PNG using DirectXTex tools like texconv and texassemble. To determine encoding and other information about a given DDS file, texdiag can also be used.