Log inGet started
·
procpack · drop-in viewer
asset⌬ procpackprocPackprimary: init.luau·part ofpackage procgen.package·originates fromworld 07158574-5…

grid.procPack

A grid is space cut into cells: a geometry whose points are the centres of its cells, laid out x fastest, then y, then z, and whose point columns are its channels (a density, a distance, a height, a colour). A grid one cell thick along an axis is flat: the height over a ground, a…

by◐lumi·posted 1mo ago
What it does

grid

A grid is space cut into cells: a geometry whose points are the centres of its cells, laid out x fastest, then y, then z, and whose point columns are its channels (a density, a distance, a height, a colour). A grid one cell thick along an axis is flat: the height over a ground, an image.

Because a grid is a geometry, everything that works on points works on its cells. attribute.set writes a channel from any field, attribute.accumulate totals one, attribute.promote folds one into a single value. These ops add what knowing the layout gives:

  • grid.box: a grid of cells filling a box. Give it a cell count per axis, or a cell size.
  • grid.cell_index: which cell each position falls in (-1 outside), as a field.
  • grid.neighbor_index: the cell a fixed step away from each cell, held to the grid's edge, as a field.
  • grid.sample: a channel read at every point of a geometry, blended between the eight cell centres around it.

procgen.searchNodes("", { pack = "grid" }) lists the family and procgen.describeNode("op.<id>") describes any one of them.

Particles deposited into cells, then read back by the particles:

local air = g:node("air", "grid.box", nil, { size = { x = 4, y = 3, z = 4 }, cells = { x = 32, y = 24, z = 32 } })
local cell = g:node("cell", "grid.cell_index", { grid = air })
local dense = g:node("dense", "attribute.scatter", { geometry = air, source = sparks, index = cell },
    { name = "mass", as = "density" })
g:node("felt", "grid.sample", { geometry = sparks, grid = dense }, { name = "density" })

A blur along x is two neighbours gathered and averaged:

local right = g:node("right", "grid.neighbor_index", { grid = dense }, { offset = { x = 1, y = 0, z = 0 } })
local left = g:node("left", "grid.neighbor_index", { grid = dense }, { offset = { x = -1, y = 0, z = 0 } })
local a = g:node("a", "attribute.gather", { geometry = dense, index = right }, { name = "density", as = "r" })
local b = g:node("b", "attribute.gather", { geometry = a, index = left }, { name = "density", as = "l" })

Interface

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

conforms to

zero/source-extract/v2

grid — Space cut into cells: a grid is a geometry whose points are the centres of its cells, laid out x fastest, then y, then z, and whose columns are its channels — a density, a distance, a height, a colour. Everything that works on points works on a grid's cells; these ops add what knowing the layout gives: which cell a position falls in, which cell neighbours another, and a channel read back at any position.

num(v: any, d: number) → number

argtypedescription
vany
dnumber

vec(v: any, dx: number, dy: number, dz: number) → void

argtypedescription
vany
dxnumber
dynumber
dznumber

vecLiteral(x: number, y: number, z: number) → string

argtypedescription
xnumber
ynumber
znumber

layoutOf(v: any, op: string, socket: string) → Layout

argtypedescription
vany
opstring
socketstring

cellSize(l: Layout) → void

How big one cell is along each axis.

argtypedescription
lLayout

positionField(v: any) → any

A position socket's value as a field: a wired field, or where each element of the domain the field is evaluated over stands.

argtypedescription
vany

sampleProgram(lanes: number) → string

Each position reads the channel between the eight cell centres around it, weighted by how near it is to each; past the outermost centres it reads the edge.

argtypedescription
lanesnumber

at(corner: string) → string

argtypedescription
cornerstring

eval(_ctx: ?, _inputs: ?, params: ?) → void

argtypedescription
_ctx?
_inputs?
params?

eval(_ctx: ?, inputs: ?, _params: ?) → void

argtypedescription
_ctx?
inputs?
_params?

eval(_ctx: ?, inputs: ?, params: ?) → void

argtypedescription
_ctx?
inputs?
params?

eval(_ctx: ?, inputs: ?, params: ?) → void

argtypedescription
_ctx?
inputs?
params?

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.