Skip to content

About

jolt slipstream / c++ slughorn demo

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

20 Commits

Folders and files

Repository files navigation

Picture Plane

An interactive Jolt + Slipstream vector-feedback instrument. A rectangular picture plane and crosshair are injected into a feedback loop; previous frames are repeatedly reprojected through a movable pinhole camera, faded, and colored by age.

Pan, dolly, roll, yaw, and pitch produce spirals, tunnels, and keystone distortion. Camera changes propagate through existing feedback rather than replacing it with a newly generated static stack.

Screencast_20261028_204422.mp4

WASM demo for desktop web browser: https://github.com/jasalt/vector-feedback

See also similar Slughorn + Zig based application which is (unsurprisingly) more performant: https://github.com/jasalt/slughorn-test

Quick start on Fedora Linux (Nix)

With native/libslipstream.so already built (see below, or use the library built in the shared VM workspace), run from this project directory:

LD_LIBRARY_PATH=/usr/lib64${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} \
  nix run 'git+https://github.com/jolt-lang/jolt.git?submodules=1' -- -M:run

FreeType must be installed on the host (sudo dnf install freetype). Even when it is installed, the Nix-provided Jolt may not find Fedora's shared libraries automatically; LD_LIBRARY_PATH lets the loader find libfreetype.so.6 in /usr/lib64.

This is a quick-start workaround, not a portable Nix package: a VM-built library must be compatible with the host's C++ and glibc runtimes. A fully Nix-managed build of Slipstream and its dependencies avoids mixing those runtimes.

Build and run

Requires Jolt 0.8.23+, Git, CMake, a C++20 compiler, Python 3 (GLAD generation), pkg-config, FreeType development headers, and OpenGL. Linux also needs GLFW's X11/Wayland development dependencies. CMake fetches GLFW, GLAD, and msdfgen; the setup script fetches pinned Slughorn sources and its JSON submodule. First build requires network access.

bash scripts/setup.sh
jolt -M:run

For a source checkout of Jolt, set JOLT=/absolute/path/to/jolt/bin/jolt when running setup, then use that executable in place of jolt. Set SLUGHORN_HOME to reuse an existing complete Slughorn checkout; otherwise setup uses .cache/slughorn.

The program detects common Linux/macOS fonts. If necessary:

jolt -M:run --font /absolute/path/to/font.ttf

Or set SLIPSTREAM_TEST_FONT.

Experimental browser target

Desktop remains the primary renderer. An optional Jolt + Slipstream WebGL2/Wasm prototype shares the model and feedback shader. See web/README.md for build/serve commands and docs/wasm-plan.md for progress, validation and limitations. The repo owns a pinned Linux x86_64 Nix toolchain and builds its Chez cross compiler/libffi prerequisites from upstream sources; no sibling checkout is required. It is not a general Slipstream/Glimmer browser release.

nix develop -c bash scripts/wasm-live-build.sh
python3 web/serve.py
# http://127.0.0.1:8000/scheme.html

Controls

Input Camera adjustment
Left drag Horizontal / vertical translation
Right drag Yaw / pitch (perspective tilt)
Middle drag Roll
Mouse wheel Dolly / magnification
+ / - (or keypad + / -) Increase / decrease tail by 10 frames
Space Pause / resume feedback
R Reset camera and clear feedback
Close window Quit

The tail starts at 48 frames and ranges from 8 to 78 frames (bounded for OpenGL 3.3 uniform limits). Each key press changes it once; = also works as +. Shortening discards old frames immediately, even while paused; lengthening fills the extra history as feedback runs. Reset restores 48 frames.

Drag adjustments are relative and remain set after release. The initial camera has a gentle shrink, roll, and tilt, so feedback starts without interaction. A mouse with three buttons is recommended. Camera parameters remain editable while paused; feedback resumes with the new settings.

Verification

Pure math, temporal-history, input, and shader-uniform tests need no graphics libraries or native build:

jolt -M:test

Deterministic rendering smoke test (65 render frames, then quit):

jolt -M:run --frames 65 --capture frame.ppm
# On headless Linux with Mesa and Xvfb installed:
xvfb-run -a jolt -M:run --frames 65 --capture frame.ppm

Capture is a top-down RGB PPM. Timed runs advance one feedback tick per rendered frame; normal interactive runs use elapsed time with bounded catch-up.

Implementation

  • src/feedback/model.clj: pure camera homographies, input, and bounded 60 Hz temporal simulation.
  • src/feedback/visuals.clj: Slipstream scene, projective vector coverage shader, and control readout.
  • src/feedback/main.clj: native window/input lifecycle and optional capture.

The loop initially retains 48 vector-frame homographies, adjustable with + / -. Each tick applies the current camera to all surviving frames and injects a new rectangle. Slipstream renders a single immutable vector quad; typed mat3 uniforms inverse-project each pixel into each retained frame, where rectangle/crosshair coverage is analytically antialiased. Geometry/atlases are not rebuilt every frame, and the normal loop performs no framebuffer readback.

This is vector feedback, not a webcam feed or recursive framebuffer texture effect: vectors remain crisp under reprojection, history is finite (0.8 seconds initially; adjustable from approximately 0.13 to 1.3 seconds), and there is no raster blur or external video input. The camera controls describe the per-pass feedback transform, as in a camera pointed at its own monitor.

About

jolt slipstream / c++ slughorn demo

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages