Half-Life Zone Half-Life Zone
Loading Hi-Res TGA files into Trinity

Loading Hi-Res TGA files into Trinity

One of Trinity's big features is its external texture loader. This allows textures far, far beyond the original 512x512px limit of Half-Life to be used in-game. In theory you can have textures of any resolution however you're still of course bound by limits of system memory. Try to load a 700MB image from NASA's Mars Exploration Rover and you will probably run into problems.

TGA files should be uncompressed and either 24 or 32 bit. (Maybe 16 bit TGAs work too, I'm not sure)

Trinity by default checks the dimensions of TGAs and rejects any that are not power-of-two, meaning only images that are 32x32, 1024x1024 etc can be loaded in. This can be disabled inside the code quite easily and I'm not sure why it was put in to start with because non-^2 TGAs seem to work without a problem. Disabling this limit will be one of the tutorials we'll be making in the near future.

The hi-res TGAs are not built into the map, rather the regular low-res versions are used at compile time and they are swapped out for the TGAs when the map is loaded in Trinity.

Now, let's get onto actually making these textures work.

World Textures

The textures destined for use on world brushes (walls, doors etc) belong in gfx -> textures -> world. You need to name you textures after a texture from a WAD file. So for instance, if your shiny hi-res texture is going to replace the green carpet from Half-Life you would name it fiftiesflr04.tga. Now, in gfx -> textures there is a file named textureflags.txt. This is where the magic happens. In it you add:

world fifties_flr04 alternate

World specifies that this is a world texture and not a model texture, fiftiesflr04 is the name of our texture and alternate tells Trinity we want to use the "alternate" TGA we have made. Start up Trinity and load any map with the fiftiesflr04 texture in it and you should see your nice, hi-res texture there instead!

Model Textures


Our friends