Log inGet started
Package

EcsTessellation.module

Newest version

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

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^level micro-tris per source triangle. Under mode = "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 report status = "rejected_mode".
  • screenError — target micro-triangle edge in pixels, which mode = "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)/2 lattice a patch carries at activeLevel, n = 2^activeLevel.
entity(id).component.add("Tessellation", { level = 4, displacementScale = 0.05 })