geo
A module script.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2preseed/geo.module — procedural mesh + runtime-material helpers for demo parts. Builds flat-array geometry (box / plane / sphere / cylinder), uploads GPU meshes, creates runtime materials, and spawns entities carrying them via ecs.Mesh / ecs.Material. Mesh and material handles are shareable — spawn hundreds of entities from one upload.
box(w: ?, h: ?, d: ?) → void
| arg | type | description |
|---|---|---|
| w | ? | |
| h | ? | |
| d | ? |
face(c: ?, n: ?) → void
| arg | type | description |
|---|---|---|
| c | ? | |
| n | ? |
plane(w: ?, d: ?, uvTile: ?) → void
XZ ground plane facing +Y.
| arg | type | description |
|---|---|---|
| w | ? | |
| d | ? | |
| uvTile | ? |
grid(opts: ?) → void
XZ ground grid facing +Y: a dense uniform core with geometrically expanding outer cells, for shader-displaced surfaces (ocean, terrain) that need detail near the action and a horizon far away. UVs carry the undisplaced xz so a vertex shader can hand exact field coordinates to its fragment stage. opts: { innerHalf, innerCells, outerCells, growth }
| arg | type | description |
|---|---|---|
| opts | ? |
inside(geom: ?) → void
Flip a geom inside-out (reversed winding + negated normals) so it renders from within — skydomes, environment shells.
| arg | type | description |
|---|---|---|
| geom | ? |
sphere(r: ?, segs: ?, rings: ?) → void
| arg | type | description |
|---|---|---|
| r | ? | |
| segs | ? | |
| rings | ? |
cylinder(r: ?, h: ?, segs: ?) → void
| arg | type | description |
|---|---|---|
| r | ? | |
| h | ? | |
| segs | ? |
cap(y: ?, ny: ?) → void
caps
| arg | type | description |
|---|---|---|
| y | ? | |
| ny | ? |
torus(R: ?, r: ?, segs: ?, rings: ?) → void
| arg | type | description |
|---|---|---|
| R | ? | |
| r | ? | |
| segs | ? | |
| rings | ? |
lathe(profile: ?, segs: ?) → void
Surface of revolution around Y from a 2D profile of { radius, y } points (bowls, vases, rims, lampshades). Normals are the profile's in-plane normal (-dy, dr), so traversal direction sets which side faces out: an inner wall traversed bottom→rim lights from inside, an outer wall traversed rim→bottom lights from outside. UVs: u = revolution fraction, v = profile fraction.
| arg | type | description |
|---|---|---|
| profile | ? | |
| segs | ? |
nhash(x: ?, y: ?, z: ?, seed: ?) → void
CPU value noise (one-time generation cost; seeded, deterministic).
| arg | type | description |
|---|---|---|
| x | ? | |
| y | ? | |
| z | ? | |
| seed | ? |
vnoise3(x: ?, y: ?, z: ?, seed: ?) → void
| arg | type | description |
|---|---|---|
| x | ? | |
| y | ? | |
| z | ? | |
| seed | ? |
lerp(a: ?, b: ?, t: ?) → void
| arg | type | description |
|---|---|---|
| a | ? | |
| b | ? | |
| t | ? |
rock(opts: ?) → void
Faceted rock: a lat/long sphere displaced along its radius by seeded value noise, emitted flat-shaded (per-face normals) so the silhouette reads as chiseled stone. UVs survive displacement — uv.x = azimuth fraction, uv.y = height fraction (top 0 → bottom 1) — so rock shaders can carve bands and moss masks in a stable parameterization. opts: { r?, sx?, sy?, sz?, segs?, rings?, seed?, rough?, detail?, taper? }
| arg | type | description |
|---|---|---|
| opts | ? |
tri(p1: ?, p2: ?, p3: ?) → void
| arg | type | description |
|---|---|---|
| p1 | ? | |
| p2 | ? | |
| p3 | ? |
pointCloud(points: ?) → void
Octahedron point cloud, encoded for GPU vertex animation: one tiny octahedron per point whose vertex NORMAL is the unit offset from the point's center and whose uv is (seed, size) — a vertex shader recovers the center as position - normal * uv.y and animates it freely while normals stay valid under translation. points: { { x, y, z, seed, size }, ... }
| arg | type | description |
|---|---|---|
| points | ? |
buildTangents(P: ?, N: ?, U: ?, I: ?) → void
A runtime mesh built from positions/normals/uvs alone carries a tangent channel of ZEROES — the channel is allocated and nothing is derived into it — and a zero tangent makes the shader's tangent-to-world basis degenerate. A normal map on such a mesh does not merely do nothing: it drives the shading normal to garbage, and the surface goes black wherever the map is strongest. Every normal-mapped surface built through this helper depends on the basis being built here, from the same triangles and UVs the shader samples through. Lengyel's method: accumulate each triangle's UV-space tangent onto its three vertices, then orthonormalize against the vertex normal.
| arg | type | description |
|---|---|---|
| P | ? | |
| N | ? | |
| U | ? | |
| I | ? |
mesh(geom: ?, name: ?) → void
| arg | type | description |
|---|---|---|
| geom | ? | |
| name | ? |
material(opts: ?) → void
opts: { shader?, props?, render?, textures?, key? } → MaterialHandle (guid = key)
| arg | type | description |
|---|---|---|
| opts | ? |
setMatProp(mat: ?, name: ?, value: ?) → void
| arg | type | description |
|---|---|---|
| mat | ? | |
| name | ? | |
| value | ? |
spawnMesh(mesh: ?, mat: ?, opts: ?) → void
Spawn an entity rendering (mesh, mat). opts: { name?, pos?, rot?, scale?, castsShadows?, visible? }
| arg | type | description |
|---|---|---|
| mesh | ? | |
| mat | ? | |
| opts | ? |
qrotate(q: ?, vx: ?, vy: ?, vz: ?) → void
Rotate vector (vx,vy,vz) by quat {x,y,z,w}; returns three numbers.
| arg | type | description |
|---|---|---|
| q | ? | |
| vx | ? | |
| vy | ? | |
| vz | ? |
qmul(a: ?, b: ?) → void
| arg | type | description |
|---|---|---|
| a | ? | |
| b | ? |
merge(parts: ?) → void
Merge geometry parts into one geom, baking per-part transforms. parts: { { geom, pos = {x,y,z}?, rot = quat?, scale = number|{x,y,z}? }, ... } Normals are scale-corrected (inverse scale + renormalize) then rotated.
| arg | type | description |
|---|---|---|
| parts | ? |
quatY(rad: ?) → void
| arg | type | description |
|---|---|---|
| rad | ? |
quatAxis(ax: ?, ay: ?, az: ?, rad: ?) → void
| arg | type | description |
|---|---|---|
| ax | ? | |
| ay | ? | |
| az | ? | |
| rad | ? |
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ 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".
Scoped to this part · feeds back into the world's score.