Builtin Library
README.md
ecs.Tessellation
Spec for the Tessellation component, which maps to the native Tessellation. Subdivides the entity's current mesh into 4^level micro-triangles and displaces them along the interpolated normal from the entity material's displacement map, then flips MeshInstance.mesh to the result. The entity's Material renders the tessellated surface unchanged.
Fields
level— subdivision level (0..=6);4^levelmicro-tris per source triangle. Undermode = "adaptive"this is the ceiling the derived level stays under.displacementScale— world-units of displacement per unit of sampled height. With no displacement map on the material, the surface is subdivided but left flat.mode—"static"holds the authored level;"adaptive"re-derives it from the entity's screen coverage each frame. Other values reportstatus = "rejected_mode".screenError— target micro-triangle edge in pixels, whichmode = "adaptive"picks the level for.status(read-only) — system-written lifecycle marker:""/"pending"/"ok"/"clamped"/"too_large"/"rejected_mode".activeLevel(read-only) — the level the installed mesh was baked at.outputTriangles(read-only) — triangle count of the installed mesh: source triangles ×4^activeLevel.outputVertices(read-only) — vertex count of the installed mesh: source triangles × the(n+1)(n+2)/2lattice a patch carries atactiveLevel,n = 2^activeLevel.
entity(id).component.add("Tessellation", { level = 4, displacementScale = 0.05 })