build engine: docs/guide sections (ART tiles, Build maps) with inputs from tools/fixtures/docs_build.py, bench lines, type fixes; bundles rebuilt
This commit is contained in:
1 parent
aacc78fac2
commit
082ea2019e
10 files changed
+3575
-1085
No files matched your search
+19
-1
@@ -1,7 +1,7 @@
|
||||
# Images
|
||||
|
||||
Every image format (PNG / APNG, JPEG, WebP, GIF, BMP, TGA, QOI, TIFF, ICO / CUR, PNM / PAM / PFM, Radiance HDR,
|
||||
OpenEXR, the [game textures](#game-textures) DDS / KTX / VTF / BLP / TIM, and the [older formats](#formats) PCX, SGI,
|
||||
OpenEXR, the [game textures](#game-textures) DDS / KTX / VTF / BLP / TIM / ART, and the [older formats](#formats) PCX, SGI,
|
||||
Sun Raster, ILBM, XPM, XBM, ICNS, ANI) loads as one `Image`: a width, a height, a pixel format and one tightly packed `buffer`. Animations (GIF, APNG, animated
|
||||
WebP) and multi-image files (TIFF pages, ICO entries) add a list of `Frame`s. Editing goes through `F.ops.image`.
|
||||
|
||||
@@ -214,6 +214,23 @@ local small = assert(F.image.load(vtfBytes, { mip = 1 })) -- or face = n (cub
|
||||
assert(F.detect(tim) == "tim")
|
||||
```
|
||||
|
||||
Build engine ART files (`TILES000.ART` ..., Duke Nukem 3D, Shadow Warrior) hold many tiles: each is one entry of
|
||||
`frames` (in tile order, empty tiles 0 x 0), with its tile number in `meta.tile` and its picanm animation and centre
|
||||
offsets in `meta.picanm`; the top-level image is the first non-empty tile. Colours come from the game's
|
||||
`PALETTE.DAT`, passed as `palette` or found next to the file through `resolve` (without it the tiles decode as a grey
|
||||
ramp). Index 255 is transparent. `shade` / `pal` apply a PALETTE.DAT shade table / a LOOKUP.DAT palookup, `native`
|
||||
keeps the palette indices (gray8), and ART writes back from either form:
|
||||
|
||||
```luau
|
||||
local tiles = assert(F.image.load(artBytes, { palette = paletteBytes }))
|
||||
local second = tiles.frames[2].image
|
||||
assert(second.meta.tile == 1 and second.width == 8)
|
||||
assert(second.meta.picanm.type == "forward" and second.meta.picanm.frames == 2)
|
||||
local raw = assert(F.image.load(artBytes, { format = "art", native = true }))
|
||||
assert(raw.frames[1].image.format == "gray8")
|
||||
assert(buffer.tostring(assert(F.save(raw, nil, { format = "art" }))) == buffer.tostring(artBytes))
|
||||
```
|
||||
|
||||
Doom's graphics come from WAD lumps rather than files: `F.format("wad").image(wad, name)` (see
|
||||
[archive.md](archive.md#game-archives)).
|
||||
|
||||
@@ -233,6 +250,7 @@ Read and write unless noted; see [FORMATS.md](../FORMATS.md) for depths and deta
|
||||
| TIM | | yes | PlayStation; 4 / 8-bit CLUT, 15 / 24-bit |
|
||||
| BLP | | yes | Blizzard BLP1 / BLP2 (DXT through the BCn codec); writes BLP2 BGRA |
|
||||
| VTF | frames | yes | Valve; read only; mips / faces / slices by option |
|
||||
| ART | tiles as frames | index 255 | Build engine tiles; palette from PALETTE.DAT (`palette` / `resolve`), picanm in `meta.picanm` |
|
||||
| DDS, KTX / KTX2 | faces / layers / slices | yes | GPU textures: BC1..BC7, ETC / EAC, every uncompressed layout; mips in `meta.mipmaps` |
|
||||
| OpenEXR | parts (`opts.part`) | yes | half / float / uint, NONE / RLE / ZIPS / ZIP / PIZ, tiles; writes NONE / ZIPS / ZIP |
|
||||
| PCX, SGI, Sun Raster, IFF ILBM / PBM, XPM, XBM | | yes (XBM 1-bit) | old paint / workstation formats; ILBM reads HAM and EHB |
|
||||
|
||||
Reference in new issue
Block a user