Builtin Library
README.md
RenderFeature
Runs a .renderFeature render pass for the lifetime of the entity carrying it.
A scene's features are listed together, each with its settings, on
RenderFeatures; this is the one-feature form. A feature already live on the
same asset is adopted rather than stacked a second time.
A render feature is authored content — a .renderFeature asset whose init.luau
returns { setup?, render, teardown? } and enqueues GPU passes every frame. This
component is the declarative way to keep one running: on awake / enable it calls
renderer.feature.create(feature), and on disable / destroy it tears the feature
down. A render feature is a global pass, so a single component on a single
entity drives it for the whole scene.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
feature | assetRef("renderFeature") | none | The render feature asset to run. |
Methods
:getHandle()— the liveRenderFeatureHandlethis component created (itsguidis the feature's stable id), ornilwhen disabled / before awake.
Persist
This component is the persist-side mirror of a live renderer.feature.create(…)
call. When you enable a render feature ad-hoc during play, the scene-authoring
freeze (tools.sceneAuthoring.acceptChanges) promotes the feature's source into a
.renderFeature asset and records it on one entity carrying this component — so
loading the scene re-runs the exact same render pass.
Example
local e = entity.spawn("acrylic_pass", {})
e.component.add("@builtin::components.RenderFeature", {
feature = asset.resolve("acrylic", "renderFeature"),
})