Repository navigation
Releases
hookdial v0.1.2
Switch shaders from the menu, without input.conf bindings.
Install or upgrade: unzip hookdial-v0.1.2.zip into mpv's scripts folder, replacing the old scripts/hookdial. It needs mpv 0.39 or newer.
New
- Shader picker. In the Alt+h menu, c changes the selected row's shader to another from your shaders folder, a adds one after the others, and x removes the selected row's shader. The list shows
~~/shaders(theshader_diroption) and one level of subfolders, so packs like Anime4K show up; type to filter, and shaders already loaded are marked. To switch without opening the menu, bindscript-binding hookdial/pickin input.conf (for exampleAlt+p script-binding hookdial/pick): the shader you pick replaces all loaded shaders, and "(no shader)" turns them off. See "Switching shaders" in the manual. - For other scripts: each
#defineinuser-data/hookdial/shadersnow has atype,"int"or"float"(api.md). The change is additive;api_versionstays 1.
For contributors
tests/tools/cost.luameasures each shader's GPU cost from mpv's own pass timers.- The census tool now reports shaders whose passes never ran as
notruninstead of counting them as loaded, and documents how to check prescalers on an enlarged video.
hookdial v0.1.1
A fix release. Upgrading is recommended if you tune #define values.
Install or upgrade: unzip hookdial-v0.1.1.zip into mpv's scripts folder, replacing the old scripts/hookdial. It needs mpv 0.39 or newer.
Fixed
- Memory kept growing while you tuned
#definevalues. mpv onvo=gpu-nextkeeps memory for every distinct shader text and file it has loaded, until it quits. hookdial wrote each change to a new file, so a long tuning session grew the player by about 170 KB per change without limit. Copies are now named after their content (<name>.hd<pid>x<hash>), so returning to a setting reuses its copy. In a side-by-side test of the same 18-minute slider drag, v0.1.0 grew by 221 MB and was still climbing; v0.1.1 grew by 47 MB in the first two minutes and then stayed flat. - A shader broken the same way twice showed as fine. libplacebo reports a failing shader text only once, so after a hot reload back to the same broken text, the menu cleared the error. hookdial now remembers recent failures and shows them again.
- Every slider looked full. The track behind the bar was drawn nearly opaque in the same white as the fill. It is now faint.
Copies left by v0.1.0 are still recognised and cleaned up.
Full list of changes: #20.
hookdial v0.1.0
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
//!PARAMin your active shaders, applied live throughglsl-shader-opts, onvo=gpu-nextandvo=gpu. - Sliders for numeric
#definelines 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-shothookdial/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
uintparams, or calllinearize()/delinearize()(many CRT shaders), run only onvo=gpu-next. Onvo=gputhey 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.