Texture Formats

Edit
Date: January 8, 2017
Authors: Marv
Categories: RVGL, Technical
Tags: car_making, track_making

Various new texture formats have been introduced in 15.1220a:

For historical reasons, the textures should still be named with the .bmp extension (and mipmaps with .bmq, .bmo, etc. as usual).

Available formats:

  • BMP
  • PNG
  • JPG
  • WEBP
  • TIF
  • GIF
  • CUR
  • ICO
  • LBM
  • PCX
  • PNM
  • XPM
  • XV
  • XCF

Support for XCF (GIMP's native format) is experimental. This allows you to visualize a GIMP project file in RVGL without exporting it. However, this is not guaranteed to work correctly in all cases.

Supports standard texture sizes that work with any graphics card. Your texture has to be square (i.e., same width and height) with power-of-two dimensions (like 256×256, 512×512, etc). We have currently set a safe higher limit of 8192×8192.

The legacy Re-Volt versions only support one texture size: 256×256. To learn how to make your track using hi-res textures backward compatible, see the Mipmaps section just below.

Mipmaps are low resolution copies of the main texture. Mipmaps improve both the performance and visuals of your content, especially when used with hi-res textures.

Several mipmap levels can be used, each level must be half the size of the previous and named with a different “.bm[p]” extension: the last character keeps increasing. (eg., a 256×256 “texture.bmp” will have a 128×128 “texture.bmq” file as the first mipmap level and a 64×64 “texture.bmr” as the second mipmap level).

We also allow the use of mipmaps that go upward (i.e., with the above mentioned example, you may include a hi-res 512×512 version called “texture.bmo”). By including your hi-res texture this way, you will be able to keep the actual “texture.bmp” file at 256×256 and enable your content to be played in legacy Re-Volt versions.

For a quick reference, here is a list of supported sizes and their corresponding file names, as per the above example:

-------- Size ------------ File --------
      8192 x 8192   -   texture.bmk
      4096 x 4096   -   texture.bml
      2048 x 2048   -   texture.bmm
      1024 x 1024   -   texture.bmn
       512 x 512    -   texture.bmo
     [ 256 x 256    -   texture.bmp ]
       128 x 128    -   texture.bmq
        64 x 64     -   texture.bmr
        32 x 32     -   texture.bms
        16 x 16     -   texture.bmt
         8 x 8      -   texture.bmu
         4 x 4      -   texture.bmv
         2 x 2      -   texture.bmw
         1 x 1      -   texture.bmx

Intermediate mipmap levels cannot be skipped. For example, do not include a texture.bmp” (256×256) and a “texture.bmn” (1024×1024) without a “texture.bmo” (512×512) inbetween.

For uses of mipmaps with hi-res textures, see: rvl

Mipmaps also find a third use as “texture sets”. The game will pick textures of the appropriate size to load, depending on the available system resources. Therefore, it is always recommended to include appropriate mipmap levels for your content.

[ HINT: Use the -texinfo command line to display the texture sets info that was detected for your system. ]

Supports bitmap textures with alpha channel for transparency data. Only 32-bit ARGB (A8 R8 G8 B8) format is supported.

Alpha channel transparency can be used to create rich and varied effects, eg., transparency gradients and well anti-aliased shapes. Colorkeying is disabled in this case, which means pure-black color (RGB 000) can be used freely on opaque surfaces.

[ NOTE: Care should be taken to save your alpha-enabled texture in the correct format ARGB. Some other 32-bit BMP formats such as XRGB, while creating a 32-bit bitmap file, does not save your alpha channel in the extra space. This would result in a fully transparent texture in-game. ]

[ NOTE: For example uses of 32-bit textures, see: ] [http://z3.invisionfree.com/Our_ReVolt_Pub/index.php?showtopic=1619

  • RVGL Changelog