Log inGet started
Package

meshLod.package

Newest version

This package holds more than this page lists. See all of its files in its world.

README.md

MeshLod

Draws a cheaper mesh once the subject stops covering enough of the frame to show the difference. Sits beside a Model, whose mesh is level 0.

entity.find("rock").component.add("MeshLod", {
    lod1 = "@builtin::meshes.rock_mid", screen1 = 0.25,
    lod2 = "@builtin::meshes.rock_far", screen2 = 0.08,
})
fieldmeaning
lod1 … lod3successively cheaper meshes; a gap ends the chain
screen1 … screen3viewport-height fraction each level takes over below
hysteresisextra span required to climb back to a richer level

Each level is chosen from how much of the viewport's height the entity's own bounds span, so scale is already accounted for and one set of thresholds reads the same on a prop and on a landmark.

Setting lod3 while leaving lod2 empty stops the chain at level 1 — a chain with a hole would skip the level the author meant to draw.

Removing the component restores the mesh the Model started with.