Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit3bb1da2647

README.md

render_visibility

One derivation of "the frame reaches nothing this entity draws", taken from the state the renderer draws from.

local Vis = require("@builtin::modules.render_visibility")

Vis.switchedOff(entity.find("rock"))   -- true while nothing it draws is reached
Vis.showing(entity.find("chunk_0_0_0")) -- true / false / nil when it draws nothing

Three inputs decide it:

  • activeInHierarchy — the entity's own active flag and every ancestor's.
  • hidden — the entity's own hide flag, which entity:hide() / entity:show() set on the entity and each descendant.
  • the mesh instance's visible flag, read as ecs.get(id, ecs.Mesh).visible. entity:setActive(false) reaches it through the model component's disable, and an authored Model.visible / SkinnedModel.visible sets it as the field's own effect.

The hide flag and the component's visible field are separate switches: a mesh draws only while neither hides it, and re-applying a component's fields leaves a hide() in place.

switchedOff answers for any entity, including one carrying no renderable at all. showing answers only about a renderable, and returns nil for an entity that holds none — the shape a per-row visible column takes.