Motivation
The named presets (Gargantua, Quasar, M87* donut, Blazar, Inferno, Zen, …) currently live only in the SwiftUI tuner (tuner/Sources/BlackHoleTuner/ParamSpec.swift). To use one without the tuner you have to hand-copy ~13 disk constants into blackhole.glsl. That leaves out anyone who doesn't build the macOS Swift app, and it's clunky even on macOS for a quick "just give me Zen and reload".
Proposal
A one-line look selector at the top of blackhole.glsl, mirroring the existing #define SIZE_MODE MODE_TOKENS idiom:
#define PRESET PRESET_ZEN // or PRESET_CUSTOM to hand-tune / use the tuner
- A
#if / #elif ladder holds each preset's values, ported verbatim from ParamSpec.swift so the Swift tuner stays the single source of truth for the numbers.
PRESET_CUSTOM (the committed default) keeps today's behavior exactly: the tuner-editable const float literal lines are used.
Tuner compatibility
The tuner's constRe only matches numeric literal lines — ^const float NAME = -?\d+\.\d+;…$. The design keeps those literals live only in the PRESET_CUSTOM branch; named presets source their values from macro identifiers (const float DISK_TEMP = PRESET_DISK_TEMP;), which the regex ignores. So:
- In
PRESET_CUSTOM mode the tuner works exactly as today.
- With a named preset active, the disk look is fixed at compile time and tuner slider edits to disk params are ignored until you switch back to
PRESET_CUSTOM. (Documented in the README.)
No Swift changes in this PR.
Scope
blackhole.glsl: preset name defines, the selector, the value ladder, and the wrapped disk-constant block.
README.md: a short note under Tuning.
Happy to open the PR if this direction looks good — wanted to check the design (especially the tuner-compat approach and whether you'd prefer a different override mechanism) before writing it.
Motivation
The named presets (Gargantua, Quasar, M87* donut, Blazar, Inferno, Zen, …) currently live only in the SwiftUI tuner (
tuner/Sources/BlackHoleTuner/ParamSpec.swift). To use one without the tuner you have to hand-copy ~13 disk constants intoblackhole.glsl. That leaves out anyone who doesn't build the macOS Swift app, and it's clunky even on macOS for a quick "just give me Zen and reload".Proposal
A one-line look selector at the top of
blackhole.glsl, mirroring the existing#define SIZE_MODE MODE_TOKENSidiom:#if / #elifladder holds each preset's values, ported verbatim fromParamSpec.swiftso the Swift tuner stays the single source of truth for the numbers.PRESET_CUSTOM(the committed default) keeps today's behavior exactly: the tuner-editableconst floatliteral lines are used.Tuner compatibility
The tuner's
constReonly matches numeric literal lines —^const float NAME = -?\d+\.\d+;…$. The design keeps those literals live only in thePRESET_CUSTOMbranch; named presets source their values from macro identifiers (const float DISK_TEMP = PRESET_DISK_TEMP;), which the regex ignores. So:PRESET_CUSTOMmode the tuner works exactly as today.PRESET_CUSTOM. (Documented in the README.)No Swift changes in this PR.
Scope
blackhole.glsl: preset name defines, the selector, the value ladder, and the wrapped disk-constant block.README.md: a short note under Tuning.Happy to open the PR if this direction looks good — wanted to check the design (especially the tuner-compat approach and whether you'd prefer a different override mechanism) before writing it.