Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commitdd348ac6c3

README.md

field

Fields: a value per element, built from position, attributes, noise and maths, sampled where an op needs it.

The definitions live in proc.ops.field; this pack is what puts them in the op registry, so procgen.searchNodes("", { pack = "field" }) lists the family and procgen.describeNode("op.<id>") describes any one of them.

Ops

  • field.constant — A field yielding the same value at every element (number → Float, vector → Vec2/3/4)
  • field.index — The element index as a Float field
  • field.position — Each element's position (Vec3) from a Geometry — or, left unwired, the position of whatever the field is evaluated over
  • field.normal — Each element's normal (Vec3) from a Geometry — or, left unwired, the normal of whatever the field is evaluated over
  • field.attribute — Read a named attribute column off a geometry domain — or, left unwired, off whatever the field is evaluated over
  • field.random — A deterministic per-element random Float in [min, max)
  • field.noise — Deterministic 3D value/gradient noise sampled at a position field
  • field.math — Per-component arithmetic on a field (unary or binary op)
  • field.vector_math — Vector operations on Vec3 fields (add/cross/dot/normalize/length/…)
  • field.compare — Compare two scalar fields → a Bool mask field (1/0)
  • field.mix — Per-component linear blend lerp(a, b, t)
  • field.map_range — Remap each component from one range to another (optional clamp)
  • field.swizzle — Reorder/select field components by an x/y/z/w pattern
  • field.combine — Combine scalar fields x,y,(z),(w) into a vector field

field.id answers as field.index, and attribute.get as field.attribute: a graph naming either cooks the op it answers as. field.distance and field.ramp are nodes of the field nodebox (g.field.distance, g.field.ramp).