jigebren
pickup icon

Re-Volt texture exporter plugin for GIMP

This is a small plugin I wrote in Python to ease the task of exporting mipmap textures for Re-Volt from the powerful image retouching software GIMP.

screenshot

About mipmaps

Re-Volt, as a lot of 3D games, uses mipmaps to improve the texture rendering. Basically, mipmaps are a set of smaller images accompanying a main texture. For example if the main texture size is 256x256, the next mipmap image will be 128x128, then 64x64, etc. The smaller images would be used when the texture is viewed from a distance, thus improving the rendering speed as well as reducing aliasing artifacts.

In Re-Volt only two levels of mipmaps are used. The main texture uses the BMP extension, the smaller mipmap uses the extension BMQ.

With WolfR4, it's possible to patch the original Re-Volt executable to use more than 2 levels of mipmaps (and texture bigger than 256x256 as well). Patch v1.2 also directly supports any number of mipamps.
In both cases the textures extension would be BMP then BMQ, BMR, BMS and so on.

Here's an example of a mipmap set for the texture "sun.bmp" using 4 levels of mipmaps:

mipmap set example

To create mipmap one just have to resize the main texture to half its size, and repeat this step as many times as needed to create the whole set of mipmaps. It's quite simple but it can quickly become tedious and repetitive, moslty for a track with about ten textures. Not to mention that if you forget to update the smaller mipmaps when editing a texture, then the old texture version will still be used for far objects, and it will surely not look as expected (for a while you may even wonder what's going on). That's why it was generally a good idea to create the smaller mipmaps only at the very end of a track creation process, for example.

Now, this plugin makes the mipmaps creation as easy as a simple image export. You just have to set the number of mipmaps and all the mipmaps images files are automatically created.

Installation

Extract the file "export_rv_mipmaps.py" from the downloaded archive and place it into:

Windows XP:
C:\Documents and Settings\%username%\.gimp-2.x\plug-ins
Vista / 7:
C:\Users\%username%\.gimp-2.x\plug-ins
Linux:
$HOME/.gimp-2.x/plug-in
Remember that to make it usable on Linux you have to add execute permission to the users. Use the command below or check this GIMP/Installing Plugins page for more info.
chmod u+x ~/.gimp-2.?/plug-ins/export_rv_mipmaps.py

Launch GIMP. If the plugin is properly installed an entry "Export RV mipmaps..." should appear at the bottom of the "File" Menu.

The plugin was tested with GIMP 2.8. Older versions are likely not supported. Future versions may work...

The plugin is written in Python, so Python support has to be enabled during the GIMP installation (I think it is the case by default).

Bug report, suggestion or question can be posted on ORP forum

Download
Release date:
Format:
.zip
Size:
2.63 KiB

Texture export

  • Open a texture image file.
  • In the GIMP menu select File / Export RV mipmaps...
  • Choose the directory and filename to export the mipmaps to, set the number of mimpmaps if needed and press Ok.

Mipmaps can be exported to the following image formats: BMP, PNG and JPG. (Note that only BMP is currently supported by Re-Volt, even with v1.2 patch). The image format is automatically selected according to the filename extension.

The default mimpap filename is automatically suggested from the name of the image file you're working on.

Only the part before the first dot "." in the filename is used. For example, "imageA.bmp" will be suggested for "imageA.version_12-04-02.xcf". It makes versioning possible if you use a pattern like: "%texture_name%.%version%.%extension%" when naming your texture files.

The last-used export name is remembered for each texture image during the whole Gimp session. The last export directory is also remembered during the Gimp session.

If several texture images share the same filename (ignoring the part after the first dot), the same last-used export name will automatically be suggested for any of these images.
If you're working with several texture images that are in the same directory (eg. for a track), the same export directory will automatically be suggested for any of these images.

It may be iteresting to notice that the image is resized before the layers are merged. It'll preserve the sharpness on the edges of a layer when this layer has been properly cropped to be smaller than the whole image (for example when a texture is divided in four sqare areas). That's something that can't be achieved when direclty resizing the exported BMP image, as it's usually done. To be honest, I'm not sure it does make a noticeable difference when displayed in-game though...