Commit Graph
151 Commits
Author SHA1 Message Date
4DBug 406b894635 ws-3d3: model/3ds writer samples camera / light channels through codecs/model/Sampler (drops its local sampler); scene.md intro wrap 2026-10-31 15:03:40 -05:00
4DBug 44cda7256c merge ws/3d3-b (model/lwo, model/x, model/iqm, codecs/model/Sampler; brings ws/game af4488d for codecs/model/Rig) 2026-10-31 15:02:25 -05:00
4DBug feb8d18cfb merge ws/3d3-a (model/3ds, model/ms3d) 2026-10-31 14:55:36 -05:00
4DBug 1d45c66108 ws-3d3-b: docs/guide/scene.md: LWO, .x and IQM (sections with tested snippets, Formats table, intro list) 2026-10-31 14:41:36 -05:00
4DBug 51daa00a67 ws-3d3-b: model/iqm (Inter-Quake Model v2 read + write: meshes, every vertex array format, joints -> skin, poses / frames / anims -> channels, bounds; writer merges skins, samples and quantizes animations); new codecs/model/Sampler (channel evaluation STEP / LINEAR + slerp / CUBICSPLINE, animation poses at a time) with tests
mrfixit.iqm matches assimp and an independent Python IQM reader (its skinning reproduces the bounds the IQM tool stored; ours matches it to 1e-4); round trips and glTF skinned models written by us are skinned identically by the Python reader.
2026-10-31 14:39:22 -05:00
4DBug 730820d1f6 ws-3d3: model/ms3d (MilkShape 3D) read + write
Groups, materials (texture uri), joints -> nodes + skin + one animation,
version 4 sub-versioned blocks (comments, vertex extras with up to four
bones, joint colours, model extras). Writer: groups per placed primitive,
the first skin plus animated nodes as joints (rigid meshes bound to them),
weights in percent. Tested against assimp and through glTF skin models.
2026-10-31 14:33:46 -05:00
4DBug de2695b87d merge ws/3d3-d (model/b3d, model/ldraw) 2026-10-31 14:30:17 -05:00
4DBug 8362dbafae merge master into ws/3d3 2026-10-31 14:30:01 -05:00
4DBug c3711a7ab1 ws-3d3: model/gltf: KHR_draco_mesh_compression through codecs/model/Draco
Draco primitives decode on load (attributes as their accessors declare them,
u32 indices), written back uncompressed without the extension; meshopt stays
UNSUPPORTED. Tests: transcoded Khronos samples (two quantizations), Draco's and
assimp's Draco glTF files, each Draco primitive byte for byte against libdraco,
against the uncompressed sources, round trips. Draco bench line; scene.md section.
2026-10-31 14:29:54 -05:00
4DBug e3ac2f8b36 ws-3d3-d: model/ldraw (LDR / DAT / MPD read: parts as shared meshes per colour, sub-models as nodes, BFC, LDConfig colours, library paths through files / resolve)
Built-in colour table from LDConfig.ldr (CC BY 2.0 / 4.0, licenses/LDRAW_COLOURS.txt + NOTICE.md row).
Tests: independent Python expansion + LeoCAD OBJ export of library parts / car.ldr / pyramid.ldr (read from the nix store).
2026-10-31 14:28:56 -05:00
4DBug a43d81538e ws-3d3: model/3ds (Autodesk 3D Studio) read + write
Meshes (smoothing-group normals, uvs, mesh matrix, per-face materials), Phong
materials with texture maps (uri), cameras, lights, the keyframer (hierarchy,
pivots, instances, dummies, position / rotation / scale / camera tracks ->
one animation). Writer: objects, materials, cameras, lights, keyframer.
Tested against assimp (test models, its 3DS exporter, and reading our files).
2026-10-31 14:19:08 -05:00
4DBug 4f05c89f01 ws-3d3-b: model/x (DirectX .x read: text, binary, MSZIP tzip / bzip, 32 / 64-bit floats; frames, meshes with normals / uvs / colours, materials and textures, skins, animation sets); assimp's test models plus bin 0064 / tzip variants match assimp's counts, bones, animations and world bounds 2026-10-31 14:17:28 -05:00
4DBug 9a6ddd5c16 ws-3d3: codecs/model/Draco: Draco decoder (port of Google Draco 1.5.7, Apache-2.0)
Meshes (sequential; Edgebreaker standard / predictive / valence, topology splits,
attribute seams) and sequential point clouds, bitstreams 1.0 - 2.2; generic /
integer / quantization / octahedral normal attribute decoders; difference,
parallelogram, multi and constrained multi-parallelogram, tex coords (deprecated
and portable, exact int64 arithmetic) and geometric normal predictions; metadata.
Byte-exact against libdraco on 196 files (Draco test data 0.9 - 2.2 and
draco_encoder outputs at every level / quantization). kd-tree point clouds:
UNSUPPORTED for now.
2026-10-31 14:14:50 -05:00
4DBug 5bbb4227c2 ws-apifix: API.md / STYLE.md / README: music as audio, video as animated image, F.save extra files, variant(r), caps.extraFiles, F.music builder, bitrate in bit/s; type baseline 92 2026-10-31 14:14:11 -05:00
4DBug 6274eedd12 ws-apifix: MP4 AAC length matches ffmpeg: the edit list's length (Track.playDuration) cuts the end padding as well as the priming (codecDelay); a 1 s clip decodes to 44100 frames, not 45056. AudioWrap.trim(dec, skip, length?); the MP4 writer keeps the edit length of copied audio. Video tests compare the whole decoded audio length with ffmpeg (not yet for Matroska) 2026-10-31 14:13:08 -05:00
4DBug ac47545aa3 ws-apifix: one bitrate unit: every encoder's bitrate option is bit/s (MP3 now too), values below 1000 are kbit/s (the old MP3 values keep working; Opus accepts them too); the MP3 Decoder's bitrate field is bit/s as the Decoder contract says (was kbit/s) 2026-10-31 14:06:51 -05:00
4DBug 29be8113b4 merge ws/game af4488d (codecs/model/Rig) for the IQM / X skins and animations 2026-10-31 14:05:51 -05:00
4DBug 1aaf8fce68 ws-3d3-b: model/lwo (LightWave LWO2 / LWOB / Modo LXOB read: layers with pivots and parents, polygons, VMAP / VMAD uv / colour / normal / weight / morph maps, surfaces and image blocks); 54 assimp test models match assimp's counts, materials and world bounds 2026-10-31 14:03:52 -05:00
4DBug 2f0ff81c95 ws-apifix: an outline font saved as BMFont writes its pages (opts.files; without a destination F.save returns them as a third value { [page file] = PNG bytes }; caps.extraFiles); pages named after the destination 2026-10-31 14:03:45 -05:00
4DBug 07dc6f7e84 ws-3d3-d: model/b3d (Blitz3D read: brushes, textures, node tree, skins, keyframe animation; LH -> RH) 2026-10-31 14:00:57 -05:00
4DBug d73b93c740 ws-apifix: videos save as animated images (F.save(video, gif | apng | webp), F.convert(avi, "gif"): frames / fps / maxFrames (300) / maxPixels (2^25)); VideoFrame.index restarts at the seek position; F.detect names WebM files "webm"
api: encoderFor finds image formats for a VideoDecoder, videoToImage() collects the frames; F.detect asks a
format's optional variant(r) for a more precise name (video/mkv: Mkv.variant, from Parse.docType).
codecs/video/Video: index after seek = round(pts * frameRate) + 1.
2026-10-31 14:00:36 -05:00
4DBug 10bd6b021f ws-apifix: music is audio (F.save / F.convert of a Module or Midi to an audio format renders it, render options from opts; F.audio.open / load render music bytes), F.music builder (ops/MusicOps: new, addPattern, setCell / getCell, addSample, addInstrument, note; also F.ops.music), MIDI writer writes track.name as a 0x03 event
api (init.luau): detectFor() falls back from audio to rendering music formats; encoderFor finds audio formats for
music values; renderMusic() through codecs/audio/Tracker or music/midi render.
2026-10-31 13:56:21 -05:00
4DBug 5af4aa361e ws-game: codecs/model/Rig (morph targets + weights animations, skeletons + skins, influences, joint TRS animations for the game model formats); codecs/image/Pixels.palette (RGB / BGR triples -> u32 palette; additive) 2026-10-31 13:54:43 -05:00
4DBug d41d64219a ws-game: archive/pak (Quake PACK / SiN SPAK read + write); containers/Archive: slice() lazy loader and collect() for simple archive writers (additive) 2026-10-31 13:52:17 -05:00
4DBug 25d8e4ff25 ws-apifix: F.ops.layers.flatten applies the mask of a passThrough group (codecs/image/Blend lerp takes a mask) 2026-10-31 13:50:05 -05:00
4DBug fca79bd858 ws-docs: guide pages cad, font, layered, music, playlist, subtitles, tilemap, video; runnable examples per category; README converting note 2026-10-31 13:25:10 -05:00
4DBug db81f73acf ws-docs: recipes: MIDI render, glTF to OBJ, vox greedy mesh, zip, CSV, SVG to PNG, TTF bake to BMFont, drawing text 2026-10-31 13:18:01 -05:00
4DBug 0552f0ebf8 ws-docs: guide pages archive, audio, data, image, scene, vector; recipes (first part); docs input generators 2026-10-31 13:16:12 -05:00
4DBug 001e746305 ws-docs: docs/guide/README.md (installing, inputs, detection, errors, options, saving, converting, hosts); LÖVE example: SVG tile, GIF played as a video with a per-update decode budget 2026-10-31 13:09:04 -05:00
4DBug 9941113b7b ws-cleanup: audio codecs out of the format folders (codecs/audio/Opus, Vorbis, Flac, Mpa)
The decoders / encoders are libraries, not the file format: audio/opus/{Celt, CeltTables, CeltEncoder, Mdct, Packet,
Silk, SilkTables, Decoder} -> codecs/audio/Opus; audio/vorbis/{Codebook, Packet, Setup, Tables} ->
codecs/audio/Vorbis; audio/flac/{Frame, Encode} -> codecs/audio/Flac; audio/mp3/{Core, Tables, Header, Encode2,
Encode3, EncTables, Analysis} -> codecs/audio/Mpa (tools/move.py; code unchanged). Each gets an index init.luau.
The format folders keep the file mapping: Ogg Opus / Ogg Vorbis (headers, granules, seeking, the Vorbis encoder's
Ogg writer), native / Ogg FLAC streams and metadata, ID3 / Xing / the MP3 frame index. docs: STYLE says a codec is
not the format. Full suite: 248 runs pass on both runtimes, lint green.
2026-10-31 12:47:02 -05:00
4DBug 44a599f00c ws-cleanup: codecs/compress/PackBits; UTF-16 and half floats from one place
- codecs/compress/PackBits (new, from image/tiff/Pixels): decode (lenient count + a clean flag for strict callers)
  and encode; image/tiff and layered/psd (which carried its own decoder) use it. tests/codecs/packbits.
- codecs/text/Text.utf16(buf, offset, length, bigEndian?): the UTF-16 -> UTF-8 conversion codecs/font/TrueType,
  archive/7z and layered/psd each wrote (lone surrogates -> U+FFFD everywhere now).
- image/tiff/Pixels and data/cbor use core/Bytes.half instead of their own float16 decoders.
2026-10-31 12:28:33 -05:00
4DBug 51b08575c4 ws-cleanup: codecs/ grouped by domain; containers/Chunks, codecs/audio/Stream, codecs/image/Pixels, codecs/model/Mat4
C2, the hierarchy (tools/move.py, every reference rewritten mechanically):
- codecs/compress: Deflate Lzma Zstd Brotli Bzip2 Lzw; codecs/entropy: Huffman (from core) RangeCoder;
  codecs/image: Jpeg Dct Vp8 Vp8L Yuv Quantize Raster Blend Pixels; codecs/audio: Mdct Aac Alac Pcm Resample
  VorbisComment Tracker SoundFont Stream; codecs/video: H264 Mpeg1 Video; codecs/text: Json Xml Text Url;
  codecs/font: TrueType Cff; codecs/model: MeshFlatten Mat4. containers/ stays flat; core/ keeps Bytes Bits Err
  Crc32 Adler32 Base64 Md5 Input Sniff.
- LAYERS lint: codecs must sit in a domain folder; gen_registry lists codecs by domain (docs/FORMATS.md).
- Checked: build.py both targets, rojo build of build/roblox, the full suite on both runtimes.

C3, generic code out of format folders:
- containers/Chunks (new): the chunked-file walker (RIFF / RIFX / IFF / PNG / CAF layouts: endianness, size first,
  trailer, padding, lenient missing pad, open-ended ids, size hooks). containers/Riff walks with it (RF64 ds64
  through the resize hook); image/png, audio/aiff and audio/caf list their chunk handlers over it.
- codecs/audio/Stream (new): Stream.packets, the packet-decoder Decoder (read / seek with pre-roll / position,
  priming and end trimming) that aac, caf and m4a each carried (~70 lines each).
- codecs/image/Pixels: image/bmp/Pixels promoted (+ rgb555); image/ico's DIB decoder uses its row loops instead of
  its own (the AND mask / alpha rule stay ICO's).
- codecs/model/Mat4 (new): matrices / quaternions / TRS shared by FBX (Xform keeps only the FBX transform model),
  Collada (Math keeps only <lookat> / <skew>) and USD (its matrix helpers and general 4x4 inverse); Mat4.mul is
  Types.Scene.mul. The Collada normal matrix is now the inverse transpose (it was the inverse; same result for the
  fixtures' bind shapes).
- README rewritten (install for Rojo and LÖVE / LuaJIT, quick start per category, F.* and F.ops, host notes:
  FORMATS_NO_JIT_TUNE, paths, layout); docs/STYLE.md: the codec domains, "what belongs in a format folder" with the
  shared building blocks and the DUP rule, conventions (WAVE order, lower-case tags, loops, the api hooks
  decodeImage / encodeImage / openAudio / plugins / resolve, the codecs/video/Video registry), Err.from, the type
  baseline. New tests: tests/containers/chunks, tests/codecs/mat4. Type baseline 93.
2026-10-31 12:25:03 -05:00
4DBug 6b26845afe ws-cleanup: merge master (ws/h264) 2026-10-31 11:12:11 -05:00
4DBug 45bb5f9b95 ws-cleanup: F.ops facade (image / mesh / layers / audio / vector.rasterize) and ops/AudioOps
- F.ops in init.luau, loaded on first use: F.ops.image (ImageOps), F.ops.mesh (MeshOps), F.ops.layers (LayerOps),
  F.ops.audio (new ops/AudioOps), F.ops.vector.rasterize (the vector/svg renderer for any Vector, through F.format).
- ops/AudioOps: toAudio / fromDecoder (Audio from a Decoder via codecs/Pcm), gain / gainDb / normalize, peak / rms,
  remix / downmix / upmix (WAVE-layout matrices, BS.775 coefficients normalised against clipping), resample
  (codecs/Resample), trim, concat and mix (inputs converted to the first one's rate and channels), fade.
- tests/ops/audioops (39 checks, both runtimes); docs/API.md (new): the F.* API, F.ops, hooks, host.
2026-10-31 11:06:04 -05:00
4DBug c0eafd29a5 ws-cleanup: consistency (lower-case tags, WAVE channel order, loops = play count, Err messages, caps)
- Audio tags keys are lower case everywhere (Types.Tags): FLAC no longer returns TITLE / ARTIST (the raw fields stay
  in meta.source.comments; also for Vorbis and Opus); Vorbis / Opus / FLAC read and write tags through
  codecs/VorbisComment (TRACKNUMBER -> track, DISCNUMBER -> disc, DESCRIPTION -> comment); MP3 albumArtist ->
  albumartist and year -> date (ID3 TYER / TDRC, ID3v1); RIFF INFO / CAF / MP4 freeform names are lower-cased (MP4
  writes iTunSMPB / iTunNORM back in their usual spelling; m4a reads tags.itunsmpb).
- Channel order: Vorbis (and Opus mapping family 1) decode to WAVE order like FLAC / WAV / AAC (both used to return
  the Vorbis order); the Vorbis encoder takes WAVE order and writes Vorbis order. Pcm.WAVE_FROM_VORBIS / Pcm.reorder;
  Vorbis.packetDecoder gives pd.order. Tests reorder oggdec's / opusdec's raw (Vorbis-order) references.
- img.loops is the play count in GIF, APNG and WebP (they already agreed; Types / WebP docs said "loop count");
  tests/api round-trips loops 0 / 1 / 3 through all three.
- Err: messages without the format name (png / midi encoders said "png encode: ..."); codecs/Bzip2 and codecs/Zstd
  check arguments through Bytes.span.
- caps: mp3 encodeLayers = { 2, 3 }, opus encodeChannels = 2.
2026-10-31 11:01:22 -05:00
4DBug 7271e6e3fa ws-h264: F.video.open end to end on MP4 / MKV / TS / AVI / raw H.264 (bit-exact vs ffmpeg), display-order pts from the sorted packet times; JVT conformance test (48 streams bit-exact vs JM yuv, 4 refused); video/mp4 writer: a video edit list plays every frame (the B-frame delay no longer cut 2 frames off the end); tests tune LuaJIT through host 2026-10-31 10:53:34 -05:00
4DBug 84101d919e ws-h264: merge master 2026-10-31 10:29:56 -05:00
4DBug d4486dccce ws-h264: merge ws/video; codecs/Video registers h264 (avc1/avc3/H264/... FourCCs, V_MPEG4/ISO/AVC) via H264.newVideoDecoder; video/h264 raw Annex B format (demux by access unit, copy-writer from MP4/MKV samples); MMCO 5 resets frame_num (JVT MR2/MR4/MR5); meta.yuv from the VUI 2026-10-31 10:29:56 -05:00
4DBug 2eaed46eea merge ws/video: containers mkv/avi/mp4/ts/ps/y4m (+writers), codecs Jpeg/Mpeg1/Vp8 inter/Video registry, AudioWrap, F.video.open 2026-10-31 10:22:17 -05:00
4DBug 3dd0b59784 ws-video: bench block (whole pipeline fps for MJPEG AVI / MPEG-1 TS / VP8 WebM / Y4M at 320x240 and 640x480, y4m -> MJPEG AVI), docs/video.md (API, layers, how a codec plugs into the registry), NOTICE row for mpegts-luau 2026-10-31 10:05:09 -05:00
4DBug f2a4a33713 ws-video: video/mp4 (MP4 / MOV / 3GP on containers/IsoBmff: edit lists, fragments, dOps -> OpusHead, PCM entries, AAC priming as codec delay; writer: copied H.264 / HEVC / AV1 / MJPEG / AAC / ALAC / Opus / FLAC / MP3, MJPEG from frames, PCM in MOV, edit lists for B-frame / codec delays); IsoBmff Mux writes no empty DecoderSpecificInfo (ffmpeg refuses it); writer checks extended to MP4 / MOV / H.264 remux 2026-10-31 10:02:25 -05:00
4DBug 17c00a15df merge ws/3d2 2026-10-31 09:55:41 -05:00
4DBug ba996820b5 ws-video: merge ws/video-codecs (codecs/Jpeg, codecs/Mpeg1) 2026-10-31 09:53:26 -05:00
4DBug e044209ab1 ws-video: merge master (m4a, music, ...) 2026-10-31 09:50:42 -05:00
4DBug aa4963dc27 ws-video: video/mpegts (containers/MpegTs absorbed from mpegts-luau 6e16197, its unit queue fixed for LuaJIT; M2TS, resync before the first packet, private stream types by PES id), video/mpegps (containers/MpegPs: MPEG-1 / MPEG-2 packs, PSM, private stream 1; pictures cut from the joined ES, PTS from PES / GOP temporal references; raw .m1v), containers/MpegEs; tests vs ffprobe / ffmpeg 2026-10-31 09:50:42 -05:00
4DBug b275bdb498 Merge branch 'ws/3d2-step' into ws/3d2 2026-10-31 09:47:00 -05:00
4DBug a4751298ed Merge branch 'ws/3d2-usda' into ws/3d2 2026-10-31 09:47:00 -05:00
4DBug dd453c336e ws-3d2: merge ws/3d2-dae (model/dae); registry regenerated 2026-10-31 09:47:00 -05:00
4DBug 312cd3c10e ws-3d2: merge ws/3d2-3mf (model/3mf); registry regenerated, bench lines merged 2026-10-31 09:46:52 -05:00
4DBug d4affd565e ws-3d2/fbx: model/fbx (binary 7.x + ASCII read, binary 7.4 / 7.5 + ASCII write): node tree, Objects / Connections -> Scene (full transform model, layer elements, materials, textures, skins, blend shapes, animation stacks, cameras, lights); tests against assimp + Blender, round trips, fuzz; bench lines 2026-10-31 09:46:25 -05:00