Lewis-Bright / dark-crusade-upscale-mod

A mod to upscale all textures 4x in Dawn of War - Dark Crusade
0 stars 0 forks source link

dark-crusade-upscale-mod

A mod to upscale all textures 4x in Dawn of War - Dark Crusade

This is all outdated and the workflow is now completely different, although this probably still contains some useful information

Current Workflow

Before any of this, make sure you extract the DXP2/DXP2Data-SharedTextures-Full.sga file using Relic's Mod Packager tool. When editing a texture, my basic starting point is to copy the file I want to edit to its own folder, then create a "new" folder at the same level as the file. This makes it easier to revisit old edits. At the moment I've only changed RSH and WTP files.

WTP files

I believe these files are used for any model which has a team colouring. They contain many different elements, the most important for us is the model_name_default.tga file. This is what we will be actually upscaling (the rest I'm just enlarging). Currently for WTP files I am doing the following:

function upscaleTo($defaultName, $newRes) {
    gimp-2.10 -i -b "(resize-image-keep-ratio \`"$defaultName\`" $newRes $newRes)" -b "(gimp-quit 0)"
}

but the basic usage is: gimp-2.10 -i -b "(resize-image-keep-ratio \"ig_imperial_captain_default`" 2048 2048)" -b "(gimp-quit 0)"`. (I use 1024 scaling for smaller images). It is important to note I haven't bothered with the badges as I don't really find them that useful (and they are a pain to make). If you want to make them then you can add the relevant line to the gimp script. After they have been made, you will need to convert that white square (that represents the badge location) back into a 64x64 square, as it doesn't work with a larger one (perhaps this would change if we found a way to resize the badge textures?) EDIT: I am now upscaling the other files with a deep learning tool, so this step is redundant. This is because the bleed through of the colours looks pretty rubbish if you just scale them with the above method.

RSH files

I think these are files for anything that is not affected by team colouring (buildings etc). These contain DDS files, which contain mipmaps. Mipmaps are essentially different resolution drawings of the same image, so that you can render smaller images if you need to. It's clear in Dawn of War that this is used when you zoom out, as the texture on certain buildings change (tested by drawing some random squiggles on different mipmap levels and seeing them appear at certain zoom levels). The important thing here (took me hours to figure out) is that you need to have a logarithmic sequence of resolutions for each of these. What I mean by that, is for a 64x64 texture image, you would need the following: 64x64, 32x32, 16x16, 8x8, 4x4, 2x2, 1x1. If you do not follow this sequence, you will get pink textures (although the texture tool will still compile these into RSH files, and the DoW logs will not tell you what is going on, just that it can't load them). ANnoyingly there seems to be a hard limit on this, and you can't have any more than 10 mipmap layers in the DDS files. This unfortunately gives us a max resolution of 1024x1024. I'm yet to find a way around this...

My steps are as follows:

Extra Tips

I'd advise starting a skirmish map, using cheats and getting yourself to the most advanced stage you can, then saving. That way you can immediately load up a game, and don't have to waste time capturing relics etc for a baneblade