NICECHUNK FOURIER MODEL

3D game items as chain-readable functions, not asset files.

NCFM is the research direction behind NiceChunk's next asset layer: store a tiny Fourier/function description on-chain, then let the client deterministically reconstruct the voxel item through RPC. No GLB file, no mutable JSON, no IPFS gateway dependency.

Deterministic reconstruction Short chain payload No external asset host
01

Traditional game asset

A wallet or NFT points to metadata, the metadata points to a file, and the file must remain available somewhere outside the chain.

02

IPFS-style permanence

Better than a normal server, but the game still depends on external content routing, pinning, gateways, and metadata conventions.

03

NCFM function asset

The item is a deterministic function payload. Ownership, rendering rules, verification hash, and visual identity can live together in account data.

PRINCIPLE DIAGRAM

Store the equation. Rebuild the object.

NCFM treats a 3D item as a deterministic field instead of a static file. The chain stores the smallest canonical record: seed, quantized coefficients, palette rules, grid limits, and a verifier hash. The browser expands that record into the visible item.

01 Chain payload NCFM1.PKX.FXY.FZ.PAL.H
02 Canonical functions FXY(x,y) ∩ FZ(x,y,z)
03 Deterministic sampler grid → material voxels
04 Renderable object voxel buffer + model hash
Formula

A shape is a field acceptance rule.

For every coordinate, the client asks the same question: does this point satisfy the agreed functions? Accepted coordinates become material voxels.

Hash

The visible model can be verified.

Because sampling order, grid bounds, quantization, and palette are canonical, the generated voxel set can produce a stable model hash.

Chain

The chain stores identity, not bulk geometry.

The account does not need to carry a heavy mesh. It only needs the record required to regenerate and verify the object forever.

FUNCTION INTERSECTION LAB

A 3D item generated by two compact functions.

This demo uses a pickaxe because the shape is easy to read: an XY function defines the outline, material bands, and color; a Z function defines thickness. Only coordinates accepted by both functions become voxels.

Voxels 0

Using function-generated pickaxe.

01FXY: Fourier line drawing on the XY plane

First, the item is only a 2D function. Fourier descriptors reconstruct the pickaxe outline as a curve over time, proving that the shape can be represented by coefficients instead of an image file.

terms: 12
XY line functionFourier descriptor
// Function 1: draw only on XY
const Cxy = (t) => Σ c[k] · e^(i · k · 2πt)

// c[k] comes from the pickaxe outline
c[k] = 1/N · Σ P[n] · e^(-i · k · 2πn/N)

for t from 0 to drawProgress:
  p = Cxy(t)
  drawLineOnXY(p)

output = 2D function curve
XY axesFourier pathdraw: 0%

02FXY × FZ: intersect the XY field with a Z thickness field

The second function turns the 2D outline into a volume. Blue marks the XY projection, gold marks the Z thickness rule, and green marks coordinates accepted by both functions.

intersection: 0 voxels
Two intersecting functionsXY field ∩ Z field
function FXY(x, y) {
  structure = FourierPickaxeXY(x, y)
  material  = structure.material
  color     = structure.color
  return { inside: structure.score > 0, material, color }
}

function FZ(x, y, z) {
  thickness = 1.8 + 0.42·cos(0.27x + 0.31y)
            + 0.18·sin(0.61x - 0.23y)
  return cos(πz / thickness) > 0
}

voxel(x,y,z) = FXY(x,y).inside && FZ(x,y,z).inside
Fxy(x,y)Fz(x,y,z)Fxy ∩ Fz
XY projection Z thickness Intersection

03Intersection result: final 3D voxel pickaxe

The final item is not loaded from a mesh. The client scans deterministic coordinates, keeps only the points accepted by both functions, applies material color, and renders the resulting voxel model.

visible: 0 / 0
Final voxel generatorno mesh / no image file
voxels = []

for x in X:
  for y in Y:
    xy = FXY(x, y)
    if !xy.inside: continue

    for z in Z:
      if FZ(x, y, z).inside:
        voxels.push({ x, y, z, color: xy.color, material: xy.material })

output = FXY(x,y) ∩ FZ(x,y,z)
final voxelsauto rotatecycle: 0%
material: metal material: wood

Key point: the chain stores the function seed, coefficients, parameters, palette, and verifier hash. The visible 3D model is recreated from code, not downloaded as a 3D file.

CHAIN VERIFICATION PIPELINE

What the client and contract can agree on.

NCFM keeps the chain payload small by making the heavy visual reconstruction a deterministic client operation. The important part is that all clients derive the same model hash from the same code.

1

Read

Fetch the payload from a PDA or asset account through RPC.

2

Decode

Parse seed, palette, Fourier coefficients, field parameters, and verifier hash.

3

Sample

Run the canonical sampler over the agreed voxel grid.

4

Render

Build a mesh or voxel instance buffer locally and compare the deterministic model hash.

TECHNICAL MEANING

Why this matters for an open on-chain game.

The goal is not only compression. The goal is to make game assets transparent, permanent, cheaply readable, and reproducible by any client or explorer without trusting a private asset server.

Permanent

If the payload remains on-chain, the asset definition remains available with the account history.

Open

Players can inspect the exact function code and parameters used to reconstruct the item.

Fast

A short RPC read replaces multiple metadata, gateway, and file fetches.

Portable

The same compact record can be interpreted by games, explorers, crafting tools, and future clients.

DATA MODEL

A tiny text record with deterministic meaning.

  • Header: version, item class, grid size, quantization.
  • Functions: Fourier descriptors, signed distance segments, harmonic thickness fields.
  • Palette: compact material IDs and derived color rules.
  • Verifier: model hash generated by canonical sampling.

WHY IT MATTERS

On-chain 3D becomes a code problem, not a file-hosting problem.

If the item can be described as a short function, the chain only stores the minimum seed and parameters. The world can still render rich 3D assets while keeping storage cost predictable and publicly auditable.

View older Fourier voxel demo