Builtin Library
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, whichentity:hide()/entity:show()set on the entity and each descendant.- the mesh instance's
visibleflag, read asecs.get(id, ecs.Mesh).visible.entity:setActive(false)reaches it through the model component's disable, and an authoredModel.visible/SkinnedModel.visiblesets 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.