This file is the durable working memory for humans and auxiliary agents continuing this repository. Read it together with ROADMAP.md and docs/feature_tracks/README.md before making substantial changes.
It is intentionally opinionated: it preserves successful decisions, hardware findings, rejected approaches, visual-quality standards, and the reasoning behind the current architecture so a future agent does not rediscover old mistakes or silently regress the project.
Build a fully open, extensible realtime spatial-performance / mixed-reality instrument:
camera + audio + controls + generated assets -> shared semantic state -> deterministic high-rate GPU rendering -> optional sparse neural semantic/style updates -> projector calibration/compensation -> room -> camera feedback
The project should eventually support:
- projector-native installations and room transformation;
- performer/body/hand tracked SFX comparable in polish to strong TouchDesigner work;
- music-driven visual choreography that responds to musical structure rather than FFT noise;
- generated 2D/3D assets from external pipelines such as Genforge;
- mixed-reality summons/entities/arena-like interactions;
- realtime neural style/material transformation when it adds something deterministic graphics cannot.
TouchDesigner is an aesthetic and workflow reference, not a required dependency. The canonical runtime should remain open-source.
- Deterministic spatial ownership first; generative stylization second. Tracking, geometry, IDs, masks and room calibration decide where an effect belongs. AI may decorate/transform that stable state.
- Latest-frame-wins neural inference. Never build a queue of stale camera frames.
- Shared state, not feature islands.
TrackingState,PerformanceState,MusicalSignals, gestures and room events should be reusable across Performer FX, Human Reactor, Song Studio, Neural Mirror and Room Skin. - Generated assets are content, not motion logic. Renderer/tracking/physics own continuity.
- Prototype freely; promote selectively. Debug primitives, ugly technical sketches and rough shaders are acceptable research scaffolding when they test a meaningful idea. They are not the art-quality target and must not silently become the default experience without an art/refinement pass.
- Keep classical/deterministic baselines beside learned paths. A research model is promoted only when it beats a simpler baseline on actual hardware or unlocks a qualitatively new effect.
- Measure latency and stability. Prefer p50/p95/p99 timings, track age/confidence, render/readback cost, VRAM headroom and temporal residuals over vague speed claims.
- Hardware validation is separate from implementation. Never claim a path is validated because code/CI exists.
- F11 toggles fullscreen; ESC exits only the child visual and returns to the same feature configuration with the same session values. Launching must not pop/reset the configuration screen; testing a visual must never force the operator to re-enter settings.
- Keep the feature tracks updated. Major work is incomplete until the appropriate
docs/feature_tracks/*.mdfile andROADMAP.mdare updated.
Primary laptop test machine observed in logs:
- Linux 6.8 / X11
- NVIDIA RTX 4050 Laptop GPU
- 6141 MiB VRAM, ~5.6 GiB free idle
- Python 3.10 supported
Stronger desktop target:
- RTX 4080
- Windows path is especially relevant for Spout/shared-texture workflows and heavier neural modes.
Design 6 GiB profiles conservatively. Do not let optional TensorRT/xFormers/model caches consume all free VRAM.
An old camera implementation selected DirectShow merely because the OpenCV constant existed. Fixed: Windows uses DSHOW/MSMF/ANY, Linux uses V4L2/ANY, macOS AVFoundation/ANY.
System loopback was confirmed working through the native Pulse/PipeWire monitor path (parec). Keep that path first on Linux with SoundCard as fallback.
Never tie FFT size to capture block size. A 256-sample FFT at 48 kHz has 187.5 Hz bin spacing and is useless for a 35–180 Hz bass control. Current design keeps 128/256-sample capture possible while rolling ~2048 samples for spectral analysis.
A real test showed SD-Turbo loaded, then StreamDiffusion failed specifically when xFormers was requested but unavailable. xFormers is optional; the backend now falls back to native PyTorch attention rather than treating it as mandatory.
The first MR asset TUI test exited in argparse because the asset field was empty and --asset was required. That was a product/registry contract bug, not an OpenGL/RTMPose/render failure. The stage now defaults to built-in procedural meshes so the pipeline can be smoke-tested without an external GLB.
Desktop packaging previously omitted the graphics extra/context package. moderngl + glcontext are now explicit; Linux context creation probes EGL first. Use experiments/18_graphics_probe.py when graphics availability is ambiguous.
These are not bans on experimentation. They describe implementations that failed as promoted/default experiences. A new experiment may revisit an underlying idea if it changes the failure mechanism and documents why.
The first Cyber Mage treated upper-silhouette left/right extrema as hands. Gesture logic such as hands-together therefore frequently did nothing. Never build semantic gesture behavior on guessed silhouette extrema.
Circles, straight lines and debug-like geometry were rejected as visually cheap as final presentation. They remain acceptable diagnostic scaffolding. The active promoted direction is real point/landmark tracking + GPU particles + analytic SDF/GLSL effects.
Several early procedural/shader scenes looked like stock demos and failed the artistic bar. In particular, the first Cathedral scene read as nearly static. The lesson is not “never make an ugly shader”; it is “do not stop at the first technically functioning shader.” If the underlying spatial/math idea has potential, keep it in research/incubation and iterate composition, palette, motion and materials. Rewrite/demote/retire only when appropriate.
The first GPU particle material looked as if a grey shade/film covered the vivid colors. Causes include broad low-threshold bloom, persistent low-energy feedback and per-channel Reinhard compression. Current direction: white-hot cores, saturated shells, thresholded bloom, clean black floor and hue-preserving exponential display transform.
The user supplied an older casual ModernGL shader playground made after roughly two hours of shader experimentation. Despite being technically simple, its visible result was judged substantially more aesthetic, vivid and colorful than several of this repository's earlier shader templates. Treat that as a benchmark and a warning: complexity is not artistic quality.
Useful properties of that reference:
- aspect-correct centered coordinates;
- radial distance as the primary spatial language;
- repeated domains / layered harmonics;
- cosine palettes with strong saturated color travel;
- narrow inverse-distance luminous contours;
- simple coherent time motion;
- black background and obvious bright structures;
- no apologetic grey fog covering the image.
Current visual target:
- vivid emissive color;
- strong negative space;
- white-hot local cores, not globally whitened frames;
- mathematical coherence and symmetry where appropriate;
- motion hierarchy: continuous field motion + sparse strong events;
- projection-readable macro forms with high-frequency detail layered on top;
- no random rainbow noise merely to create complexity.
Technical interest is valuable even before the art is good. Use three gates:
- Prototype/research: allowed to be ugly, crude or unstable if it tests a meaningful rendering, mathematical, tracking, spatial, interaction or neural idea.
- Incubation/art pass: if there is potential, invest. Improve composition, palette, material/light hierarchy, motion, transitions and post-processing. User criticism/projector feedback is iteration data.
- Promotion/default: only after the idea is visually convincing, robust and worth sustained projection/recording.
Do not prematurely delete a promising experiment because its first visual pass is weak. Preserve the useful technical seed and keep pushing the art. Conversely, do not defend a mediocre promoted visual merely because the implementation is clever.
Read docs/ART_DIRECTION.md before creating/promoting a new visual scene.
The highest-potential branch. Musical analysis produces MusicalSignals; a GPU particle stage turns them into persistent choreography. Current direction includes section/phrase-aware Journey control, analytic/math backdrops, and authored cosmic vector fields (nebula advection, binary-star gravity, event-horizon collapse, wandering multi-well flow). Music should conduct a scene, not twitch every pixel.
Preferred open performer-effects path:
RTMPose/whole-body -> semantic anchors -> SpellGrammar -> GPU particles + SDF spell geometry -> optional generated assets -> projector.
Generic LK point tracking remains useful for fabric, hair, props and non-semantic motion even when real landmarks are present.
Analytic vivid radial shader branch with five equation families:
- rose lattice;
- hypotrochoid engine;
- log-spiral interference;
- phyllotaxis reactor;
- Bessel wave chamber.
This branch exists specifically to raise the art bar beyond generic procedural templates.
Keep as a scene-research branch, not sacred legacy. Event Horizon/Aurora/Liquid can evolve; Cathedral was rewritten once already because the original was too static. Promising technical ideas should be incubated and improved; weak promoted defaults should be rewritten or demoted rather than preserved out of inertia.
Use neural video as semantic/material skin, not as the source of exact hand/room geometry. Existing baseline flow-warps previous neural output between sparse AI keyframes and measures residuals.
Built-in assets make bring-up possible without files; external GLB/glTF/OBJ can come from Genforge or other content pipelines. The current mesh renderer is geometry/normals/emissive-first; PBR textures, skins and animation are future work.
Built-in MR mesh names should stay usable as test fixtures:
builtin:cyber_orbbuiltin:energy_ringbuiltin:crystalbuiltin:relicbuiltin:dronebuiltin:sigil_totembuiltin:summon_proxy
VFX packs should retain generator/model/prompt/seed/provenance/license metadata when available.
- Continuous bass/mids/highs modulate broad field properties; they do not all trigger discrete events.
- Highs are detail, not the global clock.
- Strong visual events use adaptive gates + refractory spacing.
- One captured audio block can trigger an event at most once even if the display loop reads it multiple times.
- Scene/choreography changes prefer phrase boundaries; drops may override dwell for an urgent change.
- Particle state should survive choreography transitions rather than resetting.
- Default particle background can be pure black. If a Polar Math background is enabled, blend it as restrained emissive structure, not haze.
- Record useful operating points in
docs/feature_tracks/audio_visual.md.
- deterministic high-rate geometry/points/landmarks;
- previous-frame optical-flow warp;
- blend fresh neural keyframes against motion prediction;
- stable seed/style/prompt interpolation;
- mask-aware compositing;
- prior-style/latent/state reuse where the backend allows;
- pose/depth/edge/semantic control maps;
- TemporalNet/StreamV2V/causal video experiments;
- newer video models only when they beat the measured baseline on latency/VRAM/stability.
Never claim a generative model mathematically guarantees frame consistency.
Typical development setup:
git pull
source .venv/bin/activate
python -m pip install -e '.[ui,vision,audio,graphics,performer,assets3d,interop,dev]'
python -m projection_mapping.tuiGraphics probe:
python experiments/18_graphics_probe.pyHigh-end visual shader/material probe:
python experiments/21_visual_probe.pyRun tests:
python -m pytest -q
python -m ruff check src tests --select E9,F63,F7,F82Before changing a subsystem:
- Read this file.
- Read
ROADMAP.md. - Read the subsystem feature track.
- Inspect current implementation and recent hardware logs before proposing a rewrite.
- Separate facts observed on hardware from hypotheses.
- Preserve good presets and rejected-path lessons in the track.
- Implement a measurable baseline before adding a research-heavy model.
- Update tests and registry/dependency declarations when adding a runnable artifact.
- Update the roadmap/track with what is implemented, CI-tested, and still speculative.
- Experiment broadly beneath the surface, but prefer finishing one visually convincing vertical slice at a time for the promoted/default experience.
The product-facing design is now three primary lanes: Spatial Memories (navigable point-cloud environments), Spectral Reactor (audio visualization), Human Cloud (person point effects). Existing experimental scenes remain available under research lanes. New static browser WebGL2 stage, loopback-only serving, file and clipboard image relief, and camera/audio preview are on a feature branch, not hardware validated. Images are 2.5D, camera edges are not RTMPose landmarks. This intentionally does not replace the Python calibration/render plane. A standalone Windows PyInstaller onedir build is scripted, not tested. A separate native attractor black-floor gate was added as a tunable hedge against washed-out additive haze; its visual effect requires a hardware A/B. Next priority: polish actual footage before public promotion; connect existing tracking and musical state via secured local IPC. Do not re-enable Actions. See docs/SPATIAL_STUDIO.md and docs/feature_tracks/spatial_memories.md.
- Validate the vivid particle material overhaul on the RTX 4050/projector; tune bloom/black floor from actual footage.
- Validate all five Polar Math modes and identify which deserve deeper art investment; do not discard interesting math solely for an ugly first pass.
- Make Song Studio Journey reliably move between choreography banks at musically sensible boundaries.
- Continue improving GPU spell/SDF geometry and generated assets.
- Validate RTMPose hand/body anchors and performer FX latency.
- Add PBR/animated generated-asset rendering and the Genforge exporter contract.
- Remove GL -> CPU readback once the visual language is worth preserving.
- Then integrate performer/audio/room state and neural skinning into one coherent stage system.
The standard for promoted work is not merely “works”. The standard is worth filming and projecting. The standard for an early experiment is different: does it teach us something or open a path worth refining?