Skip to content

Source: MoonLiveBuiltins_light.h

moonlive_builtins_light

The only place the LED vocabulary lives: the function names, their argument counts, and each inline opcode's meaning.

The core compiler sees only the neutral table and the tags this file hands it, so a different host writes its own registration and leaves core unchanged.

Enumerations

Name Description
MotionAxis The five fixture roles, in the order [FixtureChannels] declares them.
[``]

MotionAxis

enum MotionAxis

The five fixture roles, in the order [FixtureChannels] declares them.

Value Description
Pan
Tilt
Zoom
Rotate
Gobo

enum 
Value Description
kSysWidth
kSysHeight
kSysDepth
kSysX
kSysY
kSysZ

Typedefs

Return Name Description
void(*)(void *ctx, uint16_t x, uint16_t y, uint16_t z) AddLightFn
void(*)(void *ctx, const char *name, uint8_t offset, int32_t lo, int32_t hi, CtrlType type) AddControlFn Where a running defineControls() sends each addControl.
void(*)(void *ctx, uint8_t amt) FadeFn Where fade(amt) sends its request.
void(*)(void *ctx, uint32_t x, uint32_t y, uint32_t z) CoordFn Where setXYZ sends the coordinate a modifier folded.
void(*)(void *ctx, uint8_t index, uint8_t r, uint8_t g, uint8_t b) PalFn Where setPalEntry writes, carrying an index rather than a light.
void(*)(void *ctx, MotionAxis axis, uint32_t index, uint8_t value) MotionFn Where the motion setters send their writes.
bool(*)(void *ctx, bool want) TrailSizeFn Where trail(1) sends its request for a plane.
uint16_t(*)(void *ctx, uint16_t count) PoolSizeFn Where pool(n) sends its sizing request.

AddLightFn

using AddLightFn = void(*)(void *ctx, uint16_t x, uint16_t y, uint16_t z)

AddControlFn

using AddControlFn = void(*)(void *ctx, const char *name, uint8_t offset, int32_t lo, int32_t hi, CtrlType type)

Where a running defineControls() sends each addControl.


FadeFn

using FadeFn = void(*)(void *ctx, uint8_t amt)

Where fade(amt) sends its request.


CoordFn

using CoordFn = void(*)(void *ctx, uint32_t x, uint32_t y, uint32_t z)

Where setXYZ sends the coordinate a modifier folded.


PalFn

using PalFn = void(*)(void *ctx, uint8_t index, uint8_t r, uint8_t g, uint8_t b)

Where setPalEntry writes, carrying an index rather than a light.


MotionFn

using MotionFn = void(*)(void *ctx, MotionAxis axis, uint32_t index, uint8_t value)

Where the motion setters send their writes.


TrailSizeFn

using TrailSizeFn = bool(*)(void *ctx, bool want)

Where trail(1) sends its request for a plane.


PoolSizeFn

using PoolSizeFn = uint16_t(*)(void *ctx, uint16_t count)

Where pool(n) sends its sizing request.

Functions

Return Name Description
uint8_t byteArg inline Read one argument as a byte, clamped to 0..255.
uint32_t mm_light_paletteR inline
uint32_t mm_light_paletteG inline
uint32_t mm_light_paletteB inline
uint32_t mm_light_smoothstep inline
uint32_t mm_light_uvAxis inline
uint32_t mm_light_uvX inline
uint32_t mm_light_uvY inline
uint32_t mm_light_escape inline
uint32_t mm_light_polarA inline
uint32_t mm_light_polarR inline
uint32_t mm_light_fbm inline
uint32_t mm_light_warp inline
uint32_t mm_light_fbm3 inline
uint32_t mm_light_warp3 inline
uint32_t mm_light_osc inline
const AddLightSink & [addLightSink] inline The addLight sink for this thread, or an empty one.
const AddControlSink & [addControlSink] inline The control sink for this thread, or an empty one; reading claims no slot.
const FadeSink & [fadeSink] inline The fade sink for this thread, or an empty one; reading claims no slot.
void setFadeSink inline Point fade() at the layer for one run; nullptr to detach.
const CoordSink & [coordSink] inline The coordinate sink for this thread, or an empty one; reading claims no slot.
void setCoordSink inline Point setXYZ at the modifier for one run; nullptr to detach.
const PalSink & [palSink] inline The palette sink for this thread, or an empty one; reading claims no slot.
void setPalSink inline Point setPalEntry at the palette binding for one run; nullptr to detach.
const MotionSink & [motionSink] inline The motion sink for this thread, or an empty one; reading claims no slot.
void setMotionSink inline Point setPan and setTilt at the effect for one run; nullptr to detach.
const PoolSizeSink & [poolSizeSink] inline The pool sizing sink for this thread, or an empty one; reading claims no slot.
void setPoolSizeSink inline Point pool(n) at the binding that owns the buffers for one defineControls run; nullptr to detach.
const PoolSink & [poolSink] inline The live pool for this thread, or an empty handle; reading claims no slot.
void setPoolSink inline Point the per-frame particle builtins at the pool for one run; nullptr to detach.
const TrailSizeSink & [trailSizeSink] inline Where trail() asks for its plane, during defineControls only.
void setTrailSizeSink inline Install the trail sizer for one defineControls() run; nullptr to detach.
FlowSink & [flowSink] inline The trail plane this run may advect and decay, or an empty handle.
void setFlowSink inline Hand the flow builtins their planes for one run; a null plane detaches.
bool setAddControlSink inline Point addControl at a consumer for one defineControls run; nullptr to detach.
void setAddLightSink inline Point addLight at a consumer for one run; nullptr to detach.
uint32_t addControlDecl inline The one control declaration: args are name, member offset, min and max.
uint32_t mm_light_addControl inline Surface a member as a control within a range; its declared type decides the kind.
uint32_t mm_light_addLight inline Place one light at the script's coordinates through this thread's layout sink.
const draw::Canvas & drawCanvas inline The canvas the draw builtins render into, valid for one run, or an empty one.
void setDrawCanvas inline Point the draw builtins at a canvas for one run; an empty one detaches.
uint32_t mm_light_setPalEntry inline Write one of the sixteen active palette entries, as red, green and blue.
uint32_t mm_light_setPalEntryHSV inline Write one active palette entry in hue, saturation and value.
uint32_t mm_light_setPaletteColorZ inline Color one light in a volume from the active palette.
uint32_t mm_light_setPaletteColor inline Color one light from the active palette at a brightness, dropping out-of-range coordinates.
uint32_t mm_light_trail inline Ask for the trail plane, or give it up; answers whether one is available.
uint32_t mm_light_fieldRate inline Answer true once every n frames, gating the expensive work on a large fixture.
uint32_t mm_light_flowNoise inline Advect the trail along a noise field: two decoupled samples, one per axis.
uint32_t mm_light_flowCurl inline Advect the trail along a curl field: the same, but divergence-free, so nothing clumps.
uint32_t mm_light_trailDecay inline Dim the trail by a half-life in milliseconds, so the tail's length is in seconds not frames.
uint32_t mm_light_emitTrail inline Throw light into the trail as a disc, colored from the active palette.
uint32_t mm_light_fade inline Dim every light toward black by an amount over 255, the trail primitive.
uint32_t mm_light_setXYZ inline Say where this light goes, from a modifier.
uint32_t mm_light_level inline The room's overall loudness, or zero on a device with no audio.
uint32_t mm_light_levelSmooth inline The room's loudness, smoothed over recent frames.
uint32_t mm_light_band inline One of the sixteen log-spaced magnitudes, bass at 0 and treble at 15.
uint32_t mm_light_peakHz inline The dominant frequency in the room, in hertz.
uint32_t mm_light_onBeat inline True on a transient.
uint32_t motionWrite inline The one body all five motion builtins share, differing only in the axis they name.
uint32_t mm_light_set_pan inline Aim one head horizontally.
uint32_t mm_light_set_tilt inline Aim one head vertically.
uint32_t mm_light_set_zoom inline Widen or narrow one head's beam.
uint32_t mm_light_set_rotate inline Turn one head's gobo wheel.
uint32_t mm_light_set_gobo inline Pick one head's gobo pattern.
uint32_t mm_light_pool inline Size this script's particle pool, and report what it got, or zero when the allocation failed.
uint32_t nextEmitSeed inline A moving seed for the emitters, since a fixed one throws identical sparks every frame.
uint32_t mm_light_emit inline Throw a number of particles from a point, at an angle, speed, life and hue.
uint32_t mm_light_gravity inline Pull every live particle down, in sub-pixels per reference frame squared.
uint32_t mm_light_drag inline Bleed speed off every live particle, 0 none and 255 nearly all.
uint32_t mm_light_step inline Move every live particle by its velocity, the integrator.
uint32_t mm_light_bounce inline Reflect every particle off the grid's walls, keeping a fraction of 256 of its speed.
uint32_t mm_light_collide inline Make particles bounce off each other, within a contact radius in whole pixels.
uint32_t mm_light_age inline Count down every particle's life, freeing the slot of one that reaches zero.
uint32_t mm_light_render inline Draw every live particle, dimmed by the life it has left.
uint32_t mm_light_line inline Draw a straight segment on the effect's canvas, at depth zero.
uint32_t mm_light_circle inline Draw a circle outline of a given stroke width, through [draw::ring], converting the script's whole lights to the drawing layer's sub-pixels.
void writeSysVarSlot inline Write one system variable into its arena slot, full width.
SysVarTable lightSysVars inline The system variables every light script can read, the grid's dimensions and a light's position.
SysVarTable layoutSysVars inline The system variables a layout reads.
SysVarTable effectSysVars inline The system variables an effect reads.
SysVarTable modifierSysVars inline The system variables a modifier reads.
uint32_t mm_light_smin inline Blend two signed distances smoothly, over a smoothing width.
const BuiltinTable & lightBuiltins inline The light-domain builtin table the binding injects into the compiler.
void runDefineControls inline Run a script's defineControls, so the controls it declares exist.

byteArg

inline

inline uint8_t byteArg(uintptr_t a)

Read one argument as a byte, clamped to 0..255.


mm_light_paletteR

inline

inline uint32_t mm_light_paletteR(const uintptr_t * args, uint32_t, const uint8_t *)

mm_light_paletteG

inline

inline uint32_t mm_light_paletteG(const uintptr_t * args, uint32_t, const uint8_t *)

mm_light_paletteB

inline

inline uint32_t mm_light_paletteB(const uintptr_t * args, uint32_t, const uint8_t *)

mm_light_smoothstep

inline

inline uint32_t mm_light_smoothstep(const uintptr_t * args, uint32_t, const uint8_t *)

mm_light_uvAxis

inline

inline uint32_t mm_light_uvAxis(const uintptr_t * args, bool wantY)

mm_light_uvX

inline

inline uint32_t mm_light_uvX(const uintptr_t * args, uint32_t, const uint8_t *)

mm_light_uvY

inline

inline uint32_t mm_light_uvY(const uintptr_t * args, uint32_t, const uint8_t *)

mm_light_escape

inline

inline uint32_t mm_light_escape(const uintptr_t * args, uint32_t, const uint8_t *)

mm_light_polarA

inline

inline uint32_t mm_light_polarA(const uintptr_t * args, uint32_t, const uint8_t *)

mm_light_polarR

inline

inline uint32_t mm_light_polarR(const uintptr_t * args, uint32_t, const uint8_t *)

mm_light_fbm

inline

inline uint32_t mm_light_fbm(const uintptr_t * args, uint32_t, const uint8_t *)

mm_light_warp

inline

inline uint32_t mm_light_warp(const uintptr_t * args, uint32_t, const uint8_t *)

mm_light_fbm3

inline

inline uint32_t mm_light_fbm3(const uintptr_t * args, uint32_t, const uint8_t *)

mm_light_warp3

inline

inline uint32_t mm_light_warp3(const uintptr_t * args, uint32_t, const uint8_t *)

mm_light_osc

inline

inline uint32_t mm_light_osc(const uintptr_t * args, uint32_t, const uint8_t *)

addLightSink

inline

inline const AddLightSink & addLightSink()

The addLight sink for this thread, or an empty one.


addControlSink

inline

inline const AddControlSink & addControlSink()

The control sink for this thread, or an empty one; reading claims no slot.


fadeSink

inline

inline const FadeSink & fadeSink()

The fade sink for this thread, or an empty one; reading claims no slot.


setFadeSink

inline

inline void setFadeSink(FadeFn fn, void * ctx)

Point fade() at the layer for one run; nullptr to detach.


coordSink

inline

inline const CoordSink & coordSink()

The coordinate sink for this thread, or an empty one; reading claims no slot.


setCoordSink

inline

inline void setCoordSink(CoordFn fn, void * ctx)

Point setXYZ at the modifier for one run; nullptr to detach.


palSink

inline

inline const PalSink & palSink()

The palette sink for this thread, or an empty one; reading claims no slot.


setPalSink

inline

inline void setPalSink(PalFn fn, void * ctx)

Point setPalEntry at the palette binding for one run; nullptr to detach.


motionSink

inline

inline const MotionSink & motionSink()

The motion sink for this thread, or an empty one; reading claims no slot.


setMotionSink

inline

inline void setMotionSink(MotionFn fn, void * ctx)

Point setPan and setTilt at the effect for one run; nullptr to detach.


poolSizeSink

inline

inline const PoolSizeSink & poolSizeSink()

The pool sizing sink for this thread, or an empty one; reading claims no slot.


setPoolSizeSink

inline

inline void setPoolSizeSink(PoolSizeFn fn, void * ctx)

Point pool(n) at the binding that owns the buffers for one defineControls run; nullptr to detach.


poolSink

inline

inline const PoolSink & poolSink()

The live pool for this thread, or an empty handle; reading claims no slot.


setPoolSink

inline

inline void setPoolSink(particles::Pool * pool, uint32_t scale)

Point the per-frame particle builtins at the pool for one run; nullptr to detach.


trailSizeSink

inline

inline const TrailSizeSink & trailSizeSink()

Where trail() asks for its plane, during defineControls only.


setTrailSizeSink

inline

inline void setTrailSizeSink(TrailSizeFn fn, void * ctx)

Install the trail sizer for one defineControls() run; nullptr to detach.


flowSink

inline

inline FlowSink & flowSink()

The trail plane this run may advect and decay, or an empty handle.


setFlowSink

inline

inline void setFlowSink(const FlowSink & f)

Hand the flow builtins their planes for one run; a null plane detaches.


setAddControlSink

inline

inline bool setAddControlSink(AddControlFn fn, void * ctx)

Point addControl at a consumer for one defineControls run; nullptr to detach.


setAddLightSink

inline

inline void setAddLightSink(AddLightFn fn, void * ctx)

Point addLight at a consumer for one run; nullptr to detach.


addControlDecl

inline

inline uint32_t addControlDecl(const uintptr_t * args, CtrlType type)

The one control declaration: args are name, member offset, min and max.


mm_light_addControl

inline

inline uint32_t mm_light_addControl(const uintptr_t * args, uint32_t, const uint8_t *)

Surface a member as a control within a range; its declared type decides the kind.


mm_light_addLight

inline

inline uint32_t mm_light_addLight(const uintptr_t * args, uint32_t, const uint8_t *)

Place one light at the script's coordinates through this thread's layout sink.


drawCanvas

inline

inline const draw::Canvas & drawCanvas()

The canvas the draw builtins render into, valid for one run, or an empty one.


setDrawCanvas

inline

inline void setDrawCanvas(const draw::Canvas & cv)

Point the draw builtins at a canvas for one run; an empty one detaches.


mm_light_setPalEntry

inline

inline uint32_t mm_light_setPalEntry(const uintptr_t * args, uint32_t, const uint8_t *)

Write one of the sixteen active palette entries, as red, green and blue.


mm_light_setPalEntryHSV

inline

inline uint32_t mm_light_setPalEntryHSV(const uintptr_t * args, uint32_t, const uint8_t *)

Write one active palette entry in hue, saturation and value.


mm_light_setPaletteColorZ

inline

inline uint32_t mm_light_setPaletteColorZ(const uintptr_t * args, uint32_t, const uint8_t *)

Color one light in a volume from the active palette.


mm_light_setPaletteColor

inline

inline uint32_t mm_light_setPaletteColor(const uintptr_t * args, uint32_t, const uint8_t *)

Color one light from the active palette at a brightness, dropping out-of-range coordinates.


mm_light_trail

inline

inline uint32_t mm_light_trail(const uintptr_t * args, uint32_t, const uint8_t *)

Ask for the trail plane, or give it up; answers whether one is available.


mm_light_fieldRate

inline

inline uint32_t mm_light_fieldRate(const uintptr_t * args, uint32_t, const uint8_t *)

Answer true once every n frames, gating the expensive work on a large fixture.


mm_light_flowNoise

inline

inline uint32_t mm_light_flowNoise(const uintptr_t * args, uint32_t, const uint8_t *)

Advect the trail along a noise field: two decoupled samples, one per axis.


mm_light_flowCurl

inline

inline uint32_t mm_light_flowCurl(const uintptr_t * args, uint32_t, const uint8_t *)

Advect the trail along a curl field: the same, but divergence-free, so nothing clumps.


mm_light_trailDecay

inline

inline uint32_t mm_light_trailDecay(const uintptr_t * args, uint32_t, const uint8_t *)

Dim the trail by a half-life in milliseconds, so the tail's length is in seconds not frames.


mm_light_emitTrail

inline

inline uint32_t mm_light_emitTrail(const uintptr_t * args, uint32_t, const uint8_t *)

Throw light into the trail as a disc, colored from the active palette.


mm_light_fade

inline

inline uint32_t mm_light_fade(const uintptr_t * args, uint32_t, const uint8_t *)

Dim every light toward black by an amount over 255, the trail primitive.


mm_light_setXYZ

inline

inline uint32_t mm_light_setXYZ(const uintptr_t * args, uint32_t, const uint8_t *)

Say where this light goes, from a modifier.


mm_light_level

inline

inline uint32_t mm_light_level(const uintptr_t *, uint32_t, const uint8_t *)

The room's overall loudness, or zero on a device with no audio.


mm_light_levelSmooth

inline

inline uint32_t mm_light_levelSmooth(const uintptr_t *, uint32_t, const uint8_t *)

The room's loudness, smoothed over recent frames.


mm_light_band

inline

inline uint32_t mm_light_band(const uintptr_t * args, uint32_t, const uint8_t *)

One of the sixteen log-spaced magnitudes, bass at 0 and treble at 15.


mm_light_peakHz

inline

inline uint32_t mm_light_peakHz(const uintptr_t *, uint32_t, const uint8_t *)

The dominant frequency in the room, in hertz.


mm_light_onBeat

inline

inline uint32_t mm_light_onBeat(const uintptr_t *, uint32_t, const uint8_t *)

True on a transient.


motionWrite

inline

inline uint32_t motionWrite(MotionAxis axis, const uintptr_t * args)

The one body all five motion builtins share, differing only in the axis they name.


mm_light_set_pan

inline

inline uint32_t mm_light_set_pan(const uintptr_t * args, uint32_t, const uint8_t *)

Aim one head horizontally.


mm_light_set_tilt

inline

inline uint32_t mm_light_set_tilt(const uintptr_t * args, uint32_t, const uint8_t *)

Aim one head vertically.


mm_light_set_zoom

inline

inline uint32_t mm_light_set_zoom(const uintptr_t * args, uint32_t, const uint8_t *)

Widen or narrow one head's beam.


mm_light_set_rotate

inline

inline uint32_t mm_light_set_rotate(const uintptr_t * args, uint32_t, const uint8_t *)

Turn one head's gobo wheel.


mm_light_set_gobo

inline

inline uint32_t mm_light_set_gobo(const uintptr_t * args, uint32_t, const uint8_t *)

Pick one head's gobo pattern.


mm_light_pool

inline

inline uint32_t mm_light_pool(const uintptr_t * args, uint32_t, const uint8_t *)

Size this script's particle pool, and report what it got, or zero when the allocation failed.


nextEmitSeed

inline

inline uint32_t nextEmitSeed()

A moving seed for the emitters, since a fixed one throws identical sparks every frame.


mm_light_emit

inline

inline uint32_t mm_light_emit(const uintptr_t * args, uint32_t, const uint8_t *)

Throw a number of particles from a point, at an angle, speed, life and hue.


mm_light_gravity

inline

inline uint32_t mm_light_gravity(const uintptr_t * args, uint32_t, const uint8_t *)

Pull every live particle down, in sub-pixels per reference frame squared.


mm_light_drag

inline

inline uint32_t mm_light_drag(const uintptr_t * args, uint32_t, const uint8_t *)

Bleed speed off every live particle, 0 none and 255 nearly all.


mm_light_step

inline

inline uint32_t mm_light_step(const uintptr_t *, uint32_t, const uint8_t *)

Move every live particle by its velocity, the integrator.


mm_light_bounce

inline

inline uint32_t mm_light_bounce(const uintptr_t * args, uint32_t, const uint8_t *)

Reflect every particle off the grid's walls, keeping a fraction of 256 of its speed.


mm_light_collide

inline

inline uint32_t mm_light_collide(const uintptr_t * args, uint32_t, const uint8_t *)

Make particles bounce off each other, within a contact radius in whole pixels.


mm_light_age

inline

inline uint32_t mm_light_age(const uintptr_t * args, uint32_t, const uint8_t *)

Count down every particle's life, freeing the slot of one that reaches zero.


mm_light_render

inline

inline uint32_t mm_light_render(const uintptr_t * args, uint32_t, const uint8_t *)

Draw every live particle, dimmed by the life it has left.


mm_light_line

inline

inline uint32_t mm_light_line(const uintptr_t * args, uint32_t, const uint8_t *)

Draw a straight segment on the effect's canvas, at depth zero.


mm_light_circle

inline

inline uint32_t mm_light_circle(const uintptr_t * args, uint32_t, const uint8_t *)

Draw a circle outline of a given stroke width, through [draw::ring], converting the script's whole lights to the drawing layer's sub-pixels.


writeSysVarSlot

inline

inline void writeSysVarSlot(uint8_t * arenaSlot, uint32_t value)

Write one system variable into its arena slot, full width.


lightSysVars

inline

inline SysVarTable lightSysVars()

The system variables every light script can read, the grid's dimensions and a light's position.


layoutSysVars

inline

inline SysVarTable layoutSysVars()

The system variables a layout reads.


effectSysVars

inline

inline SysVarTable effectSysVars()

The system variables an effect reads.


modifierSysVars

inline

inline SysVarTable modifierSysVars()

The system variables a modifier reads.


mm_light_smin

inline

inline uint32_t mm_light_smin(const uintptr_t * args, uint32_t, const uint8_t *)

Blend two signed distances smoothly, over a smoothing width.


lightBuiltins

inline

inline const BuiltinTable & lightBuiltins()

The light-domain builtin table the binding injects into the compiler.


runDefineControls

inline

inline void runDefineControls(MoonLive & engine, PoolSizeFn sizePool = nullptr, void * poolCtx = nullptr, TrailSizeFn sizeTrail = nullptr, void * trailCtx = nullptr)

Run a script's defineControls, so the controls it declares exist.

Variables

Return Name Description
constexpr const char * kEntryTick constexpr The entry points the light domain calls, looked up by name in the emitted block.
constexpr const char * kEntryDefineControls constexpr
constexpr const char * kEntryPlaceLights constexpr
constexpr const char * kEntryModify constexpr

kEntryTick

constexpr

constexpr const char * kEntryTick = "tick"

The entry points the light domain calls, looked up by name in the emitted block.


kEntryDefineControls

constexpr

constexpr const char * kEntryDefineControls = "defineControls"

kEntryPlaceLights

constexpr

constexpr const char * kEntryPlaceLights = "placeLights"

kEntryModify

constexpr

constexpr const char * kEntryModify = "modifyLogical"

AddControlSink

struct AddControlSink
src/light/moonlive/MoonLiveBuiltins_light.h:188

Public Attributes

AddControlFn fn = nullptr

void * ctx = nullptr

AddLightSink

struct AddLightSink
src/light/moonlive/MoonLiveBuiltins_light.h:182

The addLight sink for one thread, installed by the binding around each run.

Public Attributes

AddLightFn fn = nullptr

void * ctx = nullptr

CoordSink

struct CoordSink
src/light/moonlive/MoonLiveBuiltins_light.h:197

Public Attributes

CoordFn fn = nullptr

void * ctx = nullptr

FadeSink

struct FadeSink
src/light/moonlive/MoonLiveBuiltins_light.h:193

Public Attributes

FadeFn fn = nullptr

void * ctx = nullptr

FlowSink

struct FlowSink
src/light/moonlive/MoonLiveBuiltins_light.h:225

The trail plane a script advects and decays, and the frame's delta.

Public Attributes

uint16_t * a = nullptr : one of the two planes, three uint16 per light

uint16_t * b = nullptr : the other; which one holds the trail is front

bool * front = nullptr : true: a holds the trail; false: b does

const uint32_t * frame = nullptr : the binding's frame counter, for fieldRate

lengthType w = 0

lengthType h = 0

lengthType d = 0 : the plane's extent

uint32_t dtMs = 0 : milliseconds this frame covered

Public Methods

inline uint16_t * live() const : The plane currently holding the trail.

inline uint16_t * spare() const : The plane the next advect writes into.

MotionSink

struct MotionSink
src/light/moonlive/MoonLiveBuiltins_light.h:208

Public Attributes

MotionFn fn = nullptr

void * ctx = nullptr

PalSink

struct PalSink
src/light/moonlive/MoonLiveBuiltins_light.h:201

Public Attributes

PalFn fn = nullptr

void * ctx = nullptr

PoolSink

struct PoolSink
src/light/moonlive/MoonLiveBuiltins_light.h:221

Where the per-frame particle builtins find the pool.

Public Attributes

particles::Pool * pool = nullptr

uint32_t scale =

PoolSizeSink

struct PoolSizeSink
src/light/moonlive/MoonLiveBuiltins_light.h:219

Where pool(n) sends its sizing request.

Public Attributes

PoolSizeFn fn = nullptr

void * ctx = nullptr

TrailSizeSink

struct TrailSizeSink
src/light/moonlive/MoonLiveBuiltins_light.h:213

Where trail(1) sends its request for a plane.

Public Attributes

TrailSizeFn fn = nullptr

void * ctx = nullptr

SinkSlot

struct SinkSlot
src/light/moonlive/MoonLiveBuiltins_light.h:241

Public Attributes

std::atomic< uintptr_t > owner {0}

AddLightSink sink

draw::Canvas canvas

AddControlSink controls : where a defineControls run sends addControl

FadeSink fade : where fade sends its request

MotionSink motion : where the motion setters send their writes

CoordSink coord : where setXYZ sends a folded coordinate

PalSink pal : where setPalEntry writes

PoolSizeSink poolSize : where pool(n) sends its sizing request

PoolSink pool : the live particle pool

FlowSink flow : the trail planes this run may advect

TrailSizeSink trailSize : where trail(1) asks for a plane

More info

Stroke width

A script's numbers arrive as unsigned ABI words and are read back signed, then narrowed to the drawing layer's lengthType. The guard and the narrowing have to read the SAME number, or they disagree above 32767. A width of 40000 passes > 0 as an int32 and arrives at ring as -25536; 65536 arrives as 0, and 65537 as the thinnest line. So the clamp happens before the cast, and an absurd width behaves as the widest a length can hold.