Skip to content

hookdial v0.1.0

Choose a tag to compare

@jdotcollins jdotcollins released this 30 Nov 15:18
· 10 commits to main since this release
4ef9dc3

First release. hookdial turns the tunable values in your mpv shaders into on-screen sliders and reloads a shader when you save it.

Install: unzip hookdial-v0.1.0.zip into mpv's scripts folder, so you get scripts/hookdial/main.lua. Then press Alt+h in mpv. It needs mpv 0.39 or newer.

What it does

  • Sliders for every //!PARAM in your active shaders, applied live through glsl-shader-opts, on vo=gpu-next and vo=gpu.
  • Sliders for numeric #define lines in shaders without //!PARAM. Your files are never modified; hookdial loads a tuned copy instead.
  • Hot reload (w in the menu, or script-binding hookdial/watch), and a one-shot hookdial/reload.
  • Per-shader presets (s, l and d in the menu), stored in ~~/script-opts/hookdial-presets.json.
  • Compile errors on screen, with the shader name and the line in your file.
  • An API for other scripts, input.conf and JSON IPC: set, step, reset, preset commands and a published list of every shader's values. See docs/api.md.

Known limitations (manual)

  • Tested on Windows only, with mpv 0.42. Linux and macOS should work; please report problems.
  • A binding that toggles a shader by its path stops matching once hookdial has loaded a tuned copy of it.
  • Shaders that use CONSTANT, DYNAMIC or uint params, or call linearize()/delinearize() (many CRT shaders), run only on vo=gpu-next. On vo=gpu they are marked "needs vo=gpu-next".
  • mpv keeps every reloaded shader version in memory until the video output restarts, a few KB each. A fix is proposed upstream in mpv-player/mpv#18920.

MIT licensed.