This repo contains a set of tools, originally made by Kazade, developed to rip and convert resources from the 1996 racing game called Ignition. I fixed transparency issues in these tools.
Added alpha blending using the game's SHD file. The original game didn't do true alpha blending, instead used a file as a look-up table. The plugin now converts this table into modern RGBA values. It may take several seconds to convert values.
Also found the polygon type flag in the MSH file. It identifies if a texture is opaque, uses color key, or uses alpha blending.
It's a precalculated alpha blend look-up table. The file contains 256 palette transformation blocks, nothing else. Each block references colors of the palette from the COL file.
When reading polygon information from the MSH file, the first 32-bit value was unknown. The last two hexadecimal digits can be used to identify texture rendering mode. I suspect that the second variation is for a polygon with disabled collision detection.
| Polygon type | Rendering mode |
|---|---|
| 0x11 or 0x15 | Opaque |
| 0x12 or 0x16 | Opaque with color key |
| 0x13 or 0x17 | Alpha blend |
- Texture loading based on CatzHoekk's code.
- Textures no longer upside down when exported.
- Material effects: disabled shininess, disabled anti-aliasing, enabled backface culling.
- Added material for opaque textures that use color key.
- Added material for textures that use alpha blending.
- Exporting textures is now optional, disabled by default.
- Loading into a single mesh is now optional, enabled by default.
Mesh loader by Kazade (Luke Benstead)
Texture loader fix by CatzHoekk
Transparency fix by SeriousCsaba
- Converted the original pic2tga.cpp code into a PowerShell 5.1 script for easier use.
- Modified it to produce PNG files instead of TGA.
- Fixed anti-aliasing.
Palette from a transparent PIC file stores gradients to be used for visual effects. The gradients are usually RED, BLUE, GREEN shades. Sometimes grayscale. Since the game can't do true alpha blending, it probably looks up these gradients in a PAN or a TAB file. I'm not sure. The converter currently uses a different approximation based on a simple 1/6 rule. It's much faster and gives similar looking effects.
Note
For a PIC that doesn't use transparency, the palette from 0x00 to 0x9F is filled with actual colors.
| Palette range | Description | Color |
|---|---|---|
| 0x00 | Color key. Used as a background color. RGB values are ignored, alpha is set to zero. | RGBA(255,255,255,0) |
| 0x01-0x05 | Black AA gradient. Used for anti-aliasing around edges. Original RGB ignored, uses BLACK with alpha incrementally increasing. | RGBA(0,0,0,A) |
| 0x06-0x09 | Highlight gradient. Used for shiny highlights, mostly on glass. Original RGB ignored, uses WHITE with alpha incrementally decreasing. | RGBA(255,255,255,A) |
| 0x0A-0x0E | White AA gradient. Used for anti-aliasing around edges. Original RGB ignored, uses WHITE with alpha incrementally decreasing. | RGBA(255,255,255,A) |
| 0x0F-0x9F | Unused colors. | |
| 0xA0-0xFF | Standard opaque colors. These are colors used throughout the game, almost everywhere. | RGBA(R,G,B,255) |
pic2tga.cpp by Kazade (Luke Benstead)
Transparency fix by SeriousCsaba