Summed up

Upscaling is done with ESRGAN

The algorithm uses Manga109Attempt model

Output resolution is x4

Upscaling is done on characters, objects and skyboxes

Manga109Attempt model

Before using that combination I tried a couple more algorithms and models, but that one has the most authentic output.

Sometimes just upscaling textures is not enough, especially for characters. Some of them blink and such and that is controlled via .ATD files (procedural textures) which need to be altered for upscaled textures.

The algorithm doesn't upscale transparent textures by default. So alpha channel for these textures needs to be upscaled separately and matched with the new texture.

Regarding textures for level geometry

The textures that cover level geometry are not really easy to replace. For example, if you were to make any texture 4 times bigger it would take 4 times more space on surface, therefore upscaling like that wouldn't really work right away.

So far there are 2 theoretical solutions:

Decompile all maps, and replace the textures manually (pretty crazy idea, but nevertheless). It seems that resolution of lightmaps is tied to texture size of surfaces. There is a limit on how many lightmaps there can be (after filling 1 lightmap completely another one is created, and lightmap resolution affects how fast they fill). There is a limit on how many lightmaps there can be. Hack the game with hex editor to make it assume all the textures loaded are 4 times smaller than what they actually are and then upscale everything x4 times. That method actually works but only manually: Make a separate textures folder and name it textureshd (any name will do) Load the game and any map Rename the old textures folder to texturesold and textureshd to textures Run flushtextures command in console.

Credits to Laguna (Stiv) for the third solution. It actually works, however there needs to be some sort of a script to automate the process.

So the current solutions don't seem really trivial therefore, as for now, mod is focused only on upscaling of what is possible with the current tools.

Skies

Upscaling produces a little noise pattern which is fine to have on most textures. With skies it is not really fitting. The only exception is skies that have stars, the areas with stars are not denoised since they are apparently being recognized as a noise pattern and get toned down a lot.

Examples: 1 2 3

Compression

Most of the textures in the game use .TGA file format, the other files use .PNG. Not much can be done regarding .TGA to reduce the package size except for RLE compression. Using indexed color palette with .TGA images does not work, the following message appears:

ANOXGFX: ERROR: Color-mapped targa images are unsupported.

Regarding .PNG it is not easy as well, the game seems to not be able to recognize images with indexed palette, pointing out incorrect colortype value. Some textures are allowed to be indexed for some reason (Stiletto), but some are not (Boots).



