Skip to main content

Module plexus

Module plexus 

Source
Expand description

The plexus system (ADR-0257): a few hundred points in 3D, joined by a line wherever two lie within a bindable link distance, seen through the shared perspective camera.

§One frame

update advances the point set by the injected dt and rebuilds the proximity graph from it (sim): every pair closer than link_distance is an edge whose presence is smoothstep(1 - d / link_distance), so a link fades in as its pair nears and out as it parts. render builds this frame’s Camera3d view from the render target’s aspect (ADR-0037), clips each edge against the near plane, drops the ones wholly off one edge of the frame, colours each by its depth, and hands the rest to the shared line renderer’s seg3d pipeline. A node is drawn at every point through the 3D sprite pipeline beside the marks (marks::InstancedQuads3d), coloured the same way and blurred by the same coc().

§What is structural and what is bound

The [plexus] table — the layout, the point count and the seed — is fixed for as long as the preset is loaded, because it decides how many points exist and where they start. Everything that moves is a bindable parameter.

§Buffers are sized once

The point set, the edge list and the instance scratch are reserved from the tier’s caps when the scene is built, and a preset asking for more is held to them at load, so no frame allocates.

Structs§

PlexusConfig
The [plexus] table, validated (ADR-0180 rule 1).
PlexusScene
The plexus scene: the point set, its graph, and the 3D line renderer it draws through.

Enums§

PlexusLayout
Which arrangement the points take — the [plexus] layout family.

Constants§

DEFAULT_POINTS
The point count a preset that names none draws.
FAMILY_PARAMS
Every parameter only some layouts read (ADR-0180 rule 4), with the range that reads there. A parameter missing from here reads the same on both.
MAX_POINTS
The most points a preset may ask for at load, before the tier’s own cap holds it further. The pairing is quadratic, so this bounds the worst frame on any tier.
MIN_POINTS
The fewest points a preset may ask for. Below this the graph is a handful of strokes rather than a network.
PARAMS
Parameter vocabulary — see fragment_field::PARAMS. Keep in sync with set_param below.