mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-08-01 10:21:34 -04:00
Terrain streaming stalled ~165ms finalising a tile, and the phase timing put essentially all of it in one WMO_MODELS step: a single model taking 158ms against an 8ms budget. Within that load, group resource creation was 81% of the time — 131ms for 286 groups — with textures at 13% and merged batches at 6%, so the groups are what had to be split. loadModelIncremental uploads a bounded slice of groups per call and returns InProgress while more remain. The accumulating model lives in loadingModels_ until every group is up, so a half-built model is never visible to rendering, and its textures and materials are done once and skipped on resumed calls. loadModel keeps its old all-at-once behaviour for callers outside terrain streaming by looping until completion. The result is explicit rather than a bare bool, because the caller has to tell "more groups to come" from "this model failed" — overloading false would have spun forever on a bad model. Terrain finalisation now takes one model per step with a 6ms group budget, and no longer uploads two models per step when the loader threads are idle, which had doubled the worst case for nothing.