Textures - cterveen/upkg GitHub Wiki

Textures are the images displayed on surfaces or Brushes or Meshes.

Objects

A Texture object can have one of multiple formats which is determined by Texture.Format. In the UT_Package_Format_document TEXF_P8 (8 bits, paletted) and TEXF_DXT1 (DirectX-1 format) are desribed while TEXF_RGBA7, TEXF_RGB16, TExf-RGB8 and TEXF_RGBA8 are mentioned. TEXF_P8 is the default format and is described here.

Texture object

The texture object contains the information for each MipMap.

Format

  • objectproperties
  • byte - MipMapCount
  • each MipMapCount
    • if (Version >= 63)
      • long - WidthOffset
    • index - MipMapSize
    • each MipMapSize
      • byte - MipMapValue
    • long - width
    • long - height
    • byte - bitswidth
    • byte - bitsheight

Object properties

  • Format = Texture format
  • Palette = Object reference to a Palette
  • To be completed

Palette

A Palette object is a list of colours used in a TEXF_P8 texture.

Format

  • objectproperties
  • index - PaletteSize
  • each PalletteSize
    • byte - Red
    • byte - Green
    • byte - Blue
    • byte - Alpha

Object properties

  • None?

Creating a texture

TEXF_P8

An image is a long list of pixels tailored to the width (and height) of the image. The color of each pixel is defined in MipMapValue which is an index to the Palette object.

TEXF_DXT1

To be explored, from UT_Package_File_Format document: Search for “Opaque and One-bit Alpha Textures” in the Microsoft Platform SDK documentation.