Commit Graph

15 Commits

Author SHA1 Message Date
021da1d4e5 Merge pull request #2905 from Vonsek 2026-11-22 15:13:02 -05:00
82a9bf392b Merge pull request #2875 from Vonsek 2026-11-22 15:12:47 -05:00
52188b7c7e fix(assets): use stored transforms for GPU instance bounds
The GPU instancing accessors round transforms to float32. Bounding a mesh with the source values can miss the transformed geometry stored in the GLB.
2026-11-22 19:39:32 +01:00
9c4c8ba5b7 fix(assets): refresh world textures between builds
Single-worker world builds share a process, so caching only by DDS path and output size can reuse stale pixels from a previous build.
2026-11-22 19:34:54 +01:00
e2340a7def Merge pull request #2638 from Vonsek 2026-11-22 13:16:43 -05:00
cd7bcc34a3 Merge pull request #2566 from Leo Leahy 2026-11-22 13:16:14 -05:00
b5654ad722 Merge pull request #2517 from Vonsek 2026-11-22 13:15:52 -05:00
002d3a7880 fix(tools): use finer draw distance for missing LOD boundaries
A missing child distance previously collapsed the finer draw band even when the exported placement recorded its draw distance.
2026-11-22 18:40:10 +01:00
bf7a95dc79 world_build: prune obsolete --lod-sets chunks on rebuild 2026-11-22 14:31:02 -03:00
bdda2a5da5 fix(tools): keep indexed materials in instanced GLB exports
The instanced writer resolves its materials from packed primitives, so dropping an indexed binding during packing made the mesh use default clay.
2026-11-22 18:19:47 +01:00
4caf9bb42b Merge pull request #2283 from Vonsek 2026-11-22 11:43:45 -05:00
f47a241f03 fix(tools): cache world textures by source and size
A one-worker build can reuse textures from an earlier build in the same process. Include the requested size in the cache key so subsequent builds embed the expected resolution.
2026-11-22 17:34:14 +01:00
dbd5392124 Test LOD set validation and non-tier placement filtering 2026-11-22 16:16:57 +01:00
90978a9f7e world_build.py: preserve numeric archetype hashes in placements 2026-11-22 12:49:36 +01:00
99a40c54b1 world_build: instanced placements with bounded memory, and LOD chunk sets
--placements used to copy a model's geometry into every placement and keep
all copies until chunking (#1183 review: 22 GB for a 700 m box). Now each
model's OBJ is parsed once into a packed cache file, each chunk stores every
model it uses once, and the placements are instance transforms:
EXT_mesh_gpu_instancing by default (three.js GLTFLoader reads it), one plain
glTF node per placement with --instancing nodes, or the old baked copies
with --instancing bake. Chunks are written as soon as they are built; with
--jobs N, packing and chunk writing run in N processes, at most 4N jobs in
flight. Memory is about 100 bytes per placement plus the models of the
chunks being written.

Every instance TRS has a positive determinant. A negative XY scale is folded
into the rotation; a negative Z scale draws a mirrored copy of the mesh
(glTF Y negated, winding reversed). Zero-scale placements are counted as
degenerate_scale. iter_placements streams the rows load_placements selects,
with the same checks (load_placements is unchanged).

--lod-sets builds one chunk set per lodLevel tier (c_<tier>_<x>_<z>, with
the tier and grid cell in each chunk record) and writes lod_bands to
world.json: a camera-distance band per tier from the entities' median
childLodDist/lodDist. The viewer loads a tiered chunk while the horizontal
distance to its cell is in the band (32 m slack before unloading), so each
cell shows one tier; worlds without lod_bands stream as before, and the
manifest check rejects unknown tiers, unordered bands and missing cells.

glb_writer: pack_primitive and _MaterialTable are factored out of build_glb
(output unchanged), plus build_instanced_glb / write_instanced_glb and
instance_bounds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:02:54 +00:00