Texture Cooker

This feature has been introduced with version 0.20, with the purpose of automatically process and convert textures files provided as PNG (Portable Network Graphics) into DDS (DirectDraw Surface) texture files.

Workflow

The Texture Cooker will only convert 8-bit PNG files that are following the following naming convention:

Postfix
DDS Format
Usage
Postfix
*.color.png
DDS Format
BC7 sRGB
Usage
Diffuse and specular texture maps (with or without alpha channel)
Postfix
*.normal.png
DDS Format
BC5
Usage
Normal texture maps
Postfix
*.data.png
DDS Format
BC4 or BC7
Usage
Other grayscale texture maps, in linear space

Example of textures that would be converted to BC7 sRGB Example of textures that would be converted to BC7 sRGB

The automatic conversion happens as soon the game has to load a texture file that matches the requirements mentioned above.

During the conversion process, a temporary texture will be applied to the object(s) using that texture. The texture will appear once the conversion has completed.

The conversion time depends on the size of the textures, and the speed of your machine. The game’s performance will temporarily slow down during the conversion.

Locating the converted textures

The converted texture files will always be located inside Userfolder/<gameVersion>/temp, at the same relative location of your original texture file. (Learn more about the userfolder here )

If the original file is at

levels/GridMap/test

the converted file will be found in

Userfolder/<gameVersion>/temp/levels/GridMap/test


Usage in mods

When publishing a mod, only include the converted DDS texture files with it. Do not include the original PNG texture files!

Not including the cooked textures with your mod will cause them having to be cooked on the machines of every user that is going to use your mod

Place the converted texture files in the same location of the originals, no other changes are required. Even though your materials file will be pointing to the original PNG file, the game will automatically detect the converted DDS files (if exists) and load it instead.

Materials.json

When manually specifying textures in a main.materials.json file (e.g. creating a skin for a vehicle), point to the PNG texture file in the texture path. The game will automatically use the converted DDS texture file if it exists, otherwise it will first proceed to convert the PNG.

PNG specified in the material file, and console message indicating the successful import and conversion to DDS PNG specified in the material file, and console message indicating the successful import and conversion to DDS

Always keep an eye on the console to see the status of the conversion process, and eventual errors.

Page created: 16 April 2021, at 08:43
Last modified: 14 October 2021, at 19:57

Any further questions?

Join our discord