Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit44fd9e59bd

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

FieldTypeDefaultDescription
featureassetRef("renderFeature")noneThe render feature asset to run.

Methods

  • :getHandle() — the live RenderFeatureHandle this component created (its guid is the feature's stable id), or nil when 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"),
})