Last modified 8 months ago Last modified on 09/18/11 07:39:14

Here is a small guide for TCMask #851 feature. To use it you must have at least a 3d model file (.3ds or similar) and a diffuse texture. You'll have to make a .pie file from your model and a special mask from diffuse texture. Plus you'd make some modifications to game's .wrf files if you're going to test your work.

If you have a .3ds file then you'll need to convert it into PIE format with 3ds2pie. Grab renewed 3ds2pie win-tool (requires VC++ 2008 SP1 Redistributable Package (x86) to run) or compile it from source by yourself. Just check 'Enable TCMask texture' during conversion to activate the feature for your model or it will not work.

If you got a .pie file by other means then you'll need alter it to enable masking. Open .pie file in your favorite text editor and change standard type from

TYPE 200

to

TYPE 10200

It's unlikely to happen, but you will need to add 10000 to any other value. Consult with PIE3 format specs, if you'll detect something unusual.

Now you should prepare a diffuse texture. For example I'll take some standard WarZone texture .

After you've identified some area that will use team coloration make this area monochrome (try to keep you color range with decimal values 96+-48). In fact, this feature could take 3-rd frame from old team animation and give you all the other colors. Here I've converted 1-st 'green team' frame to monochrome colors:

Diffuse texture


Using the same area you'll need to create a special TCMask texture. It will only utilize alpha channel:

  • Coloration area should be filled with opaque black color #000000FF
  • All other pixels should be completely transparent #00000000

TCMask texture


You may save it as 1-bit alpha .png file.

TCMask texture name is expected to be in form of 'page-<diffuse page number>_tcmask'. For previous example it's the following pair: 'page-16-droid-drives.png' and 'page-16_tcmask.png'.

To test your model in-game:

  1. Add as new one or replace some existing model with your TCMasked .pie
  2. Add/replace diffuse texture into 'texpages' folder
  3. Add mask texture into the same 'texpages' folder
  4. Modify limiter_tex.wrf and vidmemX.wrf files (grab them from mp folder for skirmish mods) with TCMASK line:
    file      TEXPAGE   "page-16-droid-drives.png"
    file      TCMASK   "page-16_tcmask.png"
    
  5. Run current master version of the game and check for results

Both diffuse and mask textures could be up to 2048px x 2048px is size. However it's best to keep some proportions between model's element size and its texture island size, so when textures will be downscaled in-game (for gfx adapters with small amount of video memory) it won't be too much blurred, like factory on the screenshots below The fact is that both factory and the lab do have same sized 1024px textures. All is fine when you set up game to use 1048px textures, but feel the difference when they are downscaled to 256px. If you can, please check you work at 512px at least.

Attachments