Skip to content

Feature/auto lod - #117

Merged
mattvb91 merged 5 commits into
devfrom
feature/auto-lod
Dec 2, 2026
Merged

mattvb91 merged 5 commits into
devfrom
feature/auto-lod

Conversation

@mattvb91

@mattvb91 mattvb91 commented Dec 1, 2026

Copy link
Copy Markdown
Member

No description provided.

Models get an Auto LOD option. Each mesh is split into clusters of about
128 triangles, then groups of neighbouring clusters are simplified to half
with their shared borders locked, level by level, into a hierarchy
(meshoptimizer). Each frame the renderer draws, per cluster, the coarsest
level whose error stays under a pixel threshold, so detail falls off
across a mesh without cracks or popping between hand-made LODs.

- AutoLod/buildClusterDag builds the hierarchy; selectClusters picks the
  clusters for a view; AutoLodMesh swaps a mesh's index buffer for the
  chosen clusters, sharing its vertex attributes and material
- The clusters are saved as <model>.lod.bin next to the model through a
  new dev server endpoint, and built while loading when missing or stale
- Model props autoLod and lodErrorPixels, with fields in the Properties
  panel (scene objects can now give the panel fields, and an info field
  shows text), and a cluster view and triangle count in Render debug
- Skinned, morphing, instanced, multi-material and small meshes stay as
  they are
…connect

- The sky system waited for the connection with geckos' socket.onConnect(),
  which starts another connection: the second WebRTC handshake broke the
  first ("Cannot set a local answer in state stable"). NetworkManager now
  triggers `connect`, which the sky listens to instead
- The editor's sync overlay and Network panel no longer poll
  GET /api/game/dev/net/sync. They send cl_sync_watch, and a dev server
  sends sv_sync then and whenever the sync changes, checked up to 4 times
  a second. Counters that move every tick don't count, so an idle world
  sends nothing. The HTTP endpoint stays for the CLI and MCP tools
… mode

- Vegetation and scatter brush entries get an Auto LOD option: their
  instanced meshes draw fixed levels of detail cut from the model's
  cluster hierarchy, per Foliage chunk or per scatter instance by distance
- Each imported model has a max triangles setting, its finest detail,
  saved next to it as <model>.lod.json and followed live by every Model
  and brush using it. Set in the asset preview, a Model's properties and
  the Poly Haven preview, which shows the model at that cap
- LOD distance slider on Models; an LOD levels shading mode colouring
  Auto LOD triangles by level
- The dev server saves Auto LOD files next to models a plugin imported
- Vegetation groups save on their own after each edit, rather than only
  on Save, so models dragged in aren't lost when the panel reloads
…r groups

- Scatter brush and vegetation entries get lodScale and lodErrorPixels, with
  sliders in the brushes panel next to the model's triangle cap
- Cluster DAG building tries pruning loose pieces, then sloppy simplification,
  when edge collapses can't reduce a group; bump the LOD file version so
  existing .lod.bin files are rebuilt
@mattvb91
mattvb91 merged commit aaf9077 into dev Dec 2, 2026
27 checks passed
@mattvb91
mattvb91 deleted the feature/auto-lod branch December 2, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant