Log inGet started
▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·part ofmodule generator.module·originates fromworld 07158574-5…

realize

Standing a cooked value as a Generator's children: a geometry, grid, bundle, population or asset reference realized under the generator, an output split into the pieces it realizes as, and the folding of outputs into the one bundle `apply` writes.

by◐lumi·posted 1mo ago
What it does

generator.realize

Standing a cooked value as a Generator's children: a geometry, grid, bundle, population or asset reference realized under the generator, an output split into the pieces it realizes as, and the folding of outputs into the one bundle apply writes.

One part of the Generator component. ~.generator installs it on a Generator instance's context table, gen, which the component makes once per instance: the part keeps its shared state and the operations other parts call as fields of gen, and what only it reads as locals of its install function, so every instance holds its own.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

generator.realize Standing a cooked value as a Generator's children: a geometry, grid, bundle, population or asset reference realized under the generator, an output split into the pieces it realizes as, and the folding of outputs into the one bundle `apply` writes. Installed on one Generator instance's context, `gen`, by `~.generator`: its state and the operations other parts call are fields of `gen`, and what only this part reads stays local to it.

ModelVolume

outputDomain(graph: any, outputName: string) → string

The domain an output declares, which says what one element of a geometry becomes. An output that names none has a geometry mean one mesh.

argtypedescription
graphany
outputNamestring

elementCount(value: any) → number

How many elements a presented value holds: the points of a geometry or a population, nil for a value that is not made of elements.

argtypedescription
valueany

baseName( ) → string

realizeGeometry(value: any, name: string) → void

Realize a Geometry value as one Model child, born temporary and parented under the owner.

argtypedescription
valueany
namestring

noFaces( ) → void

A runtime GPU mesh, not a persisted `.mesh` asset: the generator's live output is ephemeral and rebuilt on every change, so it must not write durable assets to the world source (that is what an explicit bake does). The mesh is owned by the Model and freed with it. A geometry holding no triangles — a burst before its first particle, a filter that kept nothing — has no surface to draw, and stands as nothing.

refreshGeometryInPlace(value: any, name: string, output: string, domain: string?) → boolean

A geometry output whose shape has not moved since its mesh was built stands as it is: only what it draws with is written again. Answers whether it did, so an output whose shape moved is built again instead. A mesh re-registered for every frame a material animates is an upload of the whole shape per present and a frame with no Model in it while the new one lands.

argtypedescription
valueany
namestring
outputstring
domainstring?

keyOf(m: any) → any

A material filed again under the key the Model draws with is the same material to it: the handle is a fresh table each time, so the key is what says whether the Model draws something else now.

argtypedescription
many

realizeGrid(value: any, name: string) → void

Realize a Grid value as a volume: one voxel per cell, filled from a channel on the device, drawn by a Volume component on a child standing in the grid's box. The channel is `density`, or the one channel a grid carries.

argtypedescription
valueany
namestring

realizeBundle(value: any, name: string) → void

argtypedescription
valueany
namestring

realizePopulation(value: any) → void

Realize a Population by taking ownership of it: the op that produced it already registered its draws, so the whole placement is on screen as one draw call per variant, and standing them in the generator's space puts them where it stands. Holding it here is what releases those registrations on the next regeneration and on destroy — a population is GPU state with no entity to cascade from.

argtypedescription
valueany

refMethod(v: any, methodName: string) → any

Realize an asset-reference output by standing an instance of the asset in the scene — the `:instantiate(target)` protocol `entityOps.fromAsset` runs through, answered by the asset's own type (a landscape stands a Terrain entity, a bundle its hierarchy). The instance's root is a managed child of the generator, so it regenerates and moves with it. A ref's method, reached the way a caller would reach it: through its own indexing, which is where a live ref proxy presents its type's surface.

argtypedescription
vany
methodNamestring

isAssetRefValue(v: any) → boolean

An asset reference reaching realization: a live ref (it knows how to instantiate itself), or the plain table an asset sink returns, carrying the guid or path that resolves to one.

argtypedescription
vany

realizeAssetRef(value: any, name: string) → void

argtypedescription
valueany
namestring

realizeValue(value: any, name: string, outputName: string?, domain: string?) → void

Dispatch a proc output value to its scene realization. A Geometry is a table exposing `toMeshArgs` (an evaluated Geometry carries no `__proc_type`, so it is detected by that shape, checked before `typeOf`); the other scene-content types are dispatched by `proc.types.typeOf`, mirroring the bake sink. A non-scene output (Field / Material / Texture) has no scene realization and is reported so the binding surfaces rather than silently producing nothing.

argtypedescription
valueany
namestring
outputNamestring?
domainstring?

standsAs(value: any, declared: string?) → string

How a value stands in the scene: the domain it was declared to stand as, one mesh for "mesh", and otherwise what the value says of itself — the domain whose elements carry components (points carrying a Mesh stand as a population), or one mesh when none does.

argtypedescription
valueany
declaredstring?

bySource(value: any) → void

A population of several sources as one population per source: the points whose `Mesh` indexes each source (the records the detail's `labels.Mesh` lists), kept on the device and carrying that source's record, so each stands as one instanced draw. Nil for points whose `Mesh` is one shared record.

argtypedescription
valueany

piece(from: any, k: number) → any

The points one source stands on, carrying that source.

argtypedescription
fromany
knumber

pieceDomain(piece: any) → string

How one piece of a merged part stands in the scene: the domain `merge` was told, or what the piece says of itself.

argtypedescription
pieceany

realizeEntries(into: { any }, value: any, output: string, name: string, domain: string?) → void

The realize entries an output's value makes: the value itself, or — for a merged part — each of its pieces, named after the piece and keyed under the output (`<output>/<piece>`), so a piece is built again only when it moves and the others stand.

argtypedescription
into{ any }
valueany
outputstring
namestring
domainstring?

rootName(outputName: string, total: number) → string

The scene name of the root realized for one output. A generator realizing a single output keeps the graph's own name, which is what it has always been called; one realizing several roots names each after the output that produced it, so they are told apart and addressed by what they are.

argtypedescription
outputNamestring
totalnumber

foldToBundle(value: any, name: string) → any

Fold any scene-content output value down to a Bundle (the uniform durable form). An asset-reference output (a graph ending in a write sink) folds to a bundle carrying the reference as one `Asset` child — the asset itself is already durable, so the bundle holds the guid and instantiates it through the asset type's own protocol. Returns nil for a value with no scene shape (Field / Ramp / ...).

argtypedescription
valueany
namestring

writeFlattenedBundle(bundleVal: any, name: string, about: { description: string, tags: { string } }) → any

Write a folded Bundle out as a durable asset, declaring the write as AUTHORING: flattening is an authoring act whose assets outlive the call. Every asset the write realizes underneath (the `.mesh`, the `.population` and its own mesh) is placed inside the same declaration.

argtypedescription
bundleValany
namestring
about{ description: string, tags: { string } }

appliedAbout(time: number) → void

What an applied bundle says it is: the graph that made it, the graph time and params it was applied at, then the graph's own description; and the graph's tags with `procgen`.

argtypedescription
timenumber

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported on this asset or on the parts this page shows. Parts it leaves out are not counted here.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.