Log inGet started
Package

RenderFeatures.component

Newest version

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

README.md

RenderFeatures

The scene's render features, on one entity: a list of .renderFeature assets, each with the settings it runs under.

entity(id).component.add("RenderFeatures", {
    features = {
        { feature = "@builtin::systems.reflections.ssr", settings = { intensity = 0.8, quality = "high" } },
        { feature = "@builtin::renderFeatures.outline" },
    },
})

While the component is enabled every listed feature is live. A feature something already runs — a script's renderer.feature.create, another entity's list — is adopted and configured rather than stacked a second time. Each feature runs its passes at the phase and order its own render(ctx) declares. Disabling or destroying the component takes down every feature it started; a feature it adopted runs on with the settings it ran with before.

Editing the list re-syncs it: an entry removed goes, one added comes up, and a changed settings table reaches the live feature on its next frame.

Each entry is an application of its asset, and the asset holds the one feature its applications run. A feature stopped from outside that asset (a script's renderer.feature.destroy, a render that raised) stays stopped until the list is applied again: an edit to the list or a settings table, or the component enabled again, starts it with the settings the list states.

settings are the knobs the feature's asset declares — renderer.feature.schema("@builtin::systems.reflections.ssr") lists them with their defaults. A knob the feature does not declare, or a value of the wrong shape, is refused by name in the log.

Methods: :getHandles() — the live handles this component holds, keyed by the feature asset's guid.

For code that tunes a feature at runtime — a quality slider, a cutscene — renderer.feature.find(ref) and renderer.feature.configure(handle, settings) reach the same knobs without an entity.