docs/guide: Quake maps and BSP, WAD2 / WAD3, lmp / spr, Quake III shaders and skins; bench lines; q3skin sniff needs a path
This commit is contained in:
1 parent
175ca9e823
commit
1e69799c21
11 files changed
+663
-461
No files matched your search
+22
-2
@@ -214,8 +214,28 @@ local small = assert(F.image.load(vtfBytes, { mip = 1 })) -- or face = n (cub
|
||||
assert(F.detect(tim) == "tim")
|
||||
```
|
||||
|
||||
Doom's graphics come from WAD lumps rather than files: `F.format("wad").image(wad, name)` (see
|
||||
[archive.md](archive.md#game-archives)).
|
||||
Quake's `.lmp` pictures (qpics), `palette.lmp` and `colormap.lmp`, and Quake / Half-Life sprites (`.spr`) load
|
||||
too. Quake pictures and sprites are 8-bit images over Quake's palette, which is not redistributable: pass it as
|
||||
`palette` (768 bytes) or as `gfx/palette.lmp` through `files` / `resolve` (without it they load grey,
|
||||
`meta.source.palette = false`). Half-Life sprites carry their own palette. Sprite frames are `img.frames` on one
|
||||
canvas around the sprite's origin (`meta.origin`); frame groups give the delays.
|
||||
|
||||
```luau
|
||||
local disc = assert(F.image.load(discLmpBytes, { name = "disc.lmp", palette = quakePaletteBytes }))
|
||||
assert(disc.width == 24 and disc.meta.source.palette) -- index 255 is transparent
|
||||
local pal = assert(F.image.load(quakePaletteBytes, { format = "lmp" })) -- a 16 x 16 swatch
|
||||
assert(#pal.meta.palette == 256)
|
||||
local back = assert(F.save(disc, nil, { format = "lmp", palette = quakePaletteBytes }))
|
||||
assert(buffer.len(back) == buffer.len(discLmpBytes))
|
||||
|
||||
local flame = assert(F.image.load(flameSprBytes)) -- Half-Life: its own palette
|
||||
assert(#flame.frames == 3 and flame.meta.source.texFormat == "alphatest")
|
||||
local spr = assert(F.save(flame, nil, { format = "spr" })) -- version 2; version = 1 (Quake) needs palette
|
||||
assert(#F.image.load(spr).frames == 3)
|
||||
```
|
||||
|
||||
Doom's graphics come from WAD lumps rather than files: `F.format("wad").image(wad, name)`, and Quake / Half-Life
|
||||
textures from WAD2 / WAD3: `F.format("wad2").image(wad, name)` (see [archive.md](archive.md#game-archives)).
|
||||
|
||||
## Formats
|
||||
|
||||
|
||||
Reference in new issue
Block a user