Shader Controls

Code editor, parameters, modulators, Master Clock, timeline, Playable and 360 Doctor

Last updated: 2026-11-20

These are the controls beside the preview. Opening, Compile and autosave are on Shader Workshop. Rendering is on Shader Output.

Code editor

The editor holds up to 32 .glsl files, including the fixed source.glsl. Together they stay within 64 KiB, and so does the source after includes expand. Include depth is 16. Paths stay within 256 bytes. #include "path.glsl" includes each file once and refuses a cycle.

The Shader source file picker sits with Create file, Rename file and Delete file. Rename and Delete are disabled for source.glsl. The name hint is "Relative .glsl paths, for example lib/noise.glsl. source.glsl stays fixed." File changes go through Review file batch or Review deletion, then Accept file batch. A file that an include still names cannot be deleted.

The line-1 header comment folds automatically. The chip reads "⋯ N parameters", or just "⋯" when there are none. Click it to expand (Show the Shader header). While the editor is focused, Ctrl+Enter (Cmd+Enter on macOS) compiles and Ctrl+Shift+E exposes a selected number. Compile errors mark the matching line.

Editor keys and indentation

Keys

These keys apply while the code editor has focus. The on-screen Compile tooltip always says Ctrl+Enter.

Key Action
Ctrl+Enter (Cmd+Enter on macOS) Compile.
Ctrl+Shift+E (Cmd+Shift+E on macOS) Expose selection. In the app hotkey list the same chord is Reframe Export, and that binding applies when Reframe is active.
Ctrl+\ Collapse or expand the side panel.
Tab / Shift+Tab Indent or outdent.
Esc Closes Expose, then exits pointer mode, then collapses the selection, then leaves the editor. After Esc, Tab moves focus out of the editor.
Ctrl+Z / Ctrl+Shift+Z Undo or redo the current file's text.

The usual code-editor keys also work.

Indentation

Indentation is detected per file. Tabs win when they are used on at least two lines and more often than spaces. Otherwise the file uses spaces at width 2, 4 or 8, and the default is 4. Change it from the status chip (Spaces: 4 or Tabs: 4) or from … → Indentation…. The choices are Auto-detect, Spaces and Tabs, plus Indent width (Tab display width for tabs). "Applies to new indentation in this file."

Edit and explain selection

Edit selection… and Explain selection are in More code actions, and only in source.glsl. Select one span, type an Instruction, then Ask. That fills the Copilot composer. You send it from Copilot.

Include shader source is off by default and is required for an edit request. Include preview capture sends no image pixels. "Explain Selection is read-only. It does not change the draft."

Expose selection and gutter errors

Expose selection (Ctrl+Shift+E) takes a number literal. Fill Label, Stable ID, Type (Float or Integer), Minimum, Maximum, Step and Default. Review change shows Before and After. Apply turns it into a slider.

Compile errors mark the matching line of the file that has the error. Header parse errors mark line 1. An error that cannot be placed on a line gets no marker.

Parameters

The Parameters card lists every exposed control, with a count badge. Search, filter and Add sit in the header. The empty state says "No exposed parameters. Add one or expose a literal in Code." The limit is 32. At the limit, Add is disabled: "32 is the limit. Remove one in Code to add another."

Each value is Fixed, Modulator or Expression (Fixed / Mod / Expr when the row is compact). A row has Reset to default and Edit definition…. Colour parameters add Exact sRGB (0–1). In an Expression, P_<id> names a parameter. In GLSL the uniform is hxParam_<id>.

Parameter details

Add menu

Add is grouped:

Group Types
Numbers Float, Int, Angle
Choices Boolean, Enum
Vectors Vec2, Vec3, Vec4
Color Color, Gradient

Group places a parameter under a collapsible heading. Click the heading to collapse or expand it. Search still shows matches inside a collapsed group.

An enum with 4 or fewer options is a segmented row. More than 4 options is a dropdown.

Search parameters uses the placeholder "Search by name or P_ token". It matches names or expression names and shows "N of M". Esc clears the text, then closes the box.

Filter parameters has Driven by (Fixed, Modulated, Expression) and Type. Active filters are removable chips with Clear. No match shows "No parameters match".

Definition editor

Edit definition… edits the parameter. Label and a default value are at the top. Angles are entered in degrees. Help is optional ("Add help (optional)").

Number types have min and max, Limit values to range ("Restrict the default and entered values to this range."), and Step. Float and Int add Control: Slider or Number. An enum uses option chips. Click an option's value to make it the default, and + Option adds one. A gradient has Interpolation: Linear or Step.

Pills show Type, ID and Group. The ID is fixed after creation ("Set once, when the parameter was added"). It starts with a lowercase letter and uses only a–z, 0–9 and _. The code-name chip is Copy code name, tooltip "GLSL name: use {name} in the shader code". It shows Not used yet when the code does not read it. The ⋯ menu has Use current as default, Duplicate, Show source change / Hide source change and Copy code name.

Cancel leaves the editor. Add creates a parameter. Apply commits an edit, or Apply and reset when the edit resets values. Ctrl+Enter commits and Esc cancels.

Expression and GLSL names

On each row, P_<id> is the name to use in an Expression (tooltip "Name to use in an Expression"). Channels use P_<id>__x, P_<id>__r, and the same pattern for the other channels. Gradient stops use P_<id>__S_<stopId>__at, __r, __g and __b. The P_ prefix is reserved, so it cannot be a modulator code name.

In GLSL the uniform is hxParam_<id>. A gradient is sampled with hxSample_<id>, which is the code name the editor copies.

Gradient tools

A gradient has 1–8 stops, with Add stop and Remove stop. Right-click the bar or a stop to add, remove or duplicate. The selected stop has a colour picker, a hex field, Position and Exact color for R, G and B.

Load color palette and Palette options offer Copy Palette, Paste Colors, Extract from Image (5 colours), Reverse Order, Mirror base positions and Space base stops evenly.

Each stop's Position and its Red, Green and Blue can be driven on their own, in 0–1. Positions stay in increasing order. Each stop has its own Mapping. A stop that a formula or mapping uses cannot be removed: "Remove formulas or Modulator mappings referencing this stop before removing it." Interpolation and which stops exist stay fixed.

Modulators

The Modulators card adds a modulator. Add modulator opens the form. Editing shows "Edit {code name}". Kind is Time, Click, Envelope or Audio. Label is at most 128 characters. Each modulator has a Code name. Map one onto a parameter with Range or Add. Mouse input is the switch on this card. Audio drives a parameter from a soundtrack or a MIDI, curve or label track, and appears once the Shader has one. See Audio Reactive Shaders.

Modulator details

Time waves

Time waves are Sine, Triangle, Saw up, Saw down, Pulse, Square (stored as "Square (50%)") and Custom. A new Time modulator starts as a beat-synced sine.

Timing is Free time (seconds) or Beat sync (beats). The period field is Period (beats) or Period (seconds/minutes), with a Seconds / Minutes display. The range is 0.000001–86400 seconds, and the reset value is 4. "Period, timing unit and Local speed edits can jump the local phase. Raw t ignores the Master Clock."

More options adds Phase (fraction of a cycle) ("Phase 0.25 peaks a sine."), Duty (0–1, default 0.5, Pulse only), Local speed (0–1024, default 1), and Code min / Code max (those affect only the code alias).

Click

Button is Left or Right. Mode is Gate ("High while the button is held; low when released.") or Toggle ("Each fresh press flips the value. Reset toggle clears it."). A toggle row has Reset toggle.

Envelope

Input is a gate or New keyboard/mouse gate, with Bind key… and Bind mouse left/right. Envelope mode is Held ("Hold to sustain; release to fade.") or Burst ("One press runs Attack → Release."). Attack and Release each have Duration (ms) (0–60000) and Curve: Linear, Ease In, Ease Out or Ease In Out. A curve that is not linear adds Exponent (1–8).

Range and Add

On the parameter, Range maps the wave from 0–1 onto Min → Max. Add offsets the base by ± Amount using the wave in −1…1. Values can pass the slider limits.

From the card, + Map to parameter opens How (Range or Add), Depth / From / To, and Map / Apply mapping. A mapping has an on/off switch and a menu with Retarget… and Remove mapping.

Expression editor

A Custom wave is a Modulator formula. Output is −1…+1. The limit is 512 bytes, 64 nodes and 16 nesting levels. Variables are t, clock_time, beat, beat_phase, cycle, BPM, Speed, pi and l_duty. Functions are sin, cos, abs, min, max, clamp, fract and pulse. Operators are +, -, * and /. Press Preview before Add modulator or Apply is enabled.

An Expression on a parameter is a Formula. The limit is 512 bytes, and a "{n}/512 bytes" counter appears above 400 bytes. T is absolute seconds, t is the same as T, and D is "End − Start, seconds". Constants are pi and e. Functions are sin, cos, tan, abs, floor, ceil, fract, sqrt, exp, log, min, max, pow and clamp. Operators are +, -, *, / and ^. It can read modulator code names and other parameters' P_ names, up to 16 references, with the same 64-node and 16-level limits. Esc discards the unsaved formula.

Mouse input

Mouse input is an on/off switch on this card. "Mouse input uses 16 of the 64 data units. Enable Playable yourself to send canvas clicks." When it is on and Playable is on, the Shader receives held buttons, position and direction, and the last press and release. The toolbar shows Left held, Right held or No button held, plus held position or neutral position. Turning mouse input on shows the Playable button. Copilot cannot turn Playable on.

Master Clock

Master Clock sets tempo and Master speed. Add clock starts one. Master Clock options has Reset clock (120 BPM, 1×, beat 0 at 0:00) and Copy clock variables. The summary reads "{bpm} BPM · {speed}×". Clock edits save automatically and can be undone. Clock actions need a Compile first.

Tempo is BPM. The slider runs 20–300. A typed value above 0 is accepted up to 1000. Master speed is a multiplier. The slider runs 0–4. A typed value is accepted from 0 to 1024. Both have resets.

Tap Tempo and Align Beat

Tap Tempo starts with "Collecting… tap again." It averages the last 5 taps. A gap over 3 seconds starts the count again. It reports "{bpm} BPM set from {n} taps.", adjusted for Master speed. At speed 0 it is disabled: "Set Master speed above zero to use Tap Tempo."

Align Beat sets the beat count to 0 now. "Beat aligned to 0. Scaled seconds and local phase are preserved. Sine begins at 0, not its peak."

Shader code can read CLOCK_TIME, CLOCK_BEAT, CLOCK_BEAT_PHASE, CLOCK_BPM and CLOCK_SPEED. hx.time stays raw seconds, the same as iTime.

Timeline

The ruler is the Timeline slider. Click or drag to scrub. It shows time labels, frame ticks, the playhead and "End {x} s". Playback stops before End. Buttons are Play / Pause (the tooltip can read "Compile and play"), Reset to start, Step back one frame and Step forward one frame.

Loop ("Loop playback. Saved with the Shader.") is saved with the Shader. A read-only Shader says "Read only. Save As to change the Loop."

Time is "Absolute time T of this sample, in seconds.", with a "Frame n / last" readout. The FPS menu offers 24, 25, 29.97, 30, 60 and 120. The preview default is 30. Range is Start and End in seconds. A Shader with no saved timeline starts at 0 seconds, ends at 60 seconds, and has Loop on.

Space toggles playback and does not need Single-key hotkeys. On the ruler, and not while Alt, Ctrl or Cmd is held, the arrow keys step one frame (left or down, and right or up). Shift+arrow, Page Up and Page Down step ten frames. Home and End jump to the first and last frame. Those ruler keys are part of the timeline. They are not in the hotkey list. See Keyboard Shortcuts.

Playable

Playable is the viewer-toolbar toggle. It appears when the Shader has controls or Mouse input is on. Turning it on routes the keyboard and mouse to the Shader and focuses the viewer. It cannot be turned on while rendering, before the first preview draws, or when the 360 viewer is hidden ("Show the 360 viewer to enable Playable"). Status can read Mouse locked or Mouse lock lost · enable Playable again. Copilot cannot turn it on.

The Playable Shaders card says "Controls are copied into this Shader. Camera movement works when its GLSL uses the camera helpers." Hints uses H, and H needs Single-key hotkeys. Esc exits Playable.

Presets and the controls list

Preset offers Arrow fly · mouse-free travel, Unreal fly · RMB + WASD/QE, and "{name} · Project" for a Project preset. Extend merges the preset in, or Replace replaces controls, then Apply controls. Discard control edits drops unsaved control edits. + Custom is there when the Shader has no controls. Status is "Unsaved controls · excluded from export until Apply" or "Saved controls".

Controls lists each action and its keys. Hints · {key} toggles that list. It is on by default, and the key is H. H needs Single-key hotkeys. Pending layout check means you press that key once in the viewer. The footer says "Esc exits Playable". With nothing bound it says "No active inputs". A blocked key shows "… unavailable. {reason}".

Examples · 2 are "Fly through a ray-marched fractal" and "Enter blast and RMB slice (no camera)". The buttons are Copy source, Paste as new Shader and Apply example convention. The steps end "COMPILE, then enable Playable."

You can also edit Convention name and Profile ID, bind a key (Bind key…, Physical source, Scale, Activation of Playable or Look held), and set Channels and parameter mappings. Camera fields are Speed · world units/sec, Use current pose as start and Reset interaction. Project conventions has Save as Project convention and Default for new opt-in Shaders.

A sequence render freezes Playable controls from the last drawn preview frame and uses that state for the whole render. The dialog says "Camera pose and toggles are frozen from the current preview. Live movement is paused; time animation continues. Continue keeps the original capture." Inputs that need interaction history are refused: camera position and toggle controls can be frozen from a completed preview, and editing stays blocked until the render settles. Details are on Shader Output.

360 Doctor

360 Doctor checks the previewed revision, not the unsaved draft. The info line is "Checks the previewed revision, not your unsaved draft." The summary is Not run, N to look at, or All clear, with a Checked rev N badge.

Run checks ("Running…") measures that revision on the GPU and saves a report. It stays disabled until Compile succeeds: "COMPILE must succeed first." During Import it waits: "Import holds the preview. 360 Doctor waits until it finishes."

Shown on 360 paints the report mask on the 360 view. The caption is "Doctor overlay: red = defect, amber = advisory". Ask Copilot stages a Fix Diagnostics request with the cached report for you to review and send. It never applies a change. It needs a prior run: "Run 360 Doctor on a successful preview before Ask Copilot." Include source ("Include shader source") sends the source with that request. Repairs need it.

Each metric reads None found or a sample count:

  • Broken pixels — non-finite pixels. Any hit is a defect.
  • Seam at 180° — a jump across the wrap. A defect unless it is comparable to ordinary image detail.
  • Aliasing — unstable gradients. Advisory only.
  • Poles — inconsistency at the poles. A defect.
  • Pole stretch — always "Map distortion, not checked".

A compile failure shows Fix code. Unsupported features show "Unsupported: …" and Ask Copilot to rewrite…. A Canvas-space Shader offers Preview as Canvas and Adapt to 360…. Canvas stays Canvas until a saved edit changes its space. That edit is code, so it follows the code lease.

Esc
Searching...
No results found.
Type to search the documentation
↑↓ Navigate ↵ Select Esc Close

We use cookies for analytics to understand how visitors use our site. Privacy Policy