This tutorial will explain how you can store image data on the Dreamcast's PVR graphics chip for efficient drawing and compact storage.
List of texture formats: []
This table describes the color information that can be stored in textures.
|ARGB1555||each color channel has 5 bits, transparency is on or off|
|ARGB4444||each channel has 4 bits, use if you need a transparent gradient|
|BUMP||bumpmap format (stores angles for vertex displacement effects in lighting calculations), similar to a normal map|
|YUV422||mostly used for video decoding, uncommonly used|
There are also paletted texture formats which can be combined with the above color formats as well as ARGB8888.
4BPP_PAL (or 8BPP_PAL)
- Define an array of 2^4 = 16 (or 2^8 = 256) color values.
- Copy the array to the graphics chip, then send textures that use 4-bit (or 8-bit) indices into that array instead of 16 bit argb as pixel values.
ARGB8888 is slow when used with filtering.
You can set multiple palettes on the graphics chip at the same time (1024 bytes total), so they're not per-texture at all, but global.
Paletted textures are always twiddled and never strided.
Textures can be twiddled, VQ compressed, strided or mipmapped.
Pixels aren't stored row-by-row, but in a z-shape arrangement which puts neighboring pixels closer together. This makes texture filtering cheaper and you definitely want to use it. Twiddled textures must have power-of-two dimensions (e.g. 512x512, 256x1024).
Vector Quantization is a lossy texture compression. The Dreamcast graphics chip has special hardware to decode it, so you suffer no performance loss for the decoding step when texture data is read by it for drawing. Textures will use less video memory.
A way to draw non-power-of-two textures by defining gaps.
Each texture stores smaller versions of itself (512x256 -> 256x128 -> 128x64..). Makes textures 1/3 bigger, texture filtering cheaper and improves rendering performance when textures are displayed at a smaller than original size.
Converting art assets to Dreamcast texture formats
It is more efficient to convert your PNG/TGA/etc. art assets during the build process of your game instead of during runtime.
There are tools for conversion in the KOS utils folder. Be aware that the KOS conversion tool does not support non-square VQ textures, although it should. This conversion tool by tvspelsfreak offers support for that in addition to a handy preview feature []
Comparison between uncompressed and compressed
To see how useful applying the proper texture format is, check out this thread