Making Textures For Quake
revision: Nov 21, 2002

The following is everything I know about the technical side of creating textures for id Software's Quake. I decided to collect it all on a webpage because there are still people out there who don't know this stuff and are making textures anyway!

The Quake palette
The Quake palette
General Info
Quake textures are 8-bit paletted images which are stored in wad2 files (*.wad) for use by the level editor and qbsp, and then stored in the level itself (*.bsp) for use by Quake.

Texture names must be no longer than 15 characters. Names that start with certain characters or strings will be treated specially by both the game and the map compilers. These include sky, liquid, and animated textures, which are explained below. They also include the "clip" texture -- a texture named "clip" which mappers use to create invisible geometry which blocks players and monsters, but not gunfire.

All texture dimensions must be multiples of 16. There is no upper limit to height or width that I know of. The largest texture that shipped with the game is 320x192. Special textures such as sky and water have specific height and width requirements (see below.)

Liquids
Any texture whose name starts with "*" will be treated as a liquid by the compilers and by Quake. A name starting with "*slime" indicates slime. A name starting with "*lava" indicates lava. All other names starting with "*" default to water. All liquid textures must be 64x64.

Quake plays automatic ambient sounds when the player is near a sky, lava, slime, or water surface. When compiling a level, vis will calculate which of those sounds you should hear from each point in the level. But, most versions of vis (including id's original version) will only consider a texture to be water if its name starts with "*water" or "*04water".

One of Quake's sky textures
One of Quake's sky textures
Skies
Any texture whose name starts with "sky" will be loaded as a sky texture. Sky textures must be 256x128. They are composed of two 128x128 images, side by side. The left image is the front cloud layer, and the right image is the back layer. Any black pixels (index 0) on the front layer will be transparent. A Quake level can only have one sky. If a level contains more than one sky texture, quake will use the last sky texture it found while loading the level.

Animation
Any texture that starts with "+" will be loaded as an animation frame. Quake will allow animations sequences of up to ten frames, with names that start with "+0", "+1", "+2", all the way up to "+9". However long the sequence is, it must start at "+0" and be uninterrupted. For example, a valid sequence would be "+0butn", "+1butn", "+2butn" -- Notice that all the names are identical after the first two characters.

If a func_button, func_door, or func_wall bearing such textures is triggered, that entity will switch to displaying the textures that start with "+a", "+b", "+c", etc. The sequence can go all the way up to "+j". As before, you must start with "+a", and the sequence must be uninterrupted.

Fullbrights
The last 32 colors in the quake palette are fullbrights. In Quake they will appear to "glow in the dark," always being drawn at 100% brightness instead of being modulated by the lightmap. This doesn't apply to liquids or skies, which are not lightmapped.

GLQuake
The above information is accurate for all quake executables that use software rendering (quake.exe, winquake.exe, and qwcl.exe.) For executables that use OpenGL (glquake.exe and glqwcl.exe) there are a few differences:

» GLQuake doesn't require that liquids be 64x64.

» In GLQuake the total number of pixels in a texture cannot exceed 307,200. (this is more than enough to fit a 512x512 image.)

» If GLQuake detects 3dfx hardware (any Voodoo card, basically) it will impose a maximum height and width of 256 to all loaded textures. Larger textures will be sampled down to fit. And in fact, the early Voodoos did have a maximum texture size of 256x256.

» OpenGL requires that all textures have dimensions which are powers of two (1, 2, 4, 8, 16, etc.) When GLQuake loads a texture with non-power-of-two dimensions, it resamples it, very poorly, and passes it to OpenGL with power-of-two dimensions. So it's a good idea to make your texture dimensions powers of 2 to begin with, to avoid ugly resampling.

» GLQuake doesn't support fullbrights, and treats those 32 colors no differently than the rest.

» GLQuake has a couple of texture caching bugs which result in either a crash or the wrong texture being displayed. The crash occurs when GLQuake loads a texture which has the same name, but a different size than a texture previously loaded. This causes a "GL_LoadTexture: cache mismatch" error and GLQuake exits. The other bug occurs when GLQuake loads a texture which has the same name, and the same dimensions as one already loaded. When this happens, GLQuake will use the previous texture instead of loading the new one. What this means for you is: 1. Give unique names to your textures, rather than names that occur in id's or anyone else's texture wads. 2. Since clip textures must be named "clip" be sure to make your clip texture 64x64, to match the size of everyone else's.

Recap: Dimensions
So, given all this information, and given that you want your textures to work with all official quake executables, use the following guidelines when sizing your textures:

» Slime, lava, water, and clip textures should be 64x64.

» Sky textures should be 256x128.

» All other textures should have height and width each equal to one of the following: 16, 32, 64, 128, 256.