pointSlot

The three parts a round mote is drawn with: where it sits (orbitalPlace), how bright it is (twinkleBrightness) and how big it is (presenceRadius).

pointSlot: { orbitalPlace, twinkleBrightness, presenceRadius }

Import sim from shaders/std and use sim.agentRender.pointSlot.

Each is built over your layout and handed to renderAgents.pointWorld.

Every part varies per mote by a hash of its index, so a field of motes never moves in step.

Example

renderAgents.pointWorld(simLayout, {shape, res: 1024, place: pointSlot.orbitalPlace(simLayout, {radius: 0.035, rate: 1.4}), brightness: pointSlot.twinkleBrightness(simLayout, {freq: 2}), bodyRadius: pointSlot.presenceRadius(simLayout), names: {splat: 'motesSplat', resolve: 'motesResolve'}})

Members

  • pointSlot.orbitalPlace — The mote's drawn position: its stored position plus a slow circle of radius (canvas heights) at rate turns per second, both scaled by params.randomness and varied per mote.
  • pointSlot.twinkleBrightness — The mote's brightness: a twinkle at freq cycles per second, blended in by params.twinkle (0 steady, 1 full shimmer), times a per-mote presence so some motes read nearer than others.
  • pointSlot.presenceRadius — The mote's size: params.bodyR scaled by the same per-mote presence as the brightness, so the motes that read nearer are bigger and brighter together.

See also

  • renderAgents — How the agents are drawn, as one declared part: a splat (each agent stamps its shape into a shared canvas) paired with the matching resolve (the canvas becomes the output picture).
  • splat — The step that draws every agent into the shared canvas, one variant per kind of agent.